You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C:\Users\stefan\Anaconda\envs\py343\lib\site-packages\pandas\tseries\tools.py in
dateutil_parse(timestr, default, ignoretz, tzinfos, **kwargs)
489 if res is None:
--> 490 raise ValueError("unknown string format")
491
ValueError: unknown string format
During handling of the above exception, another exception occurred:
DateParseError Traceback (most recent call last)
in ()
----> 1 PD.period_range(start = '2012-Q1', periods = 4, freq = 'Q')
C:\Users\stefan\Anaconda\envs\py343\lib\site-packages\pandas\tseries\period.py i
n period_range(start, end, periods, freq, name)
1433 """
1434 return PeriodIndex(start=start, end=end, periods=periods,
-> 1435 freq=freq, name=name)
C:\Users\stefan\Anaconda\envs\py343\lib\site-packages\pandas\tseries\period.py i
n _get_ordinal_range(start, end, periods, freq)
1281
1282 if start is not None:
-> 1283 start = Period(start, freq)
1284 if end is not None:
1285 end = Period(end, freq)
C:\Users\stefan\Anaconda\envs\py343\lib\site-packages\pandas\tseries\period.py i
n init(self, value, freq, ordinal, year, month, quarter, day, hour, minute,
second)
124 value = value.upper()
125
--> 126 dt, _, reso = parse_time_string(value, freq)
127 if freq is None:
128 try:
C:\Users\stefan\Anaconda\envs\py343\lib\site-packages\pandas\tseries\tools.py in
parse_time_string(arg, freq, dayfirst, yearfirst)
465 except Exception as e:
466 # TODO: allow raise of errors within instead
--> 467 raise DateParseError(e)
468
469 if parsed is None:
DateParseError: unknown string format
The text was updated successfully, but these errors were encountered:
After a quick look at the code I was wondering if it also handels
"2014-S1" for semesters. If "T" for trimersters is also in use, I don't
know. But semesters are. And pandas should parse them as well.
Sorry for not being able to read through the code more thoroughly. I
have been all too busy with my own pet project pandaSDMX wich will be
released in a few days.
This format is used, e.g., in datasets from the ECB.
Code example:
In [25]: PD.period_range(start = '2012Q1', periods = 4, freq = 'Q')
Out[25]:
<class 'pandas.tseries.period.PeriodIndex'>
[2012Q1, ..., 2012Q4]
Length: 4, Freq: Q-DEC
In [26]: PD.period_range(start = '2012-Q1', periods = 4, freq = 'Q')
ValueError Traceback (most recent call last)
C:\Users\stefan\Anaconda\envs\py343\lib\site-packages\pandas\tseries\tools.py in
parse_time_string(arg, freq, dayfirst, yearfirst)
463 parsed, reso = dateutil_parse(arg, default, dayfirst=dayfirst,
--> 464 yearfirst=yearfirst)
465 except Exception as e:
C:\Users\stefan\Anaconda\envs\py343\lib\site-packages\pandas\tseries\tools.py in
dateutil_parse(timestr, default, ignoretz, tzinfos, **kwargs)
489 if res is None:
--> 490 raise ValueError("unknown string format")
491
ValueError: unknown string format
During handling of the above exception, another exception occurred:
DateParseError Traceback (most recent call last)
in ()
----> 1 PD.period_range(start = '2012-Q1', periods = 4, freq = 'Q')
C:\Users\stefan\Anaconda\envs\py343\lib\site-packages\pandas\tseries\period.py i
n period_range(start, end, periods, freq, name)
1433 """
1434 return PeriodIndex(start=start, end=end, periods=periods,
-> 1435 freq=freq, name=name)
C:\Users\stefan\Anaconda\envs\py343\lib\site-packages\pandas\tseries\period.py i
n new(cls, data, ordinal, freq, start, end, periods, copy, name, tz, **kwarg
s)
637 else:
638 data, freq = cls._generate_range(start, end, periods,
--> 639 freq, kwargs)
640 else:
641 ordinal, freq = cls._from_arraylike(data, freq, tz)
C:\Users\stefan\Anaconda\envs\py343\lib\site-packages\pandas\tseries\period.py i
n _generate_range(cls, start, end, periods, freq, fields)
651 raise ValueError('Can either instantiate from fields '
652 'or endpoints, but not both')
--> 653 subarr, freq = _get_ordinal_range(start, end, periods, freq)
C:\Users\stefan\Anaconda\envs\py343\lib\site-packages\pandas\tseries\period.py i
n _get_ordinal_range(start, end, periods, freq)
1281
1282 if start is not None:
-> 1283 start = Period(start, freq)
1284 if end is not None:
1285 end = Period(end, freq)
C:\Users\stefan\Anaconda\envs\py343\lib\site-packages\pandas\tseries\period.py i
n init(self, value, freq, ordinal, year, month, quarter, day, hour, minute,
second)
124 value = value.upper()
125
--> 126 dt, _, reso = parse_time_string(value, freq)
127 if freq is None:
128 try:
C:\Users\stefan\Anaconda\envs\py343\lib\site-packages\pandas\tseries\tools.py in
parse_time_string(arg, freq, dayfirst, yearfirst)
465 except Exception as e:
466 # TODO: allow raise of errors within instead
--> 467 raise DateParseError(e)
468
469 if parsed is None:
DateParseError: unknown string format
The text was updated successfully, but these errors were encountered: