Data Types of Columns

Learn how to find and change the data types of columns in Pandas.

We'll cover the following

Data types

Data doesn’t always come in plain numbers. In addition to integers and floats, we need to deal with strings (textual data), dates, times, and boolean (True and False) data types.

It’s important to use proper data types for two main reasons:

  • Data structures of different data types take up a different amount of memory space. Having proper data types saves us from wasting memory.

  • Some methods and functions can also be used with certain data types. For instance, we need to store data that contains date and time in the data structures of datetime data type to use it.

Let’s first check the data types in the sales. Then, we’ll see how to change data types of columns.

Get hands-on with 1200+ tech skills courses.