📌  相关文章
📜  Python| Pandas tseries.offsets.CustomBusinessHour.copy(1)

📅  最后修改于: 2023-12-03 15:04:22.377000             🧑  作者: Mango

Python | Pandas tseries.offsets.CustomBusinessHour.copy()

The CustomBusinessHour.copy() function is a method in the pandas library of Python which returns a copy of the CustomBusinessHour object.

Syntax
CustomBusinessHour.copy()
Return Value

This function returns a copy of the CustomBusinessHour object.

Example
import pandas as pd
from pandas.tseries.offsets import CustomBusinessHour

cbh = CustomBusinessHour(start='09:00', end='17:00', weekmask='Mon Tue Wed Thu Fri')

cbh_copy = cbh.copy()

print('Original CustomBusinessHour object:', cbh)
print('Copy of CustomBusinessHour object:', cbh_copy)

Output:

Original CustomBusinessHour object: Custo...
Copy of CustomBusinessHour object: Custo...

In the above example, we have created a CustomBusinessHour object named cbh and then created a copy of it using the copy() method. The output shows that we have successfully copied the CustomBusinessHour object.