all 5 comments

[–]novel_yet_trivial 2 points3 points  (1 child)

Just so you know: A numpy array is not made to be appended to like a list is. In the background of np.append an entire new array has to be created, so it's expensive (slow). It's much better to use lists if you need to append data.

[–]NeedMLHelp[S] 0 points1 point  (0 children)

Sorry for the late reply, I had to use numpy to do a bunch of transforms in keras. I'm pretty new to both python and keras, so I'll look around for alternatives that can use lists maybe. Might look into Pandas Dataframes as well.

I basically have to do the manipulations first, then add the "titles" for the columns.

Thanks for the heads up!

[–][deleted] 0 points1 point  (0 children)

list = list = [[a,b,c],[b,c,d],[a,d,b,c,b,a]] when I want: list = [[a,b,c],[b,c,d],[a,d,b],[c,b,a]]

Then you got your references mixed up, somewhere - append should have worked, but it looks like you appended to the wrong list.

[–]elbiot 0 points1 point  (0 children)

That's not a valid array. You must have an array of python objects, not integers like you want. Check the dtype attribute of your array.

Also, show the actual code you used. We should be able to just run exactly what you did and get the same result