LoginSignup
0
0

More than 5 years have passed since last update.

Python関係の自分用メモ

Last updated at Posted at 2018-11-09

pandas

行ごとに nan の個数を数える。

 df.isnull().sum(axis=1)

表を横に連結する。

 df_new = pd.concat([df1, df2], axis=1)

文字コードを意識して読み込む

 df= pd.read_csv("japanese.csv",encoding="SHIFT-JIS")

エクセルファイルの特定のシートを開く

 xlsx_df = pd.ExcelFile(xlsx_file, encoding='utf8')
 sheet1_df = xlsx_df.parse(sheet1)

欠損値を穴埋めする(直前の値を使って埋めていく)

 df_method.fillna(method='ffill')
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0