I am trying to remap
data from dictionary to the respective values in dataframe and I am successful in it.
It is fine when I am using few thousands of data but gets radically slow and sometimes never ending if I try to do it with few millions of data.
Here is the code I am using and works fine for less data:
def remap(data,dict_labels):
for field,values in dict_labels.items():
data.replace({field:values},inplace=True)
print("DONE")
return data
dataframe1 = remap(df,dataDict)
Is there any efficient way of using something else for the same task so that it is faster for large data?