python中int计算_python中int计算_关于python:在计算中无法将dtype int识别为int

TypeError Traceback (most recent call

last) pandas/_libs/parsers.pyx in

pandas._libs.parsers.TextReader._convert_tokens()

TypeError: Cannot cast array from dtype('O') to dtype('int32')

according to the rule 'safe'

During handling of the above exception, another exception occurred:

ValueError Traceback (most recent call

last) in ()

6 #dtype={'serverTs': np.int32, 'FTs': np.int32},

7 #chunk_iter = chunk_iter.astype({'serverTs': np.int32, 'FTs': np.int32})

----> 8 for chunk in chunk_iter:

9 #print(chunk[chunk['FTs'] == 'NaN'])

10 #chunk[['serverTs','FTs']] = chunk[['serverTs','FTs']].astype('int32')

C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parsers.py in

next(self) 1040 def next(self): 1041 try:

-> 1042 return self.get_chunk() 1043 except StopIteration: 1044 self.close()

C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parsers.py in

get_chunk(self, size) 1104 raise StopIteration

1105 size = min(size, self.nrows - self._currow)

-> 1106 return self.read(nrows=size) 1107 1108

C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parsers.py in

read(self, nrows) 1067 raise ValueError('skipfooter

not supported for iteration') 1068

-> 1069 ret = self._engine.read(nrows) 1070 1071 if self.options.get('as_recarray'):

C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parsers.py in

read(self, nrows) 1837 def read(self, nrows=None): 1838

try:

-> 1839 data = self._reader.read(nrows) 1840 except StopIteration: 1841 if self._first_chunk:

pandas/_libs/parsers.pyx in pandas._libs.parsers.TextReader.read()

pandas/_libs/parsers.pyx in

pandas._libs.parsers.TextReader._read_low_memory()

pandas/_libs/parsers.pyx in

pandas._libs.parsers.TextReader._read_rows()

pandas/_libs/parsers.pyx in

pandas._libs.parsers.TextReader._convert_column_data()

pandas/_libs/parsers.pyx in

pandas._libs.parsers.TextReader._convert_tokens()

ValueError: invalid literal for int() with base 10: 'FTs'

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值