Lets say i have two arrays
array_1 = [10,20,30]
array_2 = [50,60,70]
Dataframe i need as Output:
10 20 30
50 60 70 80
60 70 80 90
70 80 90 100
Use outer
addition
>>> np.add.outer(array_1, array_2)
To create the data frame:
pd.DataFrame(arr, columns=array_2, index=array_1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With