I want to replace a csv column with more than 8 hundred thousand rows but I can't do it with the following code:
import pandas as pd
import numpy as np
df = pd.read_csv('nameofdf.csv')
df
The nameofdf.csv has: enter image description here
I want to replace the numbers with strings so:
new_df = df.replace([0, 1, 2, 3, 4, up to 8 hundred thousand], ['string1', 'string2', 'string3', 'string4', 'string5', up to string8hundred thousand])
new_df
After that, jupyter shows syntaxis error and I think it is because of the large lists...
Any idea about this or how to replace the csv properly?
Thanks!