I am working on the guided project based on ‘Ebay Car Sales Data’ from Germany.
I am having trouble regarding setting the rows of the columns with new values.
In my project work:
- In the cell no-123, I am changing the columns with German values to their English counter parts. For example in the column ‘seller’, the initial value is ‘privat’ and I am changing it to ‘private’.
While trying to change them using the method :-
1. autos.loc[:,"seller"] = autos.loc[:,"seller"].map(map_seller).copy() or 2. autos.loc[:,"seller"].replace(map_seller, inplace = True)
I am getting the “SettingWithCopyWarning” with the following message:
/dataquest/system/env/python3/lib/python3.8/site-packages/pandas/core/indexing.py:966: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy self.obj[item] = s
I am also getting the same warning in cell no-124 when converting the date columns to be uniform numeric data, so
"2016-03-21" becomes the integer