简体   繁体   English

Numpy数据类型:数据类型不被理解

[英]Numpy data types: data type not understood

still fairly new to Numpy in Python...I'm trying to build up my own array from RINEX data (see example): 在Python中对Numpy来说仍然相当新...我正在尝试从RINEX数据构建我自己的数组(参见示例):

G13 2014 01 02 02 00 00  .440594740212D-04 -.375166564481D-11  .000000000000D+00
      .290000000000D+02  .705937500000D+02  .382980238378D-08 -.135945866650D+01
      .353716313839D-05  .509947887622D-02  .137723982334D-04  .515366394615D+04
      .352800000000D+06 -.819563865662D-07  .312956454846D+01 -.633299350739D-07
      .979542877504D+00  .129500000000D+03  .219020237787D+01 -.757495838456D-08
     -.431803700643D-09  .100000000000D+01  .177300000000D+04  .000000000000D+00
      .240000000000D+01  .000000000000D+00 -.111758708954D-07  .290000000000D+02
      .345618000000D+06  .400000000000D+01

I'm using the following code for initialised matrix: 我正在使用以下代码初始化矩阵:

parameter_block_list = np.empty(cs.TOTAL_SATS, cs.RINEX_NAVIGATION_PARAMETERS) * np.NaN 

The problem is the conversion of the numbers in the RINEX file block, where each number uses "D" as an exponential. 问题是RINEX文件块中数字的转换,其中每个数字使用“D”作为指数。 Is there a way in Numpy to make a data type conversion that caters for such data formats? Numpy有没有办法进行适合这种数据格式的数据类型转换? The error I'm receiving is: 我收到的错误是:

TypeError: data type not understood

I think the reason you're getting data type not understood is that in passing the dimensions of your array to empty as separate arguments, the first is being treated as the shape and the second as the dtype -- see the docs . 我认为你得到的data type not understood的原因是,在将数组的维度作为单独的参数传递为empty ,第一个被视为shape而第二个被视为dtype - 请参阅文档 Perhaps you mean to pass the shape as a tuple: 也许你的意思是将shape作为元组传递:

parameter_block_list = np.empty((cs.TOTAL_SATS, cs.RINEX_NAVIGATION_PARAMETERS)) * np.NaN

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM