numpy :
np[begin:end:k]
np[row,column]=np[(row,column)]
row,column may be single inter or list or slice or boolean array
nd.take(index list),nd[list]
nd.put(index list,42)将42赋值给index
np.random.choice(array,size=2,p=[probability list]
np.where(condition,x,y)
condition boolean array
pandas:
df.column_name
df[slice] row slice
df[df>0]返回df的subsequent,同df.where不同
df.loc[]
row name
row name list or slice
row name,column name
row name list or slice ,column name list or slice
boolean array or callable function,boolean array or callable function
df.iloc[]
inter
inter list or slice
inter list or slice,inter list or slice
boolean array ,boolean array
df.at
df.iat
df.sample(n=3,axis=0,replace=True,weights=example_weights_list,random_state=2)采样
series.isin([element list])返回Boolean array
df.where(condition,x)条件不成立时取x,返回shape同df
df1.where(conditon,df2)==np.where(condition,df1,df2)
df.query(condition str)