A string is a group of characters. A string can contains any type of character including numerical characters, alphabetical characters, special characters, etc.
To check the data type of each column in a DataFrame, we use pandas.DataFrame.info() method which tells us about every piece of information of the DataFrame.
Syntax of pandas.DataFrame.info() Method:
DataFrame.info(
verbose=None,
buf=None,
max_cols=None,
memory_usage=None,
show_counts=None,
null_counts=None
)
To work with pandas, we need to import pandas package first, below is the syntax:
import pandas as pd
Example for converting column value to string in pandas DataFrame
Output:
Now let's understand how pandas.DataFrame.info() works?
Output:
We can observe that the values of column 'One' is an int, we need to convert this data type into string or object.
For this purpose we will use pandas.DataFrame.astype() and pass the data type inside the function.
Let us understand with the help of an example,
Output:

need an explanation for this answer? contact us directly to get an explanation for this answer