Https://www.codecademy.com/paths/code-foundations/tracks/cf-data-science/modules/survey-of-data-science/lessons/data-science-process/exercises/cleaning-data

https://www.codecademy.com/paths/code-foundations/tracks/cf-data-science/modules/survey-of-data-science/lessons/data-science-process/exercises/cleaning-data

This part of code returned as false.

Paste location code here:

new_df.loc[new_df.population_proper < 100000, “location”] = “rural”
new_df.loc[new_df.population_proper >= 100000, “location”] = “urban”
print(new_df.head(15))

Additional Information:

Traceback (most recent call last):
File “script.py”, line 12, in
new_df.loc[new_df.population_proper < 100000, “location”] = “rural”
File “/usr/local/lib/python3.6/dist-packages/pandas/core/indexing.py”, line 204, in setitem
indexer = self._get_setitem_indexer(key)
File “/usr/local/lib/python3.6/dist-packages/pandas/core/indexing.py”, line 182, in _get_setitem_indexer
return self._convert_tuple(key, is_setter=True)
File “/usr/local/lib/python3.6/dist-packages/pandas/core/indexing.py”, line 262, in _convert_tuple
idx = self._convert_to_indexer(k, axis=i, is_setter=is_setter)
File “/usr/local/lib/python3.6/dist-packages/pandas/core/indexing.py”, line 1242, in _convert_to_indexer
return labels.get_loc(obj)
File “/usr/local/lib/python3.6/dist-packages/pandas/core/indexes/base.py”, line 2897, in get_loc
return self._engine.get_loc(key)
File “pandas/_libs/index.pyx”, line 107, in pandas._libs.index.IndexEngine.get_loc
File “pandas/_libs/index.pyx”, line 109, in pandas._libs.index.IndexEngine.get_loc
File “/var/codecademy/runner_contexts/python/cc_python3_shared.py”, line 97, in series_str_with_print
return self._internal_str()
File “/usr/local/lib/python3.6/dist-packages/pandas/core/generic.py”, line 5179, in getattr
return object.getattribute(self, name)
AttributeError: ‘Series’ object has no attribute ‘_internal_str’