In [1]:
import numpy as np
In [2]:
import pandas as pd
In [3]:
labels = ['a','b','c']
my_data = [10,20,30] # a list
arr = np.array(my_data) # an array
d = {'a':10,'b':20,'c':30}
In [9]:
pd.Series(my_data, labels) # passing pandas a list, defining labels
Out[9]:
In [8]:
pd.Series(arr) # passing pandas an array, same thing
Out[8]:
In [30]:
pd.Series(d) # whoa dictionaries are dope
Out[30]:
In [31]:
pd.Series(data=['a','b','c'])[1]
Out[31]:
In [17]:
pd.Series(data=[sum,list,len]) # pandas can hold lots of shit
Out[17]:
In [20]:
ser1 = pd.Series([1,2,3,4],['Williams','Bates','Bowdoin','Colby'])
In [21]:
ser2 = pd.Series([1,2,5,4],['Williams','Bates','Middlebury','Colby'])
In [22]:
ser1['Williams'] # numba one
Out[22]:
In [29]:
ser1 + ser2
Out[29]:
In [ ]: