-
Notifications
You must be signed in to change notification settings - Fork 541
Open
Labels
Description
Slicing a Numpy multidimensional array and the same h5py dataset yields different results.
>>> import numpy as np
>>> import h5py as h5
>>> dims = [1,2,3,4]
>>> a = np.arange(np.prod(dims)).reshape(dims)
>>> F = h5.File('test.h5')
>>> F.create_dataset('test', data=a)
>>> a[0,slice(None), [0,1]]
array([[[ 0, 1, 2, 3],
[12, 13, 14, 15]],
[[ 4, 5, 6, 7],
[16, 17, 18, 19]]])
>>> F['test'][0,slice(None),[0,1]]
array([[[ 0, 1, 2, 3],
[ 4, 5, 6, 7]],
[[12, 13, 14, 15],
[16, 17, 18, 19]]])