MNE-Python : TypeError: today() takes no keyword arguments
运行代码
在使用MNE读取gdf文件时
import mne
%matplotlib inline# Mention the file path to the dataset
path = "E:\\BCICIV_2b\\gdf_format\\"
filename = "B0302T"raw = mne.io.read_raw_gdf(path+filename+".gdf")
出现问题
出现下面问题
TypeError Traceback (most recent call last)
<ipython-input-3-709b175ec09c> in <module>7 filename = "B0302T"8
----> 9 raw = mne.io.read_raw_gdf(path+filename+".gdf")d:\Users\Administrator\anaconda3\lib\site-packages\mne\io\edf\edf.py in read_raw_gdf(input_fname, eog, misc, stim_channel, exclude, preload, verbose)1325 return RawGDF(input_fname=input_fname, eog=eog, misc=misc,1326 stim_channel=stim_channel, exclude=exclude, preload=preload,
-> 1327 verbose=verbose)1328 1329 <decorator-gen-164> in __init__(self, input_fname, eog, misc, stim_channel, exclude, preload, verbose)d:\Users\Administrator\anaconda3\lib\site-packages\mne\io\edf\edf.py in __init__(self, input_fname, eog, misc, stim_channel, exclude, preload, verbose)187 info, edf_info, orig_units = _get_info(input_fname,188 stim_channel, eog, misc,
--> 189 exclude, preload)190 logger.info('Creating raw.info structure...')191 d:\Users\Administrator\anaconda3\lib\site-packages\mne\io\edf\edf.py in _get_info(fname, stim_channel, eog, misc, exclude, preload)375 misc = misc if misc is not None else []376
--> 377 edf_info, orig_units = _read_header(fname, exclude)378 379 # XXX: `tal_ch_names` to pass to `_check_stim_channel` should be computedd:\Users\Administrator\anaconda3\lib\site-packages\mne\io\edf\edf.py in _read_header(fname, exclude)364 return _read_edf_header(fname, exclude)365 elif ext in ('gdf'):
--> 366 return _read_gdf_header(fname, exclude), None367 else:368 raise NotImplementedError(d:\Users\Administrator\anaconda3\lib\site-packages\mne\io\edf\edf.py in _read_gdf_header(fname, exclude)863 if patient['birthday'] != datetime(1, 1, 1, 0, 0,864 tzinfo=timezone.utc):
--> 865 today = datetime.today(tzinfo=timezone.utc)866 patient['age'] = today.year - patient['birthday'].year867 today = today.replace(year=patient['birthday'].year)TypeError: today() takes no keyword arguments
原因
read_raw_gdf()读取gdf 1.x是可以的,但读取gdf 2.x版有问题,这个应该是一个bug,官方应该在修复这个问题
解决方法
1.可以在等MNE更新;
2.可以在本地edf库中进行如下对应的修改,以修复bug
将1,2处红框的内容替换为如下对应内容
脑机学习者Rose笔记分享,QQ交流群:903290195
更多分享,请关注公众号
MNE-Python : TypeError: today() takes no keyword arguments相关推荐
- Python使用字典get()方法TypeError: get() takes no keyword arguments
解决方法 dict的get("key", 0)方法不要添加default=,删除这个写法并不影响使用逻辑,但是加上会导致报错. d = {'key': 2, } print(d.g ...
- TypeError: strptime() takes no keyword arguments ValueError(“‘%s‘ is a bad directive in format ‘%s‘“
t=datetime.datetime.strptime("2021/5/12 09:28:11",format="%Y/%m/%d %h:%m:%s") 1. ...
- OpenCV——解决使用rectangle()函数时出现“TypeError: function takes exactly 4 arguments (2 given)”错误
1 问题描述 今天在使用cv.rectangle()函数时,出现了这样的报错: TypeError: function takes exactly 4 arguments (2 given) 源代码我 ...
- 关于 - TypeError: dict.get() takes no keyword arguments
首先我们来看一下关于 dict 的 get() 函数的使用方法 get 函数的用法:dict.get(key, default=None) , key 为需要获取 value 的 key,defaul ...
- python创建对象后调用对象的方法,报错TypeError: getName() takes 0 positional arguments but 1 was given
源码 ## TODO: Create multiple cars and visualize them height = 4 width = 6 world = np.zeros((height, w ...
- 解决TypeError: set_ticks() takes 2 positional arguments but 3 were given
其他问题参考: Python基础-TypeError:takes 2 positional arguments but 3 were given https://blog.csdn.net/weixi ...
- 成功解决TypeError: fit_transform() takes 2 positional arguments but 3 were given
成功解决Traceback (most recent call last): File "F:\Program Files\Python\Python36\lib\site-packag ...
- TypeError: classification_report() takes 2 positional arguments but 3 were given的解决方案
大家好,我是爱编程的喵喵.双985硕士毕业,现担任全栈工程师一职,热衷于将数据思维应用到工作与生活中.从事机器学习以及相关的前后端开发工作.曾在阿里云.科大讯飞.CCF等比赛获得多次Top名次.喜 ...
- TypeError: __init__() takes exactly 2 arguments (3 given)
TypeError: __init__() takes exactly 2 arguments (3 given) 意思是说,该方法只有两个参数,你却给他3个:
最新文章
- 修改电脑开机时间记录6005_这些优化步骤,让你的电脑远离卡顿!
- docker中操作系统与应用
- pythonjpg_使用python判断jpeg图片的完整性实例
- 面试准备勿重“难”轻“易”
- CentOS下使用Varnish为网站加速
- 【部署hadoop高可用集群】所有步骤
- 做好一个系统分析师、项目经理75条准则
- eclipse左边工程列表不见了,怎么调出来
- dev cpp的常用快捷键
- 美国通货膨胀持续引发市场关注,国际黄金价格还有上涨机会吗?
- 2017 谷歌 I/O大会
- 【读书笔记】《洛克菲勒写给儿子的38封信》
- html5 数据库 视图,创建视图的sql语句是什么
- [HSI论文阅读] | Deep Feature Extraction and Classification of Hyperspectral Images Based on CNNs
- 《连载 | 物联网框架ServerSuperIO教程》- 15.数据持久化接口的使用。附:3.2发布与版本更新说明。...
- C++之字符串大小写转换
- nvme协议阅读笔记
- Python BeautifulSoup简介
- 成都java培训一般需要多久
- 移动开发Weex原理之带你去蹲坑
热门文章
- Android Studio 编译: Program type already present: XXX 解决方案
- java.lang.IllegalArgumentException异常处理的一种方法
- 将java.time.LocalDate转换为java.util.Date类型
- Intellij Idea:导入Gradle项目 - 尚未定义JAVA_HOME
- Java线程池了解一下
- k8s helm 私服chartmuseum minio s3 存储配置
- 高仿腾讯QQ Xplan(X计划)的H5页面(2):动画控制
- 《JavaScript模式》精要
- 双网卡绑定-bond0
- *:学习心得——C语言----S1T62班 王作舟