meteostat.TimeSeries.count
Get the number of rows in the whole time series or by parameter. NaN values are excluded.
- Type: Method of
TimeSeries - Source Code: GitHub
Parameters
| Parameter | Description | Type | Default |
|---|---|---|---|
parameter | The parameter which should be counted, if None the whole time series is considered | Parameter or None | None |
Returns
int
Example
from datetime import date
import meteostat as ms
# Specify time range
START = date(2018, 1, 1)
END = date(2018, 12, 31)
# Get daily data
ts = ms.daily('10637', START, END)
# Count rows with precipitation data
count = ts.count(ms.Parameter.PRCP)
print(f'{count} rows with precipitation data')