Output:
Example 2: Creating a PeriodIndex object containing periods.python
Output:PeriodIndex(['2021-01', '2021-02', '2021-03'], dtype='period[M]', freq='M') ``` This example shows how to create a PeriodIndex object containing periods with a monthly frequency. Package library: pandas