
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
Found 26504 Articles for Server Side Programming

309 Views
We are given an array string of words of any given size and the task is to break the words in all possible ways such that after the break the string formed should be a valid string and we have to calculate all such minimum word break as per the problem.Let us see various input output scenarios for this -In − string word[] = {"Hello", "Hell", "tell", "well", "bell", "ball", "all" }Out − Minimum Word Break is: 1Explanation − we are given with multiple words. Now we will pass the concatenation of two strings i.e. Hell and all and will break the concatenated ... Read More

98 Views
To return the name of the frequency applied on the given CustomBusinessHour offset object, use the CustomBusinessHour.name property in Pandas.At first, import the required libraries −import pandas as pdSet the timestamp object in Pandas −timestamp = pd.Timestamp('2021-10-25 08:35:10') Create the CustomBusinessHour Offset. CustomBusinessHour is the DateOffset subclass −cbhOffset = pd.tseries.offsets.CustomBusinessHour(n = 3, weekmask = 'Mon Tue Wed Fri Sat')Add the offset to the Timestamp and display the Updated Timestamp −print("Updated Timestamp...", timestamp + cbhOffset) Return the name of the frequency applied on the given CustomBusinessHour object −print("The name of the frequency on the CustomBusinessHour object..", cbhOffset.name)ExampleFollowing is the code −import ... Read More

128 Views
To display the keyword arguments applied on the given CustomBusinessHour object, use the CustomBusinessHour.kwds property in Pandas.At first, import the required libraries −import pandas as pdSet the timestamp object in Pandas −timestamp = pd.Timestamp('2021-10-25 08:35:10') Create the CustomBusinessHour Offset −cbhOffset = pd.tseries.offsets.CustomBusinessHour(n = 3, weekmask = 'Mon Tue Wed Fri Sat')Add the offset to the Timestamp and display the Updated Timestamp −print("Updated Timestamp...", timestamp + cbhOffset) Display the keyword arguments −print("Keyword arguments on the given CustomBusinessHour Offset...", cbhOffset.kwds)ExampleFollowing is the code −import pandas as pd # Set the timestamp object in Pandas timestamp = pd.Timestamp('2021-10-25 08:35:10') # Display ... Read More

4K+ Views
A line connects two points. It is a basic element in graphics. To draw a line, you need two points between which you can draw a line on a screen and in terms of graphics we refer to the points as pixels and every pixel is associated with integer coordinates. We are given integer coordinates in the form of (x1, y1) and (x2, y2) where, x1 < x2 and y1 < y2. The task is to calculate all the mid-points between point 1 i.e. (x1, y1) and point 2 i.e. (x2, y2) using the Midpoint Line Generation Algorithm.There are three ... Read More

93 Views
To return frequency applied on the given CustomBusinessHour Offset object as a string, use the CustomBusinessHour.freqstr property in Pandas.At first, import the required libraries −import pandas as pdSet the timestamp object in Pandas −timestamp = pd.Timestamp('2021-10-25 08:35:10') Create the CustomBusinessHour Offset −cbhOffset = pd.tseries.offsets.CustomBusinessHour(n = 3, weekmask = 'Mon Tue Wed Fri')Add the offset to the Timestamp and display the Updated Timestamp −print("Updated Timestamp...", timestamp + cbhOffset) Return frequency applied on the given CustomBusinessHour Offset object as a string −print("Frequency applied on the given CustomBusinessHour Offset object...", cbhOffset.freqstr)ExampleFollowing is the code −import pandas as pd # Set the timestamp ... Read More

117 Views
To roll provided date backward, use the CustomBusinessHour.rollback() method in Pandas. At first, import the required libraries −import pandas as pdSet the timestamp object in Pandas −timestamp = pd.Timestamp('2021-12-20 08:35:10') Create the CustomBusinessHour Offset. CustomBusinessHour is the DateOffset subclass −cbhOffset = pd.tseries.offsets.CustomBusinessHour(n = 5, weekmask = 'Mon Tue Wed Fri')Add the offset to the Timestamp and display the Updated Timestamp −print("Updated Timestamp...", timestamp + cbhOffset) Roll backward if not on offset −roll_back = cbhOffset.rollback(pd.Timestamp('2021-12-18 08:35:10'))Display the result −print("Roll Backward Result...", roll_back) ExampleFollowing is the code −import pandas as pd # Set the timestamp object in Pandas timestamp = pd.Timestamp('2021-12-20 ... Read More

