Python | Pandas DatetimeIndex.inferred_freq Last Updated : 24 Dec, 2018 Summarize Comments Improve Suggest changes Share 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 DatetimeIndex.inferred_freq attribute tries to return a string representing a frequency guess, generated by infer_freq. For those cases in which the function is not able to auto detect the frequency of the DatetimeIndex it returns None. Syntax: DatetimeIndex.inferred_freq Return: freq Example #1: Use DatetimeIndex.inferred_freq attribute to auto detect the frequency of the given DatetimeIndex object. Python3 # importing pandas as pd import pandas as pd # Create the DatetimeIndex didx = pd.date_range("2008-12-30", periods = 5, freq ='Q') # Print the DatetimeIndex print(didx) Output : Now we want the function to auto detect the frequency of the given DatetimeIndex object. Python3 # find the frequency of the object. didx.inferred_freq Output : As we can see in the output, the function has tried to auto detect the frequency of the given DatetimeIndex object and has returned a quarter type frequency starting from the month of December. Example #2: Use DatetimeIndex.inferred_freq attribute to auto detect the frequency of the given DatetimeIndex object. Python3 # importing pandas as pd import pandas as pd # Create the DatetimeIndex didx = pd.DatetimeIndex(start ='2000-01-31 06:30', freq ='BM', periods = 5, tz ='Asia/Calcutta') # Print the DatetimeIndex print(didx) Output : Now we want the function to auto detect the frequency of the given DatetimeIndex object. Python3 # find the frequency of the object. didx.inferred_freq Output : As we can see in the output, the function has tried to auto detect the frequency of the given DatetimeIndex object and has returned 'BM' (Business Month end) frequency. Comment More infoAdvertise with us Next Article Python | Pandas DatetimeIndex.minute S Shubham__Ranjan Follow Improve Article Tags : Technical Scripter Python Python-pandas Python pandas-datetimeIndex Practice Tags : python Similar Reads Python | Pandas DatetimeIndex.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 DatetimeIndex.freq attribute returns the frequency object if it is set in the D 2 min read Python | Pandas DatetimeIndex.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 DatetimeIndex.freqstr attribute returns the frequency object as a string if it 2 min read Python | Pandas DatetimeIndex.minute 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 DatetimeIndex.minute attribute outputs an Index object containing the minute va 2 min read Python | Pandas DatetimeIndex.to_frame() 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 DatetimeIndex.to_frame() function create a DataFrame with a column containing t 2 min read Python | Pandas DatetimeIndex.day 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 DatetimeIndex.day attribute outputs an Index object containing the days in each 2 min read Python | Pandas DatetimeIndex.microsecond 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 DatetimeIndex.microsecond attribute outputs an Index object containing the micr 2 min read Like