Skip to content

WIP: DataFrame support #84

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 12 commits into from
Closed
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
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
numpy
fasteners
pandas
26 changes: 25 additions & 1 deletion zarr/codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import math
import multiprocessing
import atexit

import pickle

import numpy as np

Expand Down Expand Up @@ -910,6 +910,30 @@ def __repr__(self):

codec_registry[Categorize.codec_id] = Categorize

class PickleCodec(Codec):

codec_id = 'x-pickle'

def encode(self, buf):
return pickle.dumps(buf)

def decode(self, buf, out=None):
dec = pickle.loads(buf)
if out is not None:
np.copyto(out, dec)
return out
else:
return dec

def get_config(self):
return dict(id=self.codec_id)

def __repr__(self):
return 'PickleCodec()'


codec_registry[PickleCodec.codec_id] = PickleCodec


__all__ = ['get_codec', 'codec_registry']
for _cls in codec_registry.values():
Expand Down
Loading