Skip to content

DOC: Fix mistake in code example #44954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 18, 2021
Merged

DOC: Fix mistake in code example #44954

merged 1 commit into from
Dec 18, 2021

Conversation

huang06
Copy link
Contributor

@huang06 huang06 commented Dec 18, 2021

Location of the documentation

https://pandas.pydata.org/docs/user_guide/timeseries.html#working-with-time-zones

import datetime
import pytz

datetime.datetime(2011, 1, 1, tz=pytz.timezone('US/Eastern'))
TypeError: 'tz' is an invalid keyword argument for this function

Replace tz with tzinfo can fix it.

import datetime
import pytz
datetime.datetime(2011, 1, 1, tzinfo=pytz.timezone('US/Eastern'))
datetime.datetime(2011, 1, 1, 0, 0, tzinfo=<DstTzInfo 'US/Eastern' LMT-1 day, 19:04:00 STD>)

@MarcoGorelli MarcoGorelli added this to the 1.4 milestone Dec 18, 2021
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @huang06

@MarcoGorelli MarcoGorelli merged commit 091c9a0 into pandas-dev:master Dec 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants