series astype 1

series astype

# Simple conversion - series to integer
series.astype(int)

# Dataframe column conversion
df.column_name.astype(int)

Here is what the above code is Doing:
1. The first line of code is converting a series to an integer.
2. The second line of code is converting a column in a dataframe to an integer.

Similar Posts