9
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

numpyのint64をpythonのintに変換する

Posted at

.item()を使う

import numpy as np

# numpyのint64
np_int = np.int64(0)
print(type(np_int))
# <class 'numpy.int64'>

# pythonのintに変換
py_int = np_int.item()
print(type(py_int))
# <class 'int'>

参考

9
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?