Column vector's size not set to 1 for the number of columns in Python

Viewed 14

I work on Spyder (Python 3.5) and I used pandas to study a data frame from which I took a specific column of N lines. However, when I convert this data frame column to a numpy array with to_numpy(), the size appears to be "(N, )" with np.shape() and the number of columns isn't set. Obviously, it should be set to 1 but it's not the case, there is simply no value after the comma.

Also, the type is an array of float64 and since the column I took is one I created using a math formula and added to the data frame, I used fillna(0) to suppress the NaN values in my column.

The thing is it causes me troubles when I want to do matrix multiplications after.

Thank you for your help.

0 Answers
Related