import glob
import numpy as np

X = np.empty((0, 193))
y = np.empty((0, 10))
groups = np.empty((0, 1))
npz_files = glob.glob('./urban_sound_?.npz')
for fn in npz_files:
    print(fn)
    data = np.load(fn)
    X = np.append(X, data['X'], axis=0)
    y = np.append(y, data['y'], axis=0)
    groups = np.append(groups, data['groups'], axis=0)

print(groups[groups>0])

print(X.shape, y.shape)
for r in y:
    if np.sum(r) > 1.5:
        print(r)
np.savez('urban_sound', X=X, y=y, groups=groups)

[((36, 54), 'numpy.empty', 'np.empty', (['(0, 193)'], {}), '((0, 193))\n', (44, 54), True, 'import numpy as np\n'), ((59, 76), 'numpy.empty', 'np.empty', (['(0, 10)'], {}), '((0, 10))\n', (67, 76), True, 'import numpy as np\n'), ((86, 102), 'numpy.empty', 'np.empty', (['(0, 1)'], {}), '((0, 1))\n', (94, 102), True, 'import numpy as np\n'), ((115, 147), 'glob.glob', 'glob.glob', (['"""./urban_sound_?.npz"""'], {}), "('./urban_sound_?.npz')\n", (124, 147), False, 'import glob\n'), ((444, 492), 'numpy.savez', 'np.savez', (['"""urban_sound"""'], {'X': 'X', 'y': 'y', 'groups': 'groups'}), "('urban_sound', X=X, y=y, groups=groups)\n", (452, 492), True, 'import numpy as np\n'), ((194, 205), 'numpy.load', 'np.load', (['fn'], {}), '(fn)\n', (201, 205), True, 'import numpy as np\n'), ((214, 245), 'numpy.append', 'np.append', (['X', "data['X']"], {'axis': '(0)'}), "(X, data['X'], axis=0)\n", (223, 245), True, 'import numpy as np\n'), ((254, 285), 'numpy.append', 'np.append', (['y', "data['y']"], {'axis': '(0)'}), "(y, data['y'], axis=0)\n", (263, 285), True, 'import numpy as np\n'), ((299, 340), 'numpy.append', 'np.append', (['groups', "data['groups']"], {'axis': '(0)'}), "(groups, data['groups'], axis=0)\n", (308, 340), True, 'import numpy as np\n'), ((410, 419), 'numpy.sum', 'np.sum', (['r'], {}), '(r)\n', (416, 419), True, 'import numpy as np\n')]