Doubt in reshaping

How does reshaping a numpy array to .reshape(-1, ) help? I mean what does it do? And if shape iss wriiten as (399,1) and (399, ) , what’s the difference?

3339 ,1 represents an array with rows 3339 and one column whereas (3339,)reresents a vector.

suppose u have an array of 500X2 if u reshape it as a.reshape((1000,-1)) it will automatically calculate what number of columns will be required to represent above data for above case -1 will be replaced by 1.

What does -1 signify?

-1 is like telling computer to calculate the value itself instead of giving it the value.

1 Like

Thanks, this really helped :slight_smile:

what’s difference between (399,1) array and (399, ) vector?

nothing its just terminology