MCPcopy
hub / github.com/google/tf-quant-finance / ordinal

Method ordinal

tf_quant_finance/datetime/date_tensor.py:166–178  ·  view source on GitHub ↗

Returns an int32 tensor of ordinals. Ordinal is the number of days since 1st Jan 0001. #### Example ```python dates = tff.datetime.dates_from_tuples([(2019, 3, 25), (1, 1, 1)]) dates.ordinal() # [737143, 1] ```

(self)

Source from the content-addressed store, hash-verified

164 return self._years
165
166 def ordinal(self):
167 """Returns an int32 tensor of ordinals.
168
169 Ordinal is the number of days since 1st Jan 0001.
170
171 #### Example
172
173 ```python
174 dates = tff.datetime.dates_from_tuples([(2019, 3, 25), (1, 1, 1)])
175 dates.ordinal() # [737143, 1]
176 ```
177 """
178 return self._ordinals
179
180 def to_tensor(self):
181 """Packs the dates into a single Tensor.

Callers 15

__init__Method · 0.80
is_business_dayMethod · 0.80
roll_to_business_dayMethod · 0.80
add_business_daysMethod · 0.80
business_days_betweenMethod · 0.80
test_date_subtractionMethod · 0.80

Calls

no outgoing calls