Skip to main content
Version: Python

to_np_busdaycalendar

The to_np_busdaycalendar method creates a numpy.busdaycalendar from a Java BusinessCalendar.

note

Partial holidays in the business calendar are interpreted as full holidays in the numpy business day calendar.

Syntax

to_np_busdaycalendar(
cal: BusinessCalendar,
include_partial: bool = True
) -> numpy.busdaycalendar

Parameters

ParameterTypeDescription
calBusinessCalendar

The Java BusinessCalendar to convert to a numpy.busdaycalendar.

include_partial optionalbool

Whether to include partial holidays in the NumPy business day calendar. Default is True.

Returns

A numpy.busdaycalendar from the given Java BusinessCalendar.

Examples

The following example creates a Java BusinessCalendar and converts it to a numpy.busdaycalendar.

from deephaven.calendar import calendar
from deephaven.numpy import to_np_busdaycalendar

cal = calendar()

result = to_np_busdaycalendar(cal)

print(type(result))