Hi,
I am trying to parse data in C2W4 by using np.loadtxt. here is what I did: csv_load=np.loadtxt(file,delimiter=‘,’)
** labels = csv_load[0]**
** images = csv_load[1:]**
but I got an error saying:
could not convert string to float: ‘label’
How do I correct my code? I know I should do something about data type. But I don’t know exact keys.
Hi,
Thanks for your help. But as I added skiprow command, I think the file should be something like this: there are 27455 images, and each image is a row, with the first slot as a label and the rest pixel numbers. on top of these 27455 images/rows, there is a header row.
It seems the output is not aligned with my thought. Would you please point out where I made mistakes? Thank you.
Here is my code:
Thank you for your help. I have got labels right using your hint.
I am trying to solve for images.
I colored my thoughts in code in the following picture.