frame = pd.DataFrame([[1.4,np.nan],[7.1,-4.5],[np.nan,np.nan],[0.75,-1.3]],index=['a','b','c','d'],columns=['one','two']) print(frame) ==> one two a 1.40 NaN b 7.10-4.5 c NaN NaN d 0.75-1.3 print(frame.sum()) ==> one 9.25 two -5.80 dtype: float64 print(frame.sum(axis='columns')) ==> a 1.40 b 2.60 c 0.00 d -0.55 dtype: float64 print(frame.idxmax()) ==> one b two d dtype: object print(frame.describe()) ==> one two count 3.0000002.000000 mean 3.083333-2.900000 std 3.4936852.262742 min 0.750000-4.500000 25% 1.075000-3.700000 50% 1.400000-2.900000 75% 4.250000-2.100000 max 7.100000-1.300000
obj = pd.Series(['c','a','d','a','a','b','b','c','c']) print(obj) ==> 0 c 1 a 2 d 3 a 4 a 5 b 6 b 7 c 8 c dtype: object print(obj.unique()) ==> ['c''a''d''b'] print(obj.value_counts()) ==> c 3 a 3 b 2 d 1 dtype: int64 print(obj.isin(['b','c'])) ==> 0True 1False 2False 3False 4False 5True 6True 7True 8True dtype: bool