Skip to content

PERF: msgpack encoding changes to use to/from string for speed boosts #5498

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

Merged
merged 2 commits into from
Nov 13, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 6 additions & 2 deletions pandas/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1871,8 +1871,12 @@ def _asarray_tuplesafe(values, dtype=None):
else:
# Making a 1D array that safely contains tuples is a bit tricky
# in numpy, leading to the following
result = np.empty(len(values), dtype=object)
result[:] = values
try:
result = np.empty(len(values), dtype=object)
result[:] = values
except (ValueError):
# we have a list-of-list
result[:] = [ tuple(x) for x in values ]

return result

Expand Down
4 changes: 2 additions & 2 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,8 +851,8 @@ def to_msgpack(self, path_or_buf, **kwargs):

Parameters
----------
path : string File path
args : an object or objects to serialize
path : string File path, buffer-like, or None
if None, return generated string
append : boolean whether to append to an existing msgpack
(default is False)
compress : type of compressor (zlib or blosc), default to None (no compression)
Expand Down
Loading