THis notebook records some tips for the pandas module
In [1]:
import pandas as pd
import numpy as np
In [2]:
df = pd.DataFrame(np.random.randint(0,100,size=(10, 4)), columns=list('ABCD'))
df
Out[2]:
In [3]:
df.loc[3:9:2, 'B':]
Out[3]:
In [4]:
df2 = pd.DataFrame([['2017-01-01', 253, 234], ['2017-02-04', 283, 333], ['2017-02-11', 3, 55]], columns=['time', 'data1', 'data2'])
df2
Out[4]:
In [5]:
df2.index = pd.to_datetime(df2.pop('time'))
df2
Out[5]: