コード例 #1
0
 def setUp(self):
     ArkoudaTest.setUp(self)
     self.dtvec1 = ak.date_range(start='2021-01-01 12:00:00', periods=100, freq='s')
     self.dtvec2 = ak.Datetime(pd.date_range('2021-01-01 12:00:00', periods=100, freq='s'))
     self.dtscalar = pd.Timestamp('2021-01-01 12:00:00')
     self.tdvec1 = ak.timedelta_range(start='1 second', end='1 second', periods=100)
     self.tdvec2 = ak.Timedelta(ak.ones(100, dtype=ak.int64), unit='s')
     self.onesecond = pd.Timedelta(1, unit='s')
コード例 #2
0
 def check_equal(pdunit, akunit):
     pdval = pd.Timestamp(1, unit=pdunit)
     akval = ak.Datetime(ak.ones(10, dtype=ak.int64), unit=akunit)[0]
     try:
         self.assertEqual(pdval, akval)
     except AssertionError:
         logging.getLogger().error("pandas {} ({}) != arkouda {} ({})".format(pdunit, pdval, akunit, akval))
     pdval = pd.Timedelta(1, unit=pdunit)
     akval = ak.Timedelta(ak.ones(10, dtype=ak.int64), unit=akunit)[0]
     try:
         self.assertEqual(pdval, akval)
     except AssertionError:
         logging.getLogger().error("pandas {} ({}) != arkouda {} ({})".format(pdunit, pdval, akunit, akval))
コード例 #3
0
 def test_roundtrip(self):
     d = ak.Datetime(self.dtvec1.to_ndarray())
     self.assertTrue((d == self.dtvec1).all())
コード例 #4
0
 def test_noop_creation(self):
     self.assertTrue((ak.Datetime(self.dtvec1) == self.dtvec1).all())
     self.assertTrue((ak.Timedelta(self.tdvec1) == self.tdvec1).all())