# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# +
import pandas as pd
import numpy
import matplotlib.pyplot as plt
import seaborn as sns
import re
import tqdm

import datetime
now = datetime.datetime.now()

# -

df = pd.read_pickle('data/arxiv-last50years-data.pickle')

df.shape

df.head()

# +
yearthresh = now.year+2
useless = []
for i in df.index:
    if int(df.year[i])>yearthresh:
        useless.append(i)
        
df.drop(useless, axis=0, inplace=True)

# +
sns.set_style('darkgrid')
fig, ax = plt.subplots()
fig.set_size_inches(15, 6)
psns = sns.countplot(x="year",data=df, ax=ax)
plt.xticks(rotation=45)

plt.show()
# -

import plotly
import plotly.express as px
import plotly.graph_objs as go

data = [
    go.Bar(
        y=df['year'].value_counts(),
        x=df['year'].value_counts().keys(),
        orientation='v',
#         text="d",
    )]
layout = go.Layout(
    height=500,
    title='Publications per Year',
    hovermode='closest',
    xaxis=dict(title='Years', ticklen=5, zeroline=False, gridwidth=2, domain=[0.1, 1]),
    yaxis=dict(title='Counts', ticklen=5, gridwidth=2),
    showlegend=True
)
fig = go.Figure(data=data, layout=layout)
# py.iplot(fig, filename='Sector/ Area of Coaches - Combined')
# plotly.plot(fig, )
fig.show()

df.submitter.value_counts()[:10]

data = [
    go.Bar(
        y=df['categories'].value_counts(),
        x=df['categories'].value_counts().keys(),
        orientation='v',
        text="d",
    )]
layout = go.Layout(
    height=500,
    width=2000,
    title='Categories published in last 50 years',
    hovermode='closest',
    xaxis=dict(title='Categories', ticklen=5, zeroline=False, gridwidth=2, domain=[0.1, 1]),
    yaxis=dict(title='Counts', ticklen=5, gridwidth=2),
    showlegend=True
)
fig = go.Figure(data=data, layout=layout)
# py.iplot(fig, filename='Sector/ Area of Coaches - Combined')
# plotly.plot(fig, )
fig.show()



StarcoderdataJupyterScriptsDedupFiltered