tf_quant_finance.datetime.utils.year_month_day_to_ordinal

Contents

Last updated: 2023-03-16.

tf_quant_finance.datetime.utils.year_month_day_to_ordinal#

View source

Calculates ordinals Tensor given years, months and dates.

tf_quant_finance.datetime.utils.year_month_day_to_ordinal(
    year, month, day
)

Args:#

  • year: Tensor of int32 type. Elements should be positive.

  • month: Tensor of int32 type of same shape as year. Elements should be in range [1, 12].

  • day: Tensor of int32 type of same shape as year. Elements should be in range [1, 31] and represent valid dates together with corresponding elements of month and year Tensors.

Returns:#

Tensor of int32 type. Each element is number of days since 1 Jan 0001. 1 Jan 0001 has ordinal = 1.