data = [['297348640', 'Y', '12', 'Y'],
['300737722','Y', '1', 'Y'],
['300074407', 'Y', '1', 'N']]
I want to convert this into a NumPy array so I did:
data = np.array(data)
The above is working fine.
Now I have two lists, say
a = [0,2,6]
b = [21,21,9]
I have to append these at last of my previous list:
data = [['297348640', 'Y', '12', 'Y', 0, 21],
['300737722','Y', '1', 'Y', 2, 21],
['300074407', 'Y', '1', 'N', 6, 9]]
I tried this but its giving me wrong dimension error
a = np.array([a])
b = np.array([b])
data = np.hstack(data,(a))
data = np.hstack(data,(b))
ValueError: all the input arrays must have same number of dimensions