102 Views
To move to the next business day, use the CustomBusinessHour.next_bday property in Pandas. At first, import the required libraries −import pandas as pdSet the timestamp object in Pandas −timestamp = pd.Timestamp('2021-12-20 08:35:10') Create the CustomBusinessHour Offset. CustomBusinessHour is the DateOffset subclass −cbhOffset = pd.tseries.offsets.CustomBusinessHour(start ='09:30', end ='18:00', n = 5, weekmask = 'Mon Tue Wed Fri')Display the CustomBusinessHour Offset −print("CustomBusinessHour Offset...", cbhOffset) Display the next business day −print("The next business day...", timestamp + cbhOffset.next_bday)ExampleFollowing is the code −import pandas as pd # Set the timestamp object in Pandas timestamp = pd.Timestamp('2021-12-20 08:35:10') # Display the Timestamp print("Timestamp...", timestamp) ... Read More

218 Views
To roll provided date forward to next offset only if not on offset, use the CustomBusinessHour.rollforward() method in Pandas.At first, import the required libraries −import pandas as pdSet the timestamp object in Pandas −timestamp = pd.Timestamp('2021-12-20 08:35:10') Create the CustomBusinessHour Offset. CustomBusinessHour is the DateOffset subclass. Weekmask of valid business days −cbhOffset = pd.tseries.offsets.CustomBusinessHour(n = 5, weekmask = 'Mon Tue Wed Fri')Add the offset to the Timestamp and display the Updated Timestamp −print("Updated Timestamp...", timestamp + cbhOffset) Roll forward if not on offset −roll = cbhOffset.rollforward(pd.Timestamp('2021-12-30 08:35:10'))Display the result −print("Roll forward Result...", roll) ExampleFollowing is the code −import pandas as ... Read More

157 Views
To create a CustomBusinessHour object, use the pandas.tseries.offsets.CustomBusinessHour() method in Pandas.At first, import the required libraries −import pandas as pdSet the timestamp object in Pandas −timestamp = pd.Timestamp('2021-12-31 08:35:10') Create the CustomBusinessHour Offset. CustomBusinessHour is the DateOffset subclass. Weekmask of valid business days −cbhOffset = pd.tseries.offsets.CustomBusinessHour(n = 5, weekmask = 'Mon Tue Wed Fri')Display the CustomBusinessHour Offset −print("CustomBusinessHour Offset...", cbhOffset) Add the offset to the Timestamp and display the Updated Timestamp −print("Updated Timestamp...", timestamp + cbhOffset)ExampleFollowing is the code −import pandas as pd # Set the timestamp object in Pandas timestamp = pd.Timestamp('2021-12-31 08:35:10') # Display the Timestamp ... Read More

201 Views
To get the weekmask applied on the CustomBusinessDay offset, use the CustomBusinessDay.weekmask property in Pandas.At first, import the required libraries −import pandas as pdSet the timestamp object in Pandas −timestamp = pd.Timestamp('2021-10-22 03:10:35') Create the CustomBusinessDay Offset. CustomBusinessDay is the DateOffset subclass representing custom business days excluding holidays. Weekmask of valid business days −cbdOffset = pd.tseries.offsets.CustomBusinessDay(n = 4, weekmask = 'Mon Tue Wed Fri')Add the offset to the Timestamp and display the Updated Timestamp −print("Updated Timestamp...", timestamp + cbdOffset) Display the weekmask −print("The weekmask on the CustomBusinessDay object..", cbdOffset.weekmask)ExampleFollowing is the code −import pandas as pd # Set the ... Read More