例如 data frame example 我想删除所有列 = NA 的每一行。我不想删除所有列中都没有 NA 的行。请给出一些建议并举例说明。我非常感谢您的帮助。
最佳答案
你可以尝试:
df.dropna(how='all', inplace=True)
来自documentation (pandas.DataFrame.dropna) :
how : {‘any’, ‘all’}, default ‘any’
block 引用>Determine if row or column is removed from DataFrame, when we have at least one NA or all NA.
‘any’ : If any NA values are present, drop that row or column.
‘all’ : If all values are NA, drop that row or column.
和
inplace
:inplace : bool, default False
block 引用>If True, do operation inplace and return None.
关于python - 如何删除数据框的所有列都等于 None 的每一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51530311/