python-dateutil Questions

3

Solved

Pandas internals question: I've been surprised to find a few times that explicitly passing a callable to date_parser within pandas.read_csv results in much slower read time than simply using infer_...
Orgell asked 11/2, 2018 at 4:34

2

Solved

>>> import dateutil.parser, dateutil.tz as tz >>> dateutil.parser.parse('2017-08-09 10:45 am').replace(tzinfo=tz.gettz('America/New_York')) datetime.datetime(2017, 8, 9, 10, 45, t...
Arleenarlen asked 13/10, 2017 at 18:20

1

Solved

Trying to parse the datetime string with timezone info and get the utc offset from dateutil.parser import parse as parse_date s = '2017-08-28 06:08:20,488 CDT' dt = parse_date(s) print(dt.utcoffse...
Spook asked 31/8, 2017 at 18:58

2

Solved

I'm using dateutil.parser.parse to format a date from a string. But now it mixes up the month and the day. I have a string that contains 05.01.2015. After dateutil.parser.parse("05.01.2015") it...
Scrutator asked 6/1, 2015 at 14:29

5

Solved

I have the following string input : 24052017. When I try to do: >>>dateutil.parser.parse("24052017") It tells me that month must be in 1..12. I have even tried doing: >>>date...
Citystate asked 2/6, 2017 at 13:36

2

I have a Python 3.5.1 environment managed by conda. I'm trying to create a new Python 3.5.1 environment with conda create and listing several of the modules I want in the new environment. One such...
Anarchy asked 12/6, 2016 at 15:57

11

Solved

I'm trying to convert some date/times to UTC, which I thought would be dead simple in Python - batteries included, right? Well, it would be simple except that Python (2.6) doesn't include any tzinf...
Preconceive asked 18/5, 2009 at 18:38

3

Solved

I am trying to print a recurrence rule as a string specified by iCalendar format (see RFC 5545). Im using python dateutils, in particular dateutil.rrule to create the recurrence rule and I want to ...
Capapie asked 8/9, 2012 at 14:34

1

Solved

I tried to upgrade dateutil from 2.5.3 to the newest version 2.6.0 with pip install dateutil --upgrade, but got the issue Could not find a version. $ pip install dateutil --upgrade Collecting date...
Recessive asked 25/11, 2016 at 16:34

3

Solved

Dateutil's timedelta object appears to have a custom __str__ method: In [1]: from datetime import timedelta In [2]: td = timedelta(hours=2) In [3]: str(td) Out[3]: '2:00:00' What I'd like to d...
Harte asked 25/11, 2016 at 14:1

2

Solved

I'm currently working on an application that is required to support multiple timezones. For that, I'm using the dateutil library. Now, I need a way to present the user a list of all available time...
Tatianatatianas asked 16/3, 2013 at 19:46

3

Solved

I am working on old text files with 2-digit years where the default century logic in dateutil.parser doesn't seem to work well. For example, the attack on Pearl Harbor was not on dparser.parse("12/...
Belloir asked 25/7, 2016 at 20:41

2

Solved

I have a the following code that runs fine with input format like {Year}/{Month} except when it comes to 1994/02 Here is the sample code >>> import dateutil.parser as dtp >>> dt...
Lendlease asked 30/1, 2013 at 1:52

4

Solved

At some point in the last few days, Matplotlib stopped working for me on OS X. Here's the error I get when trying to import matplotlib: Traceback (most recent call last): File "/my/path/to/script...
Maramarabel asked 24/12, 2014 at 0:51

1

Solved

When I use dateutil.parser to parse an incomplete date that's missing the day, I get the day set to 10 for some reason: from dateutil.parser import parse >>> d1 = parse('2008 Apr 2') >...
Baguio asked 10/12, 2015 at 14:41

2

I'm getting a date as a string, then I'm parsing it to datetime object. Is there any way to check what's is the date format of the object? Let's say that this is the object that I'm creating...
Bisset asked 3/12, 2015 at 18:27

2

Solved

I'm trying to see if a list of dates are valid dates. I'm using the dateutil library, but I'm getting weird results. For example, when I try the following: import dateutil.parser as parser x = '10...
Butterfat asked 13/10, 2015 at 2:47

2

Solved

im parsing some tweet's data from Twitter API using sixohsix library. Im trying to convert the date of the tweet to my locale: from pytz import timezone from dateutil import parser timestamp = pa...
Edaedacious asked 22/1, 2014 at 23:41

2

Does anyone know why python's dateutil reverses the sign of the GMT offset when it parses the datetime field? Apparently this feature is a known outcome of not only dateutil but also other parsing...
Radiative asked 26/6, 2015 at 17:18

0

When I try to compile the hello.py file with cx_freeze, I get the following error with pandas 0.15.2 but no error with 0.15.1. Has someone any idea on how to correct it ? I have include the dateu...
Kettering asked 30/12, 2014 at 12:3

2

Solved

I'm stumped. The date-cleaning functions I wrote work in Python 2.7.5 on my Mac but not in 2.7.6 on my Ubuntu server. Python 2.7.5 (default, Mar 9 2014, 22:15:05) [GCC 4.2.1 Compatible Apple LLVM...
Matherne asked 10/9, 2014 at 20:0

2

Solved

I am using dateutil to parse picture filenames and sort them according to date. Since not all my pictures have metadata, dateutil is trying to guess where to put them. Most of my pictures are in t...
Translucid asked 9/6, 2013 at 16:33

1

I am trying to dateutil.parser.parse() to parse the default str(datetime.datetime.now()) output using timezone-aware datetimes. However, parse() seems to lose the timezone information and replace i...
Doublefaced asked 14/7, 2014 at 8:58

1

Solved

I was playing with the dateutil module in Python 2.7.3. I simply wanted to use: import dateutil dateutil.parser.parse("01-02-2013") But I got an error: AttributeError: 'module' object has no at...
Hardecanute asked 30/4, 2014 at 9:55

1

I like to parse datetime strings with dateutil.parser.parse module. It's simple. However I noticed in my code that I have to check if the object is indeed in 8601 (and aware). My structure is: if...
Whitaker asked 3/3, 2014 at 6:59

© 2022 - 2024 — McMap. All rights reserved.