Excel SUMIFS, COUNTIFS & AVERAGEIFS in PYTHON (Pandas Library)
Language:
This video will show you, how to perform the Excel functions: SumIf(s), CountIf(s) & AverageIf(s) in Python. In particular, we will be using the Pandas library & the query method.
### SUMIFs EXAMPLE import pandas as pd # pip install pandas df = pd.read_csv('https://raw.githubusercontent.com/mwaskom/seaborn-data/master/tips.csv') # Sum of all tips on Sunday's during Dinner Time day = 'Sun' time = 'Dinner' sumifs = df.query('day == @day & time == @time')['tip'].sum() sumifs