iT邦幫忙

0

[Python] Pandas 小記錄

  • 分享至 

  • xImage
  •  

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 tqdm

for index, row in tqdm(df.iterrows(), total=df.shape[0]):
   print("index",index)

DataFrame col rename

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

尚未有邦友留言

立即登入留言