DataFrame
A B C
1 2 3
2 4 6
array = [1,10,100]
Result:
A B C
1 2 3
2 4 6
10 20 30
20 40 60
100 200 300
200 400 600
Array and dataframe length can be of any size, not necessarily the same.
I have done using FOR loop which is too slow if I have large dataframe or too many of them.
Below is my sample snippet:
for i in array:
pr[pr.select_dtypes(include=['number']).columns] *= i
fdf = np.concat([fdf,pr],axis=0)
Is there a much faster way to do this. I am dealing with multiple dataframes which after this operation needs to concatenated.