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)?
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With