Converting Data Types with .astype()

Report a typo

You are working with a DataFrame named sales_df that contains various columns, including a column named 'Quantity', which is currently stored as a floating-point number. You know that the 'Quantity' column should represent whole numbers, and you want to convert it to an integer data type.

Write a line of code to convert the 'Quantity' column from a floating-point number to an integer within the DataFrame sales_df.

The answer should be in the following format:

sales_df['Quantity'] = #Your code here
Enter a short text
___

Create a free account to access the full topic