pyhton dict remove key is value is nan code example Example: python how to delete from dictionary a nan key d = {k: v for k, v in d.items() if k == k}