In this section, we'll learn about changing the datatype of a pandas series. We'll see how to change datatypes after reading the data within. We'll also learn how to change datatypes while reading data in pandas. We'll walk through an example of changing an int column to float. We'll also see how to convert a string values column to the datetime datatype.
We will start by importing the pandas module and reading the dataset of house prices from zillow.com into the Jupyter Notebook:
data = pd.read_table('data-zillow.csv', sep=',')data.head()
The following is the output: