Cast dtype to a particular dtype with options.
Let us change one type to other. Here column MATH is changed to string and '2' ( '2' dtpye is string not integer ) is added.
We can use dtypes to get the data type of columns.
import pandas as pd
my_dict={'NAME':['Ravi','Raju','Alex','Ron','King','Jack'],
'ID':[1,2,3,4,5,6],
'MATH':[80,40,70,70,70,30],
'ENGLISH':[80,70,40,50,60,30]}
my_data = pd.DataFrame(data=my_dict)
print(my_data.dtypes) # dtype of all columns
print('----')
print(my_data['MATH'].dtypes) # dtype of MATH column
print(my_data['NAME'].dtypes) # dtype of NAME column
Output
NAME object
ID int64
MATH int64
ENGLISH int64
dtype: object
----
int64
object