AttributeError: ‘Series’ object has no attribute ‘reshape’
Solution was linked on reshaped method on documentation page. Insted of Y.reshape(-1,1) you need to use:
Solution was linked on reshaped method on documentation page. Insted of Y.reshape(-1,1) you need to use:
A simple pivot might be sufficient for your needs but this is what I did to reproduce your desired output: Just adding a within group counter/index will get you most of the way there but the column labels will not be as you desired: To get closer to your desired output I added the following: … Read more
You can think of reshaping that the new shape is filled row by row (last dimension varies fastest) from the flattened original list/array. An easy solution is to shape the list into a (100, 28) array and then transpose it: Update regarding the updated example:
Pure numpy Check out the loadtxt documentation. You can also use python’s csv module: You will have to convert it to your favorite numeric type. I guess you can write the whole thing in one line: result = numpy.array(list(csv.reader(open(“test.csv”, “rb”), delimiter=”,”))).astype(“float”) Added Hint: You could also use pandas.io.parsers.read_csv and get the associated numpy array which can be faster.