If you want to change the data type of a particular column you can use pandas:
In this below example I am using the customer-churn dataset.
import pandas as pd
df_data = pd.read_csv("Customer-Churn.csv")
I am checking the data type of a particular column:
In [18]:df_data['PaymentMethod'].dtype
Out[18]:
dtype('O')
Changing the column dtype to bool
In[19]:df_data['PaymentMethod']=df_data['PaymentMethod'].astype(bool)
df_data['PaymentMethod'].dtype
Out[19]:
dtype('bool')
I hope this will help you.
If you want to know more about the Data Science then do check out the following Data Science which will help you in understanding Data Science from scratch