We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8f25349 commit 52258c4Copy full SHA for 52258c4
pandas/tseries/tests/test_timedeltas.py
@@ -726,6 +726,15 @@ def conv(v):
726
expected = TimedeltaIndex([np.timedelta64(1, 'D')] * 5)
727
tm.assert_index_equal(result, expected)
728
729
+ # Test with bare strings
730
+ expected = pd.to_timedelta(6458920, unit='s')
731
+ result = pd.to_timedelta('6458920', unit='s')
732
+ self.assertEqual(result, expected)
733
+
734
+ # And arrays of strings
735
+ result = pd.to_timedelta(['6458920'], unit='s')[0]
736
737
738
# Test with lists as input when box=false
739
expected = np.array(np.arange(3) * 1000000000, dtype='timedelta64[ns]')
740
result = to_timedelta(range(3), unit='s', box=False)
0 commit comments