# Week 2 programming assignments-exercise 5-image2vector

Hi everyone,
I write the code of this exercise, but I do not get the write running and I do not know where is my mistake.I want to the share the picture of this code and if anybody can help me, I would be grateful.
thanks for the attention.

{moderator edit - solution code removed}

Welcome to the community!

First of all, I request you to kindly remove the code as its against the honor code.
Secondly, please go through the instructions once mentioned just above the programming cell of the notebook. It has clearly stated how you need to write the code for the asked function.

**Exercise 5 - image2vector**
Implement image2vector() that takes an input of shape (length, height, 3) and returns a vector of shape (length*height*3, 1). For example, if you would like to reshape an array v of shape (a, b, c) into a vector of shape (a*b,c) you would do:

v = v.reshape((v.shape[0] * v.shape[1], v.shape[2])) # v.shape[0] = a ; v.shape[1] = b ; v.shape[2] = c
Please don't hardcode the dimensions of image as a constant. Instead look up the quantities you need with image.shape[0], etc.
You can use v = v.reshape(-1, 1). Just make sure you understand why it works.

Thanks.