我已经写了一个简短的函数来输出数据框中每列的最大值(或字符串,最大长度),并对各种数据类型进行了调整。 def maxDFVals(df):
for c in df:
if str(df[c].dtype) in ('datetime64[ns]'):
print('Max datetime of column {}: {}\n'.format(c, df[c]
我有一个数据帧DF像这样 A B C
1 'x' 15.0
2 'y' NA
3 'z' 25.0
和词典DC类似 dc = {'x':15,'y':35,'z':25}
我想填补所有空填写一个数据帧空在数据帧的列C中使用字典中列B的值。所以我的数据帧将变成 A B C
1 'x' 15
2 'y' 35
3 'z' 25
任何人都可以帮我怎么做,请吗?