This is the error i’m getting This is what i have tried repl = {‘Y’:’1′, ‘N’:’0′} prices_dataframe[‘col_state’] = prices_dataframe[‘col_state’].replace(repl, regex=True) Answer The replace() method is unique to strings, and at some point the value you are trying to replace is being a boolean (True or False). If you still want to replace it, you can transform the value into a
Tag: drop
Python : Dropping specific rows in a dataframe and keep a specif one
Let’s say that I have this dataframe I want to reduce this dataframe ! I want to reduce only the rows that contains the string “info” by keeping the ones that have the highest level in the column “Group”. So in this dataframe, it would mean that I keep the row “ID_info_1” in the group 4, and “ID_info_1” in the