As shown in the above, needs to be grouped, need a weighted average of the composition and weight of the column needs to sum (the sum of weight (*)/sum (weight))
The results are as follows:
Strives for the various gods, how to implement in python?
CodePudding user response:
Excuse me, are you want to use pandas (similar to SQL) or, traveled through the CSV file, according to the result thenCodePudding user response:
Want to solve with pandas,CodePudding user response:
Has been solved, numpy. Business ()