Blosc / bloscpack

Command line interface to and serialization format for Blosc
BSD 3-Clause "New" or "Revised" License
122 stars 27 forks source link

Can we save dictionary including numpy arrays ? #95

Closed MyraBaba closed 4 years ago

MyraBaba commented 5 years ago

Hi,

I tested to save dicttionar consisting of two numpy arrays .

it says

dict object has no attribute 'dtype'

array is:


  `_names_np = np.empty(shape=[number_of_item, ], dtype='<U254')

    _floats_np = np.empty(shape=[number_of_item, 512], dtype=np.float32)`
esc commented 5 years ago

@MyraBaba thanks for asking about this! This functionality isn't supported at the moment, I am afraid. You will have to save each numpy array individually for the time being..

MyraBaba commented 5 years ago

It could be very usefull :)

Best

Thx

On 9 Aug 2019, at 11:09, Valentin Haenel notifications@github.com wrote:

@MyraBaba https://github.com/MyraBaba thanks for asking about this! This functionality isn't supported at the moment, I am afraid. You will have to save each numpy array individually for the time being..

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Blosc/bloscpack/issues/95?email_source=notifications&email_token=AEFRZH6XEIIWWHV5WJLZB7LQDUQ2DA5CNFSM4IKRQDXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD356JWA#issuecomment-519824600, or mute the thread https://github.com/notifications/unsubscribe-auth/AEFRZH2FWHVVHN5HQSHFE73QDUQ2DANCNFSM4IKRQDXA.

MyraBaba commented 5 years ago

What is the proper way to save ndarrays including strings :

Like

people_names_np = np.empty(shape=[number_of_item, ], dtype='object')

Gives ObjectNumpyarray rejection

On 9 Aug 2019, at 11:09, Valentin Haenel notifications@github.com wrote:

@MyraBaba https://github.com/MyraBaba thanks for asking about this! This functionality isn't supported at the moment, I am afraid. You will have to save each numpy array individually for the time being..

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Blosc/bloscpack/issues/95?email_source=notifications&email_token=AEFRZH6XEIIWWHV5WJLZB7LQDUQ2DA5CNFSM4IKRQDXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD356JWA#issuecomment-519824600, or mute the thread https://github.com/notifications/unsubscribe-auth/AEFRZH2FWHVVHN5HQSHFE73QDUQ2DANCNFSM4IKRQDXA.

MyraBaba commented 5 years ago

When I change the dtype to <U254 it gives :

ValueError: 'typesize' must be in the range 0 <= n <= 255, not '1008'

On 9 Aug 2019, at 11:09, Prometheus WillSurvive prometheus.willsurvive@gmail.com wrote:

It could be very usefull :)

Best

Thx

On 9 Aug 2019, at 11:09, Valentin Haenel <notifications@github.com mailto:notifications@github.com> wrote:

@MyraBaba https://github.com/MyraBaba thanks for asking about this! This functionality isn't supported at the moment, I am afraid. You will have to save each numpy array individually for the time being..

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Blosc/bloscpack/issues/95?email_source=notifications&email_token=AEFRZH6XEIIWWHV5WJLZB7LQDUQ2DA5CNFSM4IKRQDXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD356JWA#issuecomment-519824600, or mute the thread https://github.com/notifications/unsubscribe-auth/AEFRZH2FWHVVHN5HQSHFE73QDUQ2DANCNFSM4IKRQDXA.

esc commented 5 years ago

@MyraBaba thanks again for asking about this, unfortunately however, object arrays and unicode arrays are not supported to my knowledge.

esc commented 4 years ago

I am closing this as I believe it has been resolved.Thank you for using bloscpack!