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
With simplejson
import simplejson clean_dict = simplejson.loads(simplejson.dumps(my_dict, ignore_nan=True)) ## or depending on your needs clean_dict = simplejson.loads(simplejson.dumps(my_dict, allow_nan=False))