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