Python: Convert column from float to int
11,435
You can do this with
df.index = df.index.astype(int)
Comments
-
David Ferris almost 2 years
I am using a pandas, and need to concat two dataframes based on a
set_id
index. One of the dataframes has these as floats (see below). How can I convert these to ints?-
Sterling Archer about 7 yearsDepends, do you want to round to the nearest int or truncate the decimal completely?
-