In Pandas DataFrame
how to map strings in one column with integers. I have around 500 strings in the DataFrame
and need to replace them with intege
So what you could do is construct a temporary dataframe and merge this back to your existing dataframe:
temp_df = pd.DataFrame({'Request': df.Request.unique(), 'Request_id':range(len(df.Request.unique()))})
Now merge this back to your original dataframe
df = df.merge(temp_df, on='Request', how='left')