Reputation: 389
I have a DataFrame and one of its column consist of float type objects. I want to convert to int. As I tried, both .astype("int")
and astype(int)
methods work. I just wonder whether there is/are any difference(s)?
Upvotes: 6
Views: 5332
Reputation: 210842
AFAIK there is no major difference...
.astype(dtype)
should accept everything what is accepted by numpy.dtype().
Internally it does this:
dtype = np.dtype(dtype)
Upvotes: 9