pandas.DataFrame.tz_convert

pandas 3.1.1 · DataFrame · method

Express timezone-aware data in another zone while keeping the same instants.

Call syntax

DataFrame.tz_convert(tz, axis=0, level=None, copy=…)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
tz Required
Positional or keyword
str or tzinfo object or None

Supply a timezone name or timezone object.

axis Optional
Positional or keyword
Default 0
{0 or 'index', 1 or 'columns'}

Choose which axis the operation acts on. The accepted axis labels depend on the receiver.

level Optional
Positional or keyword
Default None
int, str

Choose an index level by name or integer position.

copy Optional
Positional or keyword
bool

Control whether data is copied where the API supports that choice.

Returns

Series/DataFrame