I wanted to change a string separated by commas every 3 digits to a number, such as 25,000
in Pandas DataFrame.
df.apply(lambda x: x.str.replace(',','')).astype(np.int)
pandas – some ways to replace part of a string.
Thank you very much. If there is another way, I would appreciate it if you could teach me.
Recommended Posts