পান্ডাসে CustomBusinessHour.start প্রোপার্টি ব্যবহার করে কাস্টম বিজনেস আওয়ারের শুরু সময় (২৪ ঘণ্টা ফরম্যাটে) দেখানো যায়।
প্রক্রিয়া
import pandas as pdtimestamp = pd.Timestamp('2021-11-14 05:20:30')cbhOffset = pd.tseries.offsets.CustomBusinessHour(start="09:30", end="18:00", n=8)- অফসেট যোগ করে আপডেটেড টাইমস্ট্যাম্প দেখুন।
cbhOffset.startদিয়ে স্টার্ট টাইম দেখুন।
উদাহরণ কোড
import pandas as pd
timestamp = pd.Timestamp('2021-11-14 05:20:30')
print("Timestamp...\n", timestamp)
cbhOffset = pd.tseries.offsets.CustomBusinessHour(start="09:30", end="18:00", n=8)
print("\nCustomBusinessHour Offset...\n", cbhOffset)
print("\nUpdated Timestamp...\n", timestamp + cbhOffset)
print("\nThe start time of the custom business hour...\n", cbhOffset.start)
আউটপুট
Timestamp... 2021-11-14 05:20:30 CustomBusinessHour Offset... <8 * CustomBusinessHours: CBH=09:30-18:00> Updated Timestamp... 2021-11-15 17:30:00 The start time of the custom business hour... (datetime.time(9, 30),)