import pandas as pd
import numpy as np

date = pd.date_range('20191231', periods=6)
df = pd.DataFrame(np.arange(24).reshape(6,4), index=date, columns=['A','B','C','D'])

df.iloc[0,1] = np.nan
df.iloc[1,2] = np.nan

print(df)

   Python numpy DataFrame dropna

print(df.dropna(axis=0, how='any'))

   Python numpy DataFrame dropna

print(df.dropna(axis=1, how='any'))

   Python numpy DataFrame dropna

print(df.dropna(axis=0, how='all'))

   Python numpy DataFrame dropna

print(df.dropna(axis=1, how='all'))

   Python numpy DataFrame dropna

有帮助的欢迎评论打赏哈,谢谢!

相关文章:

  • 2021-07-05
  • 2022-01-27
  • 2021-04-08
  • 2021-08-17
  • 2021-07-25
  • 2022-01-10
  • 2021-07-17
  • 2021-11-06
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2021-04-01
  • 2021-10-12
相关资源
相似解决方案