remove key value from dictionary if 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}