问题标签 [python-dateutil]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
python - 在 Python 中单步执行日期
假设我的开始日期为datetime(2007, 2, 15)
.
我想在一个循环中步进这个日期,以便它提前到每个月的 1 号和 15 号。
所以datetime(2007, 2, 15)
会一步一步来datetime(2007, 3, 1)
。
在下一次迭代中,它会逐步执行到datetime(2007, 3, 15)
...然后到datetime(2007, 4, 1)
等等。
是否有任何可能的方法来做到这一点,timedelta
或者dateutils
考虑到它必须逐步改变的天数,不断变化?
python - 尝试将 matplotlib 与 ABAQUS 一起使用。出现涉及 dateutil 的错误
我想知道你们中是否有人将 matplotlib 用于与 ABAQUS 结合的 python 代码。我正在使用具有 python 2.6 的 ABAQUS 6.12。另外,我使用的是 Windows 64 位。
我已经下载了 matplotlib,但是当我将 matplotlib 导入 ABAQUS-Python 脚本界面时,我收到以下错误:
ImportError:matplotlib 需要 dateutil
谁能帮帮我?我该如何解决?
任何帮助,将不胜感激!谢谢
注意:对于不熟悉 FEA 软件的人,Abaqus 脚本接口是 Python 面向对象编程语言的扩展,随 ABAQUS/CAE 一起提供。
python - GAE Python:使用 dateutil.parser 按日期搜索
我正在实现一个自由文本搜索功能。用户可以输入任何关键字,例如日期字符串。
我希望它灵活:“2013 Oct”、“Oct 2013”、“2013-10”等都应该被识别。由于 App Engine 搜索 API 仅将日期格式识别为 YYYY-MM-DD,如果我得到“2013 Oct”,我需要将其翻译成“search_date >= 2013-10-01 and search_date <= 2013-10-31” .
我设法使用 dateutil.parser.parse(search_date_str),但问题是如果缺少任何日期组件,它将使用今天的数据。例如“2013 Oct”将被解析为“2013-10-27”。在这种情况下,我无法判断用户输入的是“2013 Oct 27”还是“2013 Oct 27”。按年份搜索相同...如果用户只想搜索“2013”,我应该能够将其翻译成 [2013-01-01, 2013-12-31] 而不是“2013-10-27”
我不确定我该怎么做?我在想是否需要任何正则表达式(我真的很穷……)
python - 在 Python 中识别和转换时区
在我的文件中,我有带有时区信息的 ISO 8061 格式的日期列,这是示例输入
所以格式是 YYYY-MM-DDTHH:MM:SS[f]-AB:CD
我想知道如何将给定数据格式化为 RFC 2445 iCalendar 规范 [DTSTART] 所需的格式,例如:
我目前有以下代码仅用于解析
我想知道如何识别时区 ['-04:00','-05:00'] 以及如何将它们转换为 UTC。
谢谢你。
python - matplotlib、dateutil 和 numpy 不适合我
当我使用 pip freeze 时,它显示我有matplotlib==1.4.x
,python-dateutil==1.5
和numpy==1.9.0.dev-54d3559
, 但是在 python 中当我尝试时import matplotlib
,它说它需要dateutil
另外,当我尝试import dateutil
或import numpy
它说找不到模块时。
我真的不知道这里出了什么问题。我已经尝试了我在网上找到的所有解决方案,但没有一个对我有用。
python - 使用 dateutil.parser 解析另一种语言的日期
Dateutil 是解析字符串格式日期的好工具。例如
返回
然而,
产生此错误:
有人知道如何让 dateutil 了解语言环境吗?
python - 从字符串中获取 tz 偏移量
我有一个当地时间的日期:
另一个值 tz:
如果我:dateutil.parser.parse(date).isoformat()
我会得到:
我想date
用 tz 信息实现 ISO 格式并得到以下结果:
接近的东西:parse(date,tzinfos=??).isoformat()
?如何从字符串中获取 tzinfo timezone_offset
?
python - “ImportError:matplotlib 需要 dateutil”即使在更新站点包文件夹中的 dateutil 文件夹后也会出现此错误
我是 Python 新手。有人可以建议我如何处理错误"ImportError: matplotlib requires dateutil"
。我已经解决了类似的问题,但我已经按照那里提到的步骤下载了文件夹,并将其更新到了 matplotlib 文件夹所在的 site-packages 文件夹中。
但我仍然收到此错误。有人可以建议我解决这个问题。提前感谢您的支持。
这是我得到的确切错误。
python - Pandas can't find dateutil.parser after Mavericks
I wrote a python script over the summer that uses NumPy and Pandas to help me code some corpus data for the linguistics/psych lab I work in. All was fine until I upgraded to OSX Mavericks -- since then the script throws the following ImportError:
which is quite frustrating! I don't know why anything else on the script would fail to work after dealing with my imports, and numpy and pandas were the only ones I was expecting to have trouble with after upgrading... FYI I'm now running Python 2.7.6
I'm sure it has to do with OSX's inhouse python getting upgraded and I suppose Pandas is trying to look for python syntax in the dateutil module that has since changed or something like that. If anyone has any suggestions they would be much appreciated as I was hoping to get a lot of data coded over the holidays!
python-dateutil - Python dateutil,检查给定的值
我正在解析一个 excel 文档并获取日期时间值...
我正在使用 dateutil 将其转换为 python 日期时间值...
例如,如果传入值是“2012”,我需要一种方法来理解只给出年份
或者如果值为“13:05”,则仅给出小时-分钟。
我怎样才能做到这一点?
- - - 编辑 - -
我也可以这样问:
如果只给出年份 dateutil 用今天的值完成日期和月份......但如果只给出年份,我需要月份和日期的空值......