Python | Pandas PeriodIndex.freqstr Last Updated : 20 Aug, 2021 Comments Improve Suggest changes Like Article Like Report Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas PeriodIndex.freqstr attribute return the frequency object as a string if its set, otherwise the function return None for the given PeriodIndex object. Syntax : PeriodIndex.freqstr Parameters : None Return : frequency as a string Example #1: Use PeriodIndex.freqstr attribute to find the time series frequency applied on the given PeriodIndex object. Python3 # importing pandas as pd import pandas as pd # Create the PeriodIndex object pidx = pd.PeriodIndex(start ='2005-12-21 08:45 ', end ='2005-12-21 11:55', freq ='H') # Print the PeriodIndex object print(pidx) Output : Now we will use the PeriodIndex.freqstr attribute to find the time series frequency of the given object. Python3 # return the frequency object as a string pidx.freqstr Output : As we can see in the output, the PeriodIndex.freqstr attribute has returned 'H' indicating that hourly frequency is applied on the given PeriodIndex object. Example #2: Use PeriodIndex.freqstr attribute to find the time series frequency of the given PeriodIndex object. Python3 # importing pandas as pd import pandas as pd # Create the PeriodIndex object pidx = pd.PeriodIndex(start ='2011-02-1 ', end ='2011-08-14', freq ='M') # Print the PeriodIndex object print(pidx) Output : Now we will use the PeriodIndex.freqstr attribute to find the time series frequency of the given object. Python3 # return the frequency object as a string pidx.freqstr Output : As we can see in the output, the PeriodIndex.freqstr attribute has returned 'M' indicating that monthly frequency is applied on the given PeriodIndex object. Comment More infoAdvertise with us Next Article Python | Pandas PeriodIndex.freqstr S Shubham__Ranjan Follow Improve Article Tags : Technical Scripter Python Python-pandas Pandas periodIndex Practice Tags : python Similar Reads Python | Pandas PeriodIndex.freq Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas PeriodIndex.freq attribute returns the time series frequency that is applied on 2 min read Python | Pandas Period.freqstr Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas Period.freqstr attribute returns the string alias of the Time series frequency 2 min read Python | Pandas PeriodIndex.asfreq Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas PeriodIndex.asfreq() function convert each element of the given PeriodIndex obj 2 min read Python | Pandas Period.freq Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas Period.freq attribute returns the frequency applied on the given Period object. 2 min read Python | Pandas PeriodIndex.hour Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas PeriodIndex.hour attribute return the hour of the period for the given PeriodIn 2 min read Like