In [1]:
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import IPython.display as display
%matplotlib inline
import seaborn
# import mpld3
from datetime import datetime
seaborn.set()
np.set_printoptions(precision=4, suppress=True)
pd.set_option('display.max_colwidth', -1)
# mpld3.enable_notebook()
This notebook will generate (and save) images and html source for the ISMIR stats page. Be careful when running the scripts. The save paths have been hard-coded as relative paths and may overwite other files.
In [2]:
data = pd.read_csv("data/Conference Statistics.csv")
data
Out[2]:
In [3]:
fig, ax = plt.subplots(1, 1, figsize=(8, 6))
fields = ['Number of Participants', 'Submitted Papers', 'Accepted Papers']
for n, k in enumerate(fields):
ax.bar(data.Year + 0.2*n, data[k], width=0.2,
fc=seaborn.color_palette()[n], label=k)
ax.set_xlabel("Year")
ax.set_ylabel("Count")
ax.set_title("")
plt.xticks(data.Year + 0.3, [str(v) for v in np.array(data.Year)])
plt.legend()
# plt.savefig('../ismir_web/img/conference_stats.png')
In [4]:
data = pd.read_csv("data/Community Membership.csv")
data
Out[4]:
In [5]:
date_format = "%m/%d/%Y"
d = [datetime.strptime(d, date_format) for d in np.array(data.Date)]
d = [dd.days for dd in np.diff(d)]
d = np.cumsum(d)
d = np.r_[0., d]
d = d / np.max(d) * (len(d) - 1)
In [6]:
fig, ax = plt.subplots(1, 1, figsize=(8, 6))
ax.plot(d, data.Members, 'o-', c=seaborn.color_palette()[0], ms=10)
plt.xticks(d, data.Date, rotation=45)
plt.title("Number of Members")
ax.set_xlabel("Date")
ax.set_ylabel("Count")
# plt.savefig('../ismir_web/img/membership_stats.png')
In [7]:
formatter = lambda x: '<strong>'+x+'</strong>' if 'Music Information Retrieval' in x else x
data = pd.read_csv("data/Google Scholar Publication Rankings - Multimedia.csv", header=1)
cols = data.keys()
rank = np.where(['Music Information Retrieval' in r for r in data.Publication])[0]
rank = int(data.Rank[rank])
if rank == 1:
post = 'st'
elif rank == 2:
post = 'nd'
elif rank == 3:
post = 'rd'
else:
post = 'th'
In [8]:
table = ''
table += '<p><b>ISMIR</b> is currently the <b>{rank}{post} '.format(rank=rank, post=post)
table += 'ranked publication in the “Multimedia” subcategory of '
table += '“Engineering and Computer Science”</b> '
table += '<a href="https://scholar.google.com/citations?view_op=top_venues&hl=en&vq=eng_multimedia" '
table += 'target="new">(Link.)</a></p>\n'
table += data.to_html(index=False, formatters={'Publication': formatter}, escape=False)
In [9]:
data = pd.read_csv("data/Google Scholar Publication Rankings - Music & Musicology.csv", header=1)
cols = data.keys()
rank = np.where(['Music Information Retrieval' in r for r in data.Publication])[0]
rank = int(data.Rank[rank])
if rank == 1:
post = 'st'
elif rank == 2:
post = 'nd'
elif rank == 3:
post = 'rd'
else:
post = 'th'
In [10]:
table += '<p> </p>\n'
table += '<p>and the <b>{rank}{post} '.format(rank=rank, post=post)
table += 'ranked in the “Music & Musicology” subcategory of '
table += '“Humanities, Literature, and Arts”</b> '
table += '<a href="https://scholar.google.com/citations?view_op=top_venues&hl=en&vq=hum_musicmusicology" '
table += 'target="new">(Link.)</a></p>\n'
table += data.to_html(index=False, formatters={'Publication': formatter}, escape=False)
In [11]:
print(table)
In [12]:
with open('stats_source.txt', 'r') as f:
stats_source = f.read()
In [13]:
# with open('../ismir_web/stats.php', 'w') as f:
# f.write(stats_source.format(impact=table))
In [ ]: