What are the available datatypes for 'dtype' with NumPy's loadtxt() an genfromtxt?

后端 未结 3 1558
猫巷女王i
猫巷女王i 2020-12-01 00:19

What are the available numpy.loadtxt or numpy.genfromtxt for importing table data with varying datatypes, and what are the available abbreviations for the use (e.g.

3条回答
  •  时光取名叫无心
    2020-12-01 00:48

    Generic info about dtypes: http://docs.scipy.org/doc/numpy/reference/arrays.dtypes.html

    From http://docs.scipy.org/doc/numpy/reference/arrays.scalars.html#arrays-scalars-built-in

    In NumPy, there are 24 new fundamental Python types to describe different types of scalars. These type descriptors are mostly based on the types available in the C language that CPython is written in, with several additional types compatible with Python’s types.

    And what I didn't realise, is:

    The C-like names are associated with character codes, which are shown in the table. Use of the character codes, however, is discouraged.

    I doubt the numpy code/doc base is going anyway anytime soon, so that says it all I guess!

提交回复
热议问题