Skip to content

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

Closed
@ifmihai

Description

@ifmihai

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIO DataIO issues that don't fit into a more specific label

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions