下面是我的python问题:
我被要求生成一个输出表,其中包含每个变量(数据中有超过10个变量)中的Nan数、min、max、mean、std、25%、50%和70%。我使用panda中的describe函数创建了describe表,它提供了我想要的所有内容,但是每个变量中的Nan的数量。我正在考虑将Nan的数量作为新行添加到由describe输出生成的输出中。在
有人能帮忙吗?在
output = input_data.describe(include=[np.number]) # this gives the table output
count_nan = input_data.isnull().sum(axis=0) # this counts the number of Nan of each variable
如何将第二个作为行添加到第一个表中?在
可以使用^{} 将新行追加到数据帧:
相关问题 更多 >
编程相关推荐