Q: Dimensionality issues in using np.concatenate I have a np.array user_matrix and another list user_clust. I want to concatenate user_clust to the last column of user_matrix. Below is my code.
np.concatenate( (user_matrix, user_clust), 1)

But I am getting this error:
ValueError: all the input arrays must have same number of dimensions

Dimensions of the two datasets:
user_matrix.shape #(10000, 110)
user_clust.shape  #(10000,)

I understand that the user_clust is 1-dimensional unlike user_matrix that is 2-dimentional, but don't know how to solve this issue.

A: It appears that you have a 2-D array and you want to add on a vector as a new column at the end:
>>> import numpy as np
>>> mat = np.arange(12).reshape(3,4)
>>> mat
array([[ 0,  1,  2,  3],
       [ 4,  5,  6,  7],
       [ 8,  9, 10, 11]])
>>> vct = np.arange(100, 103)
>>> vct
array([100, 101, 102])
>>> np.concatenate((mat, vct.reshape(vct.shape + (1,))), axis=1)
array([[  0,   1,   2,   3, 100],
       [  4,   5,   6,   7, 101],
       [  8,   9,  10,  11, 102]])

Another option is to use np.append:
>>> np.append(mat, vct.reshape(vct.shape + (1,)), axis=1)
array([[  0,   1,   2,   3, 100],
       [  4,   5,   6,   7, 101],
       [  8,   9,  10,  11, 102]])

Yet another option is np.hstack:
>>> np.hstack( (mat, vct.reshape(vct.shape + (1,))) )
array([[  0,   1,   2,   3, 100],
       [  4,   5,   6,   7, 101],
       [  8,   9,  10,  11, 102]])

The trick
In all cases, it was necessary to reshape the vector vct into a column-vector:
>>> vct
array([100, 101, 102])
>>> vct.reshape(vct.shape + (1,))
array([[100],
       [101],
       [102]])

Alternative
As per hpaulj's suggestion in the comments, another way to convert vct to a column-vector is to use the following form:
>>> vct[..., None]
array([[100],
       [101],
       [102]])
>>> np.concatenate((mat, vct[..., None]), axis=1)
array([[  0,   1,   2,   3, 100],
       [  4,   5,   6,   7, 101],
       [  8,   9,  10,  11, 102]])

