我需要获取每个列的类型,以便对其进行适当的预处理。目前,我通过以下方法做到这一点:# but has one type (int, floatdf = pd.DataFrame(input, columns=key_labels)matrix = df.values
由于我只使用pandas获取数据类型<
我有一个包含许多空值的稀疏Pandas数据帧,我希望对其进行过滤,以便在最终数据集中只保留具有超过10个浮点型条目的行和列。我尝试使用现有的代码片段,但似乎不起作用: df.drop([col for col, val = df.count(axis=1, numeric_only='float') if val < 10], axis=1, inplace=True) 谁能告诉我在我的<e