Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
AmitDiwan has Published 10744 Articles
AmitDiwan
135 Views
To return the Timestamp representation of the Period object, use the period.to_timestamp() method.At first, import the required libraries −import pandas as pdThe pandas.Period represents a period of time. Creating a Period objectperiod = pd.Period(freq="S", year = 2021, month = 9, day = 18, hour = 17, minute = 20, second ... Read More
AmitDiwan
961 Views
To format the Period object, use the period.strftime() method and to display the time with 24-Hour format, set the parameter as %H.At first, import the required libraries −import pandas as pdThe pandas.Period represents a period of time. Creating a Period objectperiod = pd.Period(freq="S", year = 2021, month = 9, day ... Read More
AmitDiwan
262 Views
To format the Period object, use the period.strftime() method and to display the year without century, set the parameter as %y.At first, import the required libraries −import pandas as pdThe pandas.Period represents a period of time. Creating a Period objectperiod = pd.Period(freq="S", year = 2021, month = 9, day = ... Read More
AmitDiwan
2K+ Views
To format the Period object, use the period.strftime() method and to display Quarter, set the parameter as Q%q.At first, import the required libraries −import pandas as pdThe pandas.Period represents a period of time. Creating a Period objectperiod = pd.Period(freq="S", year = 2021, month = 9, day = 18, hour = ... Read More
AmitDiwan
1K+ Views
To format and return the string representation of the Period object, use the period.strftime() method. With that, set the format specifiers as an argument like strftime('%d-%b-%Y').At first, import the required libraries −import pandas as pdThe pandas.Period represents a period of time. Creating a Period objectperiod = pd.Period(freq="S", year = 2021, ... Read More
AmitDiwan
218 Views
To change the frequency of the given Period object from Seconds to Minutely frequency, use the period.asfreq() method and set the parameter ‘T’.At first, import the required libraries −import pandas as pdThe pandas.Period represents a period of time. Creating a Period object. We have set the frequency as seconds i.e. ... Read More
AmitDiwan
741 Views
To change the frequency of the given Period object from Seconds to Hourly frequency, use the period.asfreq() method and set the parameter ‘H’.At first, import the required libraries −import pandas as pdThe pandas.Period represents a period of time. Creating a Period object. We have set the frequency as seconds ie. ... Read More
AmitDiwan
553 Views
To change the frequency of the given Period object from Seconds to Daily frequency, use the period.asfreq() method and set the parameter ‘D’.At first, import the required libraries −import pandas as pdThe pandas.Period represents a period of time. Creating a Period object. We have set the frequency as seconds ie. ... Read More
AmitDiwan
602 Views
To convert Period to desired frequency, use the period.asfreq() method. Let’s say we will set to desired Hourly frequency using the ‘H’ specifier.At first, import the required libraries −import pandas as pdThe pandas.Period represents a period of time. Create two Period objectsperiod1 = pd.Period("2020-09-23 03:15:40") period2 = pd.Period(freq="D", year = ... Read More
AmitDiwan
550 Views
To get the year from the Period object, use the period.year property. At first, import the required libraries −import pandas as pdThe pandas.Period represents a period of time. Creating two Period objectsperiod1 = pd.Period("2020-09-23") period2 = pd.Period(freq="D", year = 2021, month = 4, day = 16, hour = 2, minute ... Read More