Currently I have a list of arrays as follows:
array =
[array([100000. , 100848.06652142, 99648.67144694, 102047.67944271,
103655.99048427, 104602.87678005, 104597.83419837, 103505.42736768,
104976.01311214, 104457.34603404, 105855.46549162, 105613.30235519,
105212.71840922, 107647.5054673 ])
array([107647.5054673 , 106891.82007643, 106979.91405552, 106030.74186486,
107856.04281712, 108502.71948581, 106557.2401056 , 105659.59829843,
105663.01875745, 107300.69453018, 106336.34733019, 107584.99034227,
108089.2320392 , 106786.91702337])
array([106786.91702337, 104416.74000465, 101289.12525402, 101932.58219813,
102625.04352578, 101767.46209616, 103345.4263012 , 102816.73322055,
102417.59316407, 104439.37518975, 103755.22627215, 103817.9744686 ,
107872.40234863, 108110.9662065 ])
array([108110.9662065 , 109544.86827069, 111072.22392645, 112618.46235766,
113847.1768898 , 116708.86391903, 115790.02599715, 115614.72242411,
119225.88436354, 121991.38468934, 123304.85972848, 125571.38040251,
122456.3667249 ])
array([122456.3667249 , 127497.74699282, 128659.85495604, 125813.77115906,
129008.46450085, 128111.00914756, 123039.92607546, 124723.87932757,
124181.57385836, 125134.9276196 , 126027.8631434 , 129304.85119148,
128912.58600657])]
What would be the best possible way to join all these subarrays back together into one large array? I tried np.concatenate() but that did not work.
SOLUTION
For whatever reason, my output would not put commas between the subarrays, once I was able to find the fix for that np.concatenate() did indeed work.
np.concatenate()did not work for you, can you show the actual code that you have attempted.np.concatenate()to no surprise did not work? I am surprised!printdisplay of an object omits commas, that means it's a numpy array, not a list. Yourarraylooks like an object dtype array ofndarrays. I can make a valid list from @AGNGazer's modification. But when I tryconcatenateI get theshape shapeerror message.np.array(thatlist, dtype=object)produces an array whose 'print(arr)` looks like yourarray. Therepradds an outerarrayandobjectdtype.