Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pd.to_pickle() and pd.read_pickle() bug? #11002

Closed
ifmihai opened this issue Sep 5, 2015 · 1 comment · Fixed by #11006
Closed

pd.to_pickle() and pd.read_pickle() bug? #11002

ifmihai opened this issue Sep 5, 2015 · 1 comment · Fixed by #11006
Labels
Bug IO Data IO issues that don't fit into a more specific label
Milestone

Comments

@ifmihai
Copy link

ifmihai commented Sep 5, 2015

I'm on windows 7, anaconda, python 2.7.9, 32bit
pandas 0.16.2

try this:

import pandas as pd
df4 = pd.DataFrame(index=P.date_range('1750-1-1', '2050-1-1', freq='7D')
pd.to_pickle(df4, '7d.test')
pd.read_pickle('7d.test')


In [84]: P.read_pickle('7d.test')
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-84-0108eecfbea7> in <module>()
----> 1 P.read_pickle('7d.test')

C:\Users\LV\Miniconda\lib\site-packages\pandas\io\pickle.pyc in read_pickle(path)
     58 
     59     try:
---> 60         return try_read(path)
     61     except:
     62         if PY3:

C:\Users\LV\Miniconda\lib\site-packages\pandas\io\pickle.pyc in try_read(path, encoding)
     55             except:
     56                 with open(path, 'rb') as fh:
---> 57                     return pc.load(fh, encoding=encoding, compat=True)
     58 
     59     try:

C:\Users\LV\Miniconda\lib\site-packages\pandas\compat\pickle_compat.pyc in load(fh, encoding, compat, is_verbose)
    114         up.is_verbose = is_verbose
    115 
--> 116         return up.load()
    117     except:
    118         raise

C:\Users\LV\Miniconda\lib\pickle.pyc in load(self)
    856             while 1:
    857                 key = read(1)
--> 858                 dispatch[key](self)
    859         except _Stop, stopinst:
    860             return stopinst.value

C:\Users\LV\Miniconda\lib\site-packages\pandas\compat\pickle_compat.pyc in load_reduce(self)
     18 
     19     try:
---> 20         stack[-1] = func(*args)
     21         return
     22     except Exception as e:

C:\Users\LV\Miniconda\lib\site-packages\pandas\tseries\index.pyc in _new_DatetimeIndex(cls, d)
    113     # data are already in UTC
    114     tz = d.pop('tz',None)
--> 115     result = cls.__new__(cls, **d)
    116     result.tz = tz
    117     return result

C:\Users\LV\Miniconda\lib\site-packages\pandas\util\decorators.pyc in wrapper(*args, **kwargs)
     86                 else:
     87                     kwargs[new_arg_name] = new_arg_value
---> 88             return func(*args, **kwargs)
     89         return wrapper
     90     return _deprecate_kwarg

C:\Users\LV\Miniconda\lib\site-packages\pandas\tseries\index.pyc in __new__(cls, data, freq, start, end, periods, copy, name, tz, verify_integrity, normalize, closed, ambiguous, **kwargs)
    334                     if not np.array_equal(subarr.asi8, on_freq.asi8):
    335                         raise ValueError('Inferred frequency {0} from passed dates does not'
--> 336                                          'conform to passed frequency {1}'.format(inferred, freq.freqstr))
    337 
    338         if freq_infer:

ValueError: Inferred frequency W-THU from passed dates does notconform to passed frequency 7D
@jreback jreback added Bug IO Data IO issues that don't fit into a more specific label labels Sep 5, 2015
@jreback jreback added this to the 0.17.0 milestone Sep 5, 2015
@jreback
Copy link
Contributor

jreback commented Sep 5, 2015

fair enough

jreback added a commit that referenced this issue Sep 5, 2015
BUG: Bug in pickling of a non-regular freq DatetimeIndex #11002
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug IO Data IO issues that don't fit into a more specific label
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants