Skip to content

DOC: add note about the values of unit for pd.to_datetime #34899

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 2 commits into from
Jun 20, 2020

Conversation

aidanmontare-edu
Copy link
Contributor

The unit option for pandas.to_datetime takes different format strings than the format option,
which makes sense, but caught me off-guard as a new user. It would be helpful if the documentation
mentioned this.

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

@@ -319,6 +319,11 @@ which can be specified. These are computed from the starting point specified by
pd.to_datetime([1349720105100, 1349720105200, 1349720105300,
1349720105400, 1349720105500], unit='ms')

.. note::

The strings used to specify a ``unit`` are not the same are those by ``format``.
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not really sure what format refers to here, can you clarify

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! I'm talking about the "%Y-%M-%D" -type strings. Is the new commit clearer?

@jreback jreback added Docs Datetime Datetime data dtype labels Jun 20, 2020
@jreback jreback added this to the 1.1 milestone Jun 20, 2020
@jreback
Copy link
Contributor

jreback commented Jun 20, 2020

k looks reasonable

@jreback jreback merged commit 0d9b57f into pandas-dev:master Jun 20, 2020
@jreback
Copy link
Contributor

jreback commented Jun 20, 2020

thanks @aidanmontare-edu

@aidanmontare-edu
Copy link
Contributor Author

aidanmontare-edu commented Jun 20, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants