i have a numpy array p like this:
array([[ 0.92691702, 0.07308298],
[ 0.65515095, 0.34484905],
[ 0.32526151, 0.67473849],
...,
[ 0.34171992, 0.65828008],
[ 0.77521514, 0.22478486],
[ 0.96430103, 0.03569897]])
If i do x=p[:,1:2], i would get
array([[ 0.07308298],
[ 0.34484905],
[ 0.67473849],
...,
[ 0.65828008],
[ 0.22478486],
[ 0.03569897]])
and x.shape is (5500,1)
However, if i do x=p[:,1], i would get
array([ 0.07308298, 0.34484905, 0.67473849, ..., 0.65828008,
0.22478486, 0.03569897])
and x.shape is (5500, )
Why there is difference like this? It quite confuses me. Thanks all in advance for your help.
[1,2,3][1]is not the same as[1,2,3][1:2]. Try understanding this example first.