import numpy as np import pandas as pd import tushare as ts df=pd.DataFrame(np.random.randn(1000,4)) print(df.head()) print(df.describe())#列出一些信息 print(df.std())#标准差 print(df[(np.abs(df) >(3*df.std())).any(axis=1)])#绝对值大于三倍标准差,这是副本 print(df.drop(438,inplace=True))#本地生效False是副本 df.drop(df[(np.abs(df) >(3*df.std())).any(axis=1)].index,inplace=True)