Mapping column in Pandas DataFrame

65 Views Asked by At

1I have created 3 data frames from a JSON file. I'm trying to create a column on my working data frame by mapping the key column to the other 2 data frames, the method I use works, but it throws up a warning "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. How do I go around this?

Error image

1

1

There are 1 best solutions below

1
Ranadheer On

Alternatively, you can use pandas merge function to join the dataframes.

if you are just bothered by warning messages and if you don't like to see them, you can suppress them by the following code

import warnings
warnings.filterwarnings('ignore')

Good luck!