Skip to main content

meteostat.TimeSeries.count

Get the number of rows in the whole time series or by parameter. NaN values are excluded.

Parameters​

ParameterDescriptionTypeDefault
parameterThe parameter which should be counted, if None the whole time series is consideredParameter or NoneNone

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')