8000 BUG: Bug fix implement __reduce__/__setstate__ for Period pickle support by scarrucciu · Pull Request #10441 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG: Bug fix implement __reduce__/__setstate__ for Period pickle support #10441

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

Closed
wants to merge 17 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
implement __reduce__/__setstate__ for Period pickle support
  • Loading branch information
Spencer Carrucciu committed Jun 25, 2015
commit f9c517fc92be0314be8a184f456bb32a17fb8218
8 changes: 8 additions & 0 deletions pandas/src/period.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,14 @@ cdef class Period(object):
value = ("%s" % formatted)
return value

def __setstate__(self, state):
self.freq=state[1]
self.ordinal=state[2]

def __reduce__(self):
object_state = None, self.freq, self.ordinal
return (Period, object_state)

def strftime(self, fmt):
"""
Returns the string representation of the :class:`Period`, depending
Expand Down
0