I have a 2D numpy array that has a shape of (867, 43). My aim is to add an extra column (np.nan value) as the leading column to this array so that the shape becomes (867, 44).
An example would be:
# sub-section of array
>>> arr[:2, :5]
array([[-0.30368954, 2.8808107 , 5.8833385 , 8.6606045 , 11.242557 ],
[-0.22719575, 3.0030012 , 6.065371 , 8.924864 , 11.561942 ]],
dtype=float32)
would turn into:
# same sub-section
>>> f[:2,:5]
array([[ nan, -0.30368954, 2.8808107 , 5.8833385 , 8.6606045 ],
[ nan, -0.22719575, 3.0030012 , 6.065371 , 8.924864 ]],
dtype=float32)
i.e the values have been shifted right as the horizontal dimension has increased by one.