본문 바로가기
파이썬

파이썬 NumPy loadtxt () 및 genfromtxt에서 'dtype'에 사용할 수있는 데이터 유형은 무엇입니까?

by º기록 2021. 1. 31.
반응형



 

해결 방법

 

np.sctypeDict 외에도 다음과 같은 변수가 있습니다.

In [141]: np.typecodes
Out[141]: 
{'All': '?bhilqpBHILQPefdgFDGSUVOMm',
 'AllFloat': 'efdgFDG',
 'AllInteger': 'bBhHiIlLqQpP',
 'Character': 'c',
 'Complex': 'FDG',
 'Datetime': 'Mm',
 'Float': 'efdg',
 'Integer': 'bhilqp',
 'UnsignedInteger': 'BHILQP'}

In [143]: np.sctypes
Out[143]: 
{'complex': [numpy.complex64, numpy.complex128, numpy.complex192],
 'float': [numpy.float16, numpy.float32, numpy.float64, numpy.float96],
 'int': [numpy.int8, numpy.int16, numpy.int32, numpy.int32, numpy.int64],
 'others': [bool, object, str, unicode, numpy.void],
 'uint': [numpy.uint8, numpy.uint16, numpy.uint32, numpy.uint32, numpy.uint64]}

 

참조 페이지 https://stackoverflow.com/questions/13997087

 

 

반응형

댓글