Skip to content

Commit

Permalink
Merge pull request #34 from autonomio/fix_array_shuffle
Browse files Browse the repository at this point in the history
Fix array shuffle
  • Loading branch information
mikkokotila authored Apr 21, 2022
2 parents 082b84d + 692eea8 commit bd87ebf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
URL = 'http://autonom.io'
LICENSE = 'MIT'
DOWNLOAD_URL = 'https://github.com/autonomio/wrangle/'
VERSION = '0.7.1'
VERSION = '0.7.2'

try:
from setuptools import setup
Expand Down
8 changes: 4 additions & 4 deletions wrangle/array/array_random_shuffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def array_random_shuffle(x, y=None, multi_input=False):
for ar in x:

rng.bit_generator.state = state
rng.shuffle(ar, axis=1)
rng.shuffle(ar, axis=0)
x_out.append(ar)

x = x_out
Expand All @@ -37,7 +37,7 @@ def array_random_shuffle(x, y=None, multi_input=False):

try:
y.shape[1]
rng.shuffle(y, axis=1)
rng.shuffle(y, axis=0)
except IndexError:
rng.shuffle(y)

Expand All @@ -50,14 +50,14 @@ def array_random_shuffle(x, y=None, multi_input=False):
elif isinstance(x, list) == False:

rng.bit_generator.state = state
rng.shuffle(x, axis=1)
rng.shuffle(x, axis=0)

if y is not None:
rng.bit_generator.state = state

try:
y.shape[1]
rng.shuffle(y, axis=1)
rng.shuffle(y, axis=0)
except IndexError:
rng.shuffle(y)

Expand Down

0 comments on commit bd87ebf

Please sign in to comment.