-
-
Notifications
You must be signed in to change notification settings - Fork 19k
Description
I am doing an exemple from http://pandas.pydata.org/pandas-docs/stable/timeseries.html
rng = pandas.period_range('1/1/2011', periods=500, freq='M')
DateParseError Traceback (most recent call last)
/home/users/pawel/AGH/mgr/dane/gazowe/ in ()
----> 1 rng = pandas.period_range('1/1/2011', periods=500, freq='M')
/usr/lib64/python2.7/site-packages/pandas/tseries/period.pyc in period_range(start, end, periods, freq)
1064 """
1065 return PeriodIndex(start=start, end=end, periods=periods,
-> 1066 freq=freq)
1067
1068 def _period_rule_to_timestamp_rule(freq, how='end'):
/usr/lib64/python2.7/site-packages/pandas/tseries/period.pyc in new(cls, data, ordinal, freq, start, end, periods, copy, name, year, month, quarter, day, hour, minute, second)
533 fields = [year, month, quarter, day, hour, minute, second]
534 data, freq = cls._generate_range(start, end, periods,
--> 535 freq, fields)
536 else:
537 ordinal, freq = cls._from_arraylike(data, freq)
/usr/lib64/python2.7/site-packages/pandas/tseries/period.pyc in _generate_range(cls, start, end, periods, freq, fields)
551 raise ValueError('Can either instantiate from fields '
552 'or endpoints, but not both')
--> 553 subarr, freq = _get_ordinal_range(start, end, periods, freq)
554 elif field_count > 0:
555 y, mth, q, d, h, minute, s = fields
/usr/lib64/python2.7/site-packages/pandas/tseries/period.pyc in _get_ordinal_range(start, end, periods, freq)
925
926 if start is not None:
--> 927 start = Period(start, freq)
928 if end is not None:
929 end = Period(end, freq)
/usr/lib64/python2.7/site-packages/pandas/tseries/period.pyc in init(self, value, freq, ordinal, year, month, quarter, day, hour, minute, second)
98 value = str(value)
99
--> 100 dt, freq = _get_date_and_freq(value, freq)
101
102 elif isinstance(value, datetime):
/usr/lib64/python2.7/site-packages/pandas/tseries/period.pyc in _get_date_and_freq(value, freq)
382 def _get_date_and_freq(value, freq):
383 value = value.upper()
--> 384 dt, _, reso = parse_time_string(value, freq)
385
386 if freq is None:
/usr/lib64/python2.7/site-packages/pandas/tseries/tools.pyc in parse_time_string(arg, freq)
217 return ret, parsed, reso # datetime, resolution
218 except Exception, e:
--> 219 raise DateParseError(e)
220
221 def _try_parse_monthly(arg):
DateParseError: 'str' object has no attribute 'read'
Works fine with python-3.2.
python-2.7.3, numpy-1.6.2, scipy-0.10.1, pandas 0.8.0