'Joining two dataset with different weights
I'm trying to join two dataframes, one containing signal events and one containing background events. But I want the signals to be counted let's say 10 times more. Is there a better way to do it than using:
total = background
for i in range (0, 10):
total = total.append(signals)
Each column of the dataframe is associated with a variable, like energy or momentum etc. It's fine even if I manage to merge only two columns.
It would also be great to somewhat label the signals event once they are stored in total, like adding another column with values (signal = 1, bkg = 0)
I hope my question is not too confusing, it's my first time here
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
