# Path: twip/constant.py
# DATA_PATH = os.path.abspath(os.path.join(BASE_PATH, '..', 'data'))


from past.builtins import basestring
from collections import Counter
from matplotlib import pyplot as plt 
from twip.constant import DATA_PATH
from IPython.display import display, HTML 
import os
import pandas as pd
import matplotlib
import gzip
import gzip

# In[12]:

dates = pd.read_csv(os.path.join(DATA_PATH, 'datetimes.csv.gz'), engine='python')

for col in dates.columns:
    print(col)
    dates[col] = pd.to_datetime(dates[col])


# In[13]:

dates.created_at.dt.hour


# In[8]:

dates.created_at.dt.weekday


# In[23]:

dow = pd.Series(dates.created_at.dt.weekday)
dow.hist(bins=[0,1,2,3,4,5,6,7])
plt.xlabel('0=Mon    6=Sun')
plt.ylabel('Tweets')


# In[18]:


# Path: twip/constant.py
# DATA_PATH = os.path.abspath(os.path.join(BASE_PATH, '..', 'data'))


# Path: docs/notebooks/05 Features -- Time.py
from past.builtins import basestring
from collections import Counter
from matplotlib import pyplot as plt 
from twip.constant import DATA_PATH
from IPython.display import display, HTML 
import os
import pandas as pd
import matplotlib
import gzip
import gzip


# In[12]:

dates = pd.read_csv(os.path.join(DATA_PATH, 'datetimes.csv.gz'), engine='python')

for col in dates.columns:
    print(col)
    dates[col] = pd.to_datetime(dates[col])


# In[13]:

dates.created_at.dt.hour


# In[8]:

dates.created_at.dt.weekday


# In[23]:

dow = pd.Series(dates.created_at.dt.weekday)
dow.hist(bins=[0,1,2,3,4,5,6,7])
plt.xlabel('0=Mon    6=Sun')
plt.ylabel('Tweets')


# In[18]:


nums = pd.read_csv(os.path.join(DATA_PATH, 'numbers.csv.gz'), engine='python')