I'm trying to do a group by + count with a weather stations table to answer the following questions:
What are the most active stations? (i.e. what stations have the most rows)?
List the stations and the counts in descending order
The table consists of the following values: id INTEGER station TEXT date TEXT prcp FLOAT tobs FLOAT
This is my current formulation of the select statement:
sel = [Measurement.station, func.count(Measurement.id)]
count = session.query(*sel).all()
count