Maybe I could synthesize precisely my problem with my title, however I guess that by explaning it, things will get more clear.
So, what I want to do is the following: I want to create a dataframe which each row combinates each distinct element of 4 different numpy arrays.
I am trying to avoid for loops as much as possible and I am not sure if there are other means to achieve my goal utilizing pandas or python methods which I am not still aware of. The problem that I am trying to solve is naturally more complex and would involve several more arrays as well as more complex data.
I would really appreciate your help on this one!
min_x = 1
max_x = 5
x1_set = np.linspace(min_x, max_x, 5)
x2_set = np.linspace(min_x, max_x, 5)
x3_set = np.linspace(min_x, max_x, 5)
x4_set = np.linspace(min_x, max_x, 5)
X_set_df = pd.DataFrame([x1_set,x2_set,x3_set,x4_set]).T
I would expect a dataframe that would be somehow like this
First row : 1,1,1,1
Second row: 1,1,1,2
Third row: 1,1,1,3
...
n-row: 5,5,5,5