📌  相关文章
📜  如何在python代码示例中查找数据集的空行

📅  最后修改于: 2022-03-11 14:45:48.843000             🧑  作者: Mango

代码示例1
import numpy as np                             # to use np.nan 
import pandas as pd                            # to use replace
    
df = df.replace(' ', np.nan)                   # to get rid of empty values
nan_values = df[df.isna().any(axis=1)]         # to get all rows with Na

nan_values                                     # view df with NaN rows only