I have a list of multiple arrays and I want them to have the same size, filling the ones with less elements with nan. I have some arrays that have integers and others that have string.
For example:
a = ['Nike']
b = [1,5,10,15,20]
c = ['Adidas']
d = [150, 2]
I have tried
max_len = max(len(a),len(b),len(c),len(d))
empty = np.empty(max_len - len(a))
a = np.asarray(a) + empty
empty = np.empty(max_len - len(b))
b = np.asarray(b) + empty
I do the same with all of the arrays, however an error occurs (TypeError: only integer scalar arrays can be converted to a scalar index)
I am doing this because I want to make a DataFrame with all of the arrays being a different columns.
Thank you in advanced