A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pandas.pydata.org/docs/reference/api/pandas.DatetimeIndex.is_quarter_start.html below:

pandas.DatetimeIndex.is_quarter_start — pandas 2.3.1 documentation

pandas.DatetimeIndex.is_quarter_start#
property DatetimeIndex.is_quarter_start[source]#

Indicator for whether the date is the first day of a quarter.

Returns:
is_quarter_startSeries or DatetimeIndex

The same type as the original data with boolean values. Series will have the same name and index. DatetimeIndex will have the same name.

See also

quarter

Return the quarter of the date.

is_quarter_end

Similar property for indicating the quarter end.

Examples

This method is available on Series with datetime values under the .dt accessor, and directly on DatetimeIndex.

>>> df = pd.DataFrame({'dates': pd.date_range("2017-03-30",
...                   periods=4)})
>>> df.assign(quarter=df.dates.dt.quarter,
...           is_quarter_start=df.dates.dt.is_quarter_start)
       dates  quarter  is_quarter_start
0 2017-03-30        1             False
1 2017-03-31        1             False
2 2017-04-01        2              True
3 2017-04-02        2             False
>>> idx = pd.date_range('2017-03-30', periods=4)
>>> idx
DatetimeIndex(['2017-03-30', '2017-03-31', '2017-04-01', '2017-04-02'],
              dtype='datetime64[ns]', freq='D')
>>> idx.is_quarter_start
array([False, False,  True, False])

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4