What to do with missing values when plotting with seaborn?

前端 未结 3 887
别跟我提以往
别跟我提以往 2021-02-07 11:19

I replaced the missing values with NaN using lambda following function:

data = data.applymap(lambda x: np.nan if isinstance(x, basestring) and x.isspace() else x)<

3条回答
  •  名媛妹妹
    2021-02-07 12:00

    You can use the following line to select the non-NaN values for a distribution plot using seaborn:

    seaborn.distplot(data['alcconsumption'].notnull(),hist=True,bins=100)
    

提交回复
热议问题