LOC,IX,Mean
1)loc[specific index row and clm]
df.loc[0] #0 index ni row aavi jse
df.loc[99]#99 index ni row aavi jse
2)IX{loc na badle lx lkhvanu]
df.ix[0]
or
df.ix[[0,99,76]] # 0,99,76 number ni index aavse
or
df.ix[[0,99,76],['HP','Attack']]
or
df.ix[[0,99,76],[5,6]]
3)Mean
df.loc[0] #0 index ni row aavi jse
df.loc[99]#99 index ni row aavi jse
2)IX{loc na badle lx lkhvanu]
df.ix[0]
or
df.ix[[0,99,76]] # 0,99,76 number ni index aavse
or
df.ix[[0,99,76],['HP','Attack']]
HP | Attack | |
---|---|---|
0 | 45 | 49 |
99 | 30 | 35 |
76 | 65 | 90 |
df.ix[[0,99,76],[5,6]]
HP | Attack | |
---|---|---|
0 | 45 | 49 |
99 | 30 | 35 |
76 | 65 | 90 |
mean=df['HP'].mean()#'HP pokemon no dataset
mean
69.25875
Comments
Post a Comment