David Ferris
David Ferris

Reputation: 2325

Python: Convert column from float to int

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?

enter image description here

Upvotes: 1

Views: 12914

Answers (1)

EFT
EFT

Reputation: 2369

You can do this with

df.index = df.index.astype(int)

Upvotes: 8

Related Questions