Is there a way to remove nan from a dictionary filled with data?

后端 未结 4 1022
悲哀的现实
悲哀的现实 2021-01-12 06:51

I have a dictionary that is filled with data from two files I imported, but some of the data comes out as nan. How do I remove the pieces of data with nan?

My code i

4条回答
  •  暖寄归人
    2021-01-12 07:36

    Instead of trying to remove the NaNs from your dictionary, you should further investigate why NaNs are getting there in the first place.

    It gets difficult to use NaNs in a dictionary, as a NaN does not equal itself.

    Check this out for more information: NaNs as key in dictionaries

提交回复
热议问题