Python
dataframe column type to string
ndlessrain
2023. 7. 25. 18:13
728x90
One way to convert to string is to use astype:
total_rows['ColumnID'] = total_rows['ColumnID'].astype(str)
https://stackoverflow.com/questions/22005911/convert-columns-to-string-in-pandas
Convert columns to string in Pandas
I have the following DataFrame from a SQL query: (Pdb) pp total_rows ColumnID RespondentCount 0 -1 2 1 3030096843 1 2 3030096845 1 and I
stackoverflow.com
728x90