MCPcopy Create free account
hub / github.com/numpy/numpy / __init__

Method __init__

numpy/core/arrayprint.py:1305–1322  ·  view source on GitHub ↗
(self, x, unit=None, timezone=None, casting='same_kind',
                 legacy=False)

Source from the content-addressed store, hash-verified

1303
1304class DatetimeFormat(_TimelikeFormat):
1305 def __init__(self, x, unit=None, timezone=None, casting='same_kind',
1306 legacy=False):
1307 # Get the unit from the dtype
1308 if unit is None:
1309 if x.dtype.kind == 'M':
1310 unit = datetime_data(x.dtype)[0]
1311 else:
1312 unit = 's'
1313
1314 if timezone is None:
1315 timezone = 'naive'
1316 self.timezone = timezone
1317 self.unit = unit
1318 self.casting = casting
1319 self.legacy = legacy
1320
1321 # must be called after the above are configured
1322 super().__init__(x)
1323
1324 def __call__(self, x):
1325 if self.legacy <= 113:

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected