int64 is a numeric data type in pandas used to store whole numbers (integers) with 64-bit precision. It can hold both positive and negative integers.
float64 is a numeric data type in pandas used to store decimal numbers (floating-point numbers) with 64-bit precision. It can represent numbers with fractions.
You choose float64 when your data contains decimal values or fractions. int64 is only for whole numbers without decimals.
You can use df['column_name'].dtype to see the data type of a specific column in a pandas DataFrame.
The decimal part will be dropped (truncated), and only the whole number part will be stored. This can lead to loss of information.
int64 is used for whole numbers. float64 is for decimals, object is for text, and bool is for True/False values.
float64 allow you to store that int64 does not?float64 stores decimal (fractional) numbers, while int64 only stores whole numbers.
The correct way is df['age'].dtype to get the data type of the 'age' column.
The decimal part is dropped, so 3.7 becomes 3 when stored in an int64 column.
object is used for text or mixed types, not numeric data.