.astype("int")或.astype(int)?有和没有quote/double之间的任何差异?

Nat*_*yev 3 python pandas

我有一个DataFrame,其中一个列由float类型对象组成.我想转换为int.正如我试过了,都.astype("int")astype(int)方法的工作.我只是想知道是否存在差异?

Max*_*axU 6

AFAIK没有什么重大区别......

.astype(dtype)应该接受numpy.dtype()接受的所有内容.

在内部它这样做:

dtype = np.dtype(dtype)
Run Code Online (Sandbox Code Playgroud)