vivainsights.identify_daterange¶
Identify whether a date column has daily, weekly, or monthly frequency.
The primary use case for this function is to provide an accurate description of the query type used and for raising errors should a wrong date grouping be used in the data input.
- vivainsights.identify_daterange.identify_datefreq(x)[source]¶
Identify whether dates have daily, weekly, or monthly frequency.
- Parameters:
x (array-like) – A sequence of date values (strings or datetime objects).
- Returns:
"daily","weekly","monthly", or a message if the frequency cannot be determined.- Return type:
str
Examples
>>> import vivainsights as vi >>> pq_data = vi.load_pq_data() >>> vi.identify_datefreq(pq_data["MetricDate"])