metobs_toolkit.analysis.Analysis.apply_filter#

Analysis.apply_filter(expression)[source]#

Filter an Analysis by a user definde string expression.

This can be used to filter the observation to specific meteorological conditions (i.e. low windspeeds, high humidity, cold temperatures, …)

The filter expression contains only columns present in the Analysis.df and/or the Analysis.metadf.

A New Analysis object is returned.

Parameters:

expression (str) – A filter expression using columnnames present in either df or metadf. The following timestamp derivatives can be used as well: [minute, hour, month, year, day_of_year, week_of_year, season]. The quarry_str may contain number and expressions like <, >, ==, >=, *, +, …. Multiple filters can be combine to one expression by using & (AND) and | (OR).

Returns:

filtered_analysis – The filtered Analysis.

Return type:

metobs_toolkit.Analysis

Note

All timestamp derivative values are numeric except for ‘season’, possible values are [‘winter’, ‘spring’, ‘summer’, ‘autumn’].

Note

Make sure to use “ of ‘ to indicate string values in the expression if needed.