line = line.split(comment, 1)[0] AttributeError: ‘numpy.int64’ object has no attribute ‘split’

import obspy时报错
line = line.split(comment, 1)[0] AttributeError: 'numpy.int64' object has no attribute 'split'

File "/Users/jiangyue/miniforge3/envs/python38/lib/python3.8/site-packages/numpy/lib/npyio.py", line 977, in split_line line = line.split(comment, 1)[0]
打开这个npyio.py文件,找到报错的这一行

    def split_line(line: str):"""Chop off comments, strip, and split at delimiter."""for comment in comments:  # Much faster than using a single regex.line = line.split(comment, 1)[0]line = line.strip('\r\n')return line.split(delimiter) if line else []

把line转换为str类型:

    def split_line(line: str):"""Chop off comments, strip, and split at delimiter."""for comment in comments:  # Much faster than using a single regex.line = str(line).split(comment, 1)[0]line = line.strip('\r\n')return line.split(delimiter) if line else []

import obspy报错‘numpy.int64‘ object has no attribute ‘split‘`相关推荐

  1. 如何借助new bing修复 pyfolio: AttributeError: ‘numpy.int64‘ object has no attribute ‘to_pydatetime‘

    如何修复 pyfolio的报错 AttributeError: 'numpy.int64' object has no attribute 'to_pydatetime' 的报错? 最近使用Pytho ...

  2. Scrapy爬虫报错AttributeError: ‘NoneType‘ object has no attribute ‘write‘

    前言 一.报错 AttributeError: 'NoneType' object has no attribute 'write' 二.报错原因 1.piplines文件中的方法不能自定义的呢 开始 ...

  3. 关于在《python编程从入门到实践》书中练习“外星人大战”报错“AttributeError: ‘AlienInvasion‘ object has no attribute ‘blit‘”

    关于在<python编程从入门到实践>书中练习"外星人大战"报错"AttributeError: 'AlienInvasion' object has no ...

  4. 解决:运行pytest时,报错:'TestCaseFunction' object has no attribute 'get_marker'

    因为不想以后遇到同样的困境束手无策,所以想要留下些什么 于是就有了下文 铛铛铛铛-- 首先,第一次用pytest,装环境,我看到别人python3.7用pytest5.多的版本没有任何问题,而我就不一 ...

  5. 爬虫的自创建请求对象:报错AttributeError: 'str' object has no attribute 'items'

    在使用爬虫库创建自定义请求对象时 将值传入headers agent = random.choice(userAgent) REQ = request.Request(url,headers=agen ...

  6. 运行项目时flask_sqlalchemy报错AttributeError: ‘LocalStack‘ object has no attribute ‘__ident_func__‘

    运行项目时flask_sqlalchemy报错AttributeError: 'LocalStack' object has no attribute '__ident_func__' 1.原因 2. ...

  7. python3 多进程 multiprocessing 报错 AttributeError: ‘ForkAwareLocal‘ object has no attribute ‘connection‘

    目录 错误代码 报错信息 错误原因 解决方法 错误代码 python多进程管理manager时候,当不使用join对当前进程(主进程)进行阻塞时会报错,具体代码及错误如下: from multipro ...

  8. 报错AttributeError: ‘NoneType‘ object has no attribute ‘shape‘

    环境: python3.6.4 opencv3.4.1.15 运行目标跟踪object_tracking文件夹中的mean函数时报错且不显示视频结果 Traceback (most recent ca ...

  9. python的mysql数据查询及报错AttributeError: 'Connection' object has no attribute 'curson'

    import pymysql #创建连接 con = pymysql.connect(host='localhost',user='root',password='123456',port=3306, ...

最新文章

  1. 黄聪:C#用正则表达式获得指定开始和结束字符串中间的一段文本
  2. appendChild append insertBefore prepend
  3. c++ 在哪里找文档来看_FPX双C十四连败引热议!Doinb:我再也不跟LWX双排了
  4. visual studio 插件开发(5) -- 在任意位置添加自己的菜单
  5. 浅谈代码的执行效率(2):编译器的威力
  6. 上海的互联网数据中心“一柜难求
  7. OpenStack 认证服务 KeyStone部署 (四)
  8. caffe编译报错 cudnn.hpp:127:41: error: too few arguments to function ‘cudnnStatus_t cudnnSetPooling2dDe
  9. 当输入 xxxxHub 后,到网页显示,其间发生了什么?
  10. Linux下boost库的安装
  11. 用Java的Set实现交并差等集合运算
  12. 黄轩成为QQ阅读新代言人 变身“队长”号召网友 “组队读书”
  13. java 分页查询实例_JavaWeb学习之分页查询实例
  14. Python中的zip函数
  15. linux第三版 网页链接
  16. GIS数据下载资源大全
  17. php爬虫教程(二)数据请求分析
  18. EXCEL单元格内怎么换行?Alt+Enter
  19. 利用python统计excel中的数据
  20. Impala 在网易有数 BI 应用场景的优化经验

热门文章

  1. 通往WinDbg的捷径(一)
  2. Stata如何解决command is unrecognized?
  3. 解决电脑(win10)打开右键反应很慢--测试有效
  4. Django框架(八)--单表增删改查,在Python脚本中调用Django环境
  5. 克隆clone一个磁盘, diskgenius都做不出来,不能用,随便下载个AOMEI Partition Assistant还不错
  6. 移动产品设计的八大设计原则
  7. 计算机考试用户没有注册类,电脑中出现没有注册类别的错误提示的多种解决方法...
  8. BB10动态创建Button并响应单击事件(C++版本)
  9. PMP(项目管理专业人士资格认证)
  10. python 设置精度_在python中以全微秒精度设置文件的mtime