In [16]: df = DataFrame(np.arange(10).reshape(5,2),columns=list('AB'))

In [17]: df
Out[17]: 
   A  B
0  0  1
1  2  3
2  4  5
3  6  7
4  8  9

In [18]: df.dtypes
Out[18]: 
A    int64
B    int64
dtype: object

Convert a series

In [19]: df['A'].apply(str)
Out[19]: 
0    0
1    2
2    4
3    6
4    8
Name: A, dtype: object

In [20]: df['A'].apply(str)[0]
Out[20]: '0'

Don't forget to assign the result back:

df['A'] = df['A'].apply(str)

Convert the whole frame

In [21]: df.applymap(str)
Out[21]: 
   A  B
0  0  1
1  2  3
2  4  5
3  6  7
4  8  9

In [22]: df.applymap(str).iloc[0,0]
Out[22]: '0'

df = df.applymap(str)
Answer from Jeff on Stack Overflow
🌐
datagy
datagy.io › home › pandas tutorials › pandas dataframes › pandas: convert column values to strings
Pandas: Convert Column Values to Strings • datagy
December 15, 2022 - We can see that our Age column, which was previously stored as int64 is now stored as the string datatype. In the next section, you’ll learn how to use the .map() method to convert a Pandas column values to strings. Similar to the .astype() Pandas series method, you can use the .map() method to convert a Pandas column to strings. ... import pandas as pd df = pd.DataFrame({ 'Name':['Nik', 'Jane', 'Matt', 'Kate', 'Clark'], 'Age': [30, 31, 29, 33, 43], 'Income':[70000, 72000, 83000, 90000, 870000] }) df['Age'] = df['Age'].map(str) print(df.info())
🌐
GeeksforGeeks
geeksforgeeks.org › how-to-convert-integers-to-strings-in-pandas-dataframe
How to Convert Integers to Strings in Pandas DataFrame? - GeeksforGeeks
July 1, 2022 - Python3 · # importing pandas as pd import pandas as pd # creating a dictionary of integers dict = {'Integers' : [10, 50, 100, 350, 700]} # creating dataframe from dictionary df = pd.DataFrame.from_dict(dict) print(df) print(df.dtypes) print('\n') # converting each value of column to a string df['Integers'] = df['Integers'].astype(str) print(df) print(df.dtypes) Output : We can see in the above output that before the datatype was int64 and after the conversion to a string, the datatype is an object which represents a string.
🌐
Statistics Globe
statisticsglobe.com › home › python programming language for statistics & data science › convert integer to string in pandas dataframe column in python (4 examples)
Convert Integer to String in pandas DataFrame Column (Python Example)
May 2, 2022 - In Example 4, in contrast, I’ll illustrate how to use the apply function instead of the astype function to convert an integer column to the string data type. Consider the Python code below: data_new4 = data.copy() # Create copy of DataFrame ...
🌐
TutorialsPoint
tutorialspoint.com › fastest-way-to-convert-integers-to-strings-in-pandas-dataframe
How to Convert String to Integer in Pandas DataFrame?
July 10, 2023 - import pandas as pd df = pd.DataFrame({'Values': ['10', '20', '30', '40']}) # Convert to numeric then to integer df['Values'] = pd.to_numeric(df['Values']).astype(int) print(df.dtypes) print(df) Values int64 dtype: object Values 0 10 1 20 2 30 3 40 · Use astype(int) for clean string data that you're confident contains only valid integers.
🌐
GeeksforGeeks
geeksforgeeks.org › fastest-way-to-convert-integers-to-strings-in-pandas-dataframe
Fastest way to Convert Integers to Strings in Pandas DataFrame | GeeksforGeeks
August 1, 2020 - In this article, we'll look at different methods to convert an integer into a string in a Pandas dataframe.
🌐
Saturn Cloud
saturncloud.io › blog › how-to-convert-columns-to-string-in-pandas
How to Convert Columns to String in Pandas | Saturn Cloud Blog
December 2, 2023 - Let’s say we have a Pandas DataFrame df that contains a column named employee_id that we want to convert to a string. We can use the following code to do this: # Converting 'employee_id' to string df['employee_id'] = df['employee_id'].astype(str) # Displaying the types of data after conversion print("\nTypes of data after conversion:\n", df.dtypes) ... Types of data after conversion: employee_id object name object age int64 salary int64 experience int64 dtype: object
Find elsewhere
🌐
Spark By {Examples}
sparkbyexamples.com › home › pandas › pandas convert integer to string in dataframe
Pandas Convert Integer to String in DataFrame - Spark By {Examples}
December 5, 2024 - To convert an integer column to a string in a pandas DataFrame, you can use the astype(str) method. Additionally, other Pandas functions like apply(),
🌐
Pandas
pandas.pydata.org › docs › reference › api › pandas.DataFrame.convert_dtypes.html
pandas.DataFrame.convert_dtypes — pandas 3.0.2 documentation
Convert the DataFrame to use best possible dtypes. >>> dfn = df.convert_dtypes() >>> dfn a b c d e f 0 1 x True h 10 <NA> 1 2 y False i <NA> 100.5 2 3 z <NA> <NA> 20 200.0 · >>> dfn.dtypes a Int32 b string c boolean d string e Int64 f Float64 dtype: object
🌐
Delft Stack
delftstack.com › home › howto › python pandas › pandas convert column values to string
How to Convert Column Values to String in Pandas | Delft Stack
February 2, 2024 - DataFrame before Conversion: Name Score Age 0 Ayush 31 33 1 Bikram 38 34 2 Ceela 33 38 3 Kusal 39 45 4 Shanty 35 37 Datatype of columns before conversion: Name object Score int64 Age int64 dtype: object DataFrame after conversion: Name Score Age 0 Ayush 31 33 1 Bikram 38 34 2 Ceela 33 38 3 Kusal 39 45 4 Shanty 35 37 Datatype of columns after conversion: Name object Score int64 Age object dtype: object · It changes the data type of the Age column from int64 to object type representing the string.
🌐
Spark By {Examples}
sparkbyexamples.com › home › pandas › pandas convert column to string type
Pandas Convert Column to String Type - Spark By {Examples}
July 3, 2025 - In this article, I will explain how to convert single column or multiple columns to string type in pandas DataFrame, here, I will demonstrate using
🌐
Pandas
pandas.pydata.org › pandas-docs › stable › reference › api › pandas.DataFrame.astype.html
pandas.DataFrame.astype — pandas 3.0.1 documentation
This method allows the conversion of the data types of pandas objects, including DataFrames and Series, to the specified dtype. It supports casting entire objects to a single data type or applying different data types to individual columns using a mapping. ... Use a str, numpy.dtype, pandas.ExtensionDtype or Python type to cast entire pandas object to the same type.
🌐
Medium
tmlb-blog-ltd.medium.com › to-convert-a-float64-type-column-into-an-int64-or-string-type-column-in-python-short-984537c97a63
To convert a float64-type column into an int64 or string-type column in python (short) | by T Miyamoto | Medium
August 20, 2020 - df_a['coli']= (df_a['colf'].apply(lambda w0: None if pd.isnull(w0) else np.int64(w0)) ).astype(pd.Int64Dtype()) ... Next we create a string type column based on column colf. It is well known that astype(str) converts NaN into a string ‘nan’. We try to do
🌐
Pandas
pandas.pydata.org › docs › reference › api › pandas.DataFrame.to_string.html
pandas.DataFrame.to_string — pandas 3.0.2 documentation
Render a DataFrame to a console-friendly tabular output. ... Buffer to write to. If None, the output is returned as a string.
🌐
Pandas
pandas.pydata.org › docs › reference › api › pandas.DataFrame.astype.html
pandas.DataFrame.astype — pandas 3.0.2 documentation
This method allows the conversion of the data types of pandas objects, including DataFrames and Series, to the specified dtype. It supports casting entire objects to a single data type or applying different data types to individual columns using a mapping. ... Use a str, numpy.dtype, pandas.ExtensionDtype or Python type to cast entire pandas object to the same type.