[ Web Proxy ]
URL:
Viewing: https://arrow.apache.org/docs/python/generated/pyarrow.duration.html [Back]  [Original]

pyarrow.duration — Apache Arrow v25.0.1
Back to top
Search the docs ...:

pyarrow.duration#

pyarrow.duration(unit)#

Create instance of a duration type with unit resolution.

Parameters:
unitstr

One of s [second], ms [millisecond], us [microsecond], or ns [nanosecond].

Returns:
typepyarrow.DurationType

Examples

Create an instance of duration type:

>>> import pyarrow as pa
>>> pa.duration('us')
DurationType(duration[us])
>>> pa.duration('s')
DurationType(duration[s])

Create an array with duration type:

>>> pa.array([0, 1, 2], type=pa.duration('s'))
<pyarrow.lib.DurationArray object at ...>
[
  0,
  1,
  2
]

Web Proxy Viewer  |  New URL  |  Original Page