[Python] Pandas 小记录

pd.set_option('display.max_rows', 500)

pd.set_option('display.max_columns', 500)

pd.set_option('display.width', 1000)


DataFrame 与 特定栏位corr

np.abs(X_tr.corrwith(y_tr['time_to_failure'])).sort_values(ascending=False).head(12)

pandas iterrows with tqdm

' for jupyter notebook'from tqdm import tqdm_notebook as tqdm' for prompt'from tqdm import tqdmfor index, row in tqdm(df.iterrows(), total=df.shape[0]):   print("index",index)

DataFrame col rename

df.rename( columns={"A": "a", "B": "c"})

关于作者: 网站小编

码农网专注IT技术教程资源分享平台,学习资源下载网站,58码农网包含计算机技术、网站程序源码下载、编程技术论坛、互联网资源下载等产品服务,提供原创、优质、完整内容的专业码农交流分享平台。

热门文章