import math
import numpy as np
import pandas as pd
df = pd.DataFrame({"name": ['Alfred', 'Batman', 'Catwoman'],
"toy": [np.nan, 'Batmobile', 'Bullwhip'],
"born": [pd.NaT, pd.Timestamp("1940-04-25"),
pd.NaT]})
print(df.head())
df.dropna()
print(df.head())
以上是pandas帮助文档里的例子代码,在本机上跑的时候,dropna这个函数无效了。以下是运行结果。
求大神解答。。