Skip to content

Unable to load pickle Dataset that was picked with cPickle #167

Closed
@rzlee

Description

@rzlee
import cPickle as pickle
import xray
import numpy as np
import pandas as pd

foo_values = np.random.RandomState(0).rand(3,4)
times = pd.date_range('2001-02-03', periods=3)
ds = xray.Dataset({'time': ('time', times), 'foo': (['time', 'space'], foo_values)})

with open('mypickle.pkl', 'w') as f:
    pickle.dump(ds, f)

with open('mypickle.pkl') as f:
    myds = pickle.load(f)

myds

This code results in:
<repr(<xray.dataset.Dataset at 0x7f95a3290d90>) failed: AttributeError: mapping>

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions