-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: pd.to_datetime, unit='s' much slower for float64 than for int64 #35027
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
jreback
merged 59 commits into
pandas-dev:master
from
arw2019:pd-todatetime-unit_s-float-vs-int
Sep 19, 2020
Merged
Changes from 57 commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
bb56553
add values.dtype.kind==f branch to array_with_unit_datetime
arw2019 de81148
remove unnecessary styling changes
arw2019 9803670
added cast_from_unit definition for float
arw2019 a224e19
to_datetime: added astyping for floats
arw2019 a7bb0d1
revert changes
arw2019 20162fe
revert changes
arw2019 a332e37
revert styling change
arw2019 41f22fa
_libs/tslib.pyx added comments
arw2019 0617b2a
fixed string quotes
arw2019 a501aa0
removed xfail tests
arw2019 9be1567
change _libs/tslib.pyx
arw2019 1030374
revert merge error
arw2019 ea932a9
revert merge error
arw2019 9d47f14
simplified 'if not need_to_iterate' branch
arw2019 a959535
update whatsnew
arw2019 efbd6ba
fixed string quotes
arw2019 859b9a5
removed trailing whitespace
arw2019 a4606a0
rebase tslib.pyx to master
arw2019 1597253
clean up + NPY_NAT->np.nan
arw2019 28397b0
added benchmarks
arw2019 1888681
revert changes to whatsnew
arw2019 ba5d3b5
fixes merge conflicts
arw2019 c6d7746
fixes merge conflicts
arw2019 eb81beb
Merge remote-tracking branch 'upstream/master' into pd-todatetime-uni…
arw2019 7f68448
rewrote cast in analogy to precision_from_unit
arw2019 d9fb88f
use np.isnan for floats
arw2019 b2119b7
revert to fill in mask in final result
arw2019 2c39cd3
fix sas tests
arw2019 64c94fb
rewrite cast, rounding, missing values
arw2019 dd519da
change json test_date_unit
arw2019 5e5976d
Merge remote-tracking branch 'upstream/master' into pd-todatetime-uni…
arw2019 b69df7a
revert changes to tests
arw2019 d37b45c
more refactoring
arw2019 05fab52
switch np.float -> np.float_
arw2019 38a533f
rounding now works
arw2019 b1d8149
rewrite rounding step in array_with_unit_to_datetime
arw2019 a6d8d9e
Update pandas/_libs/tslib.pyx
arw2019 e2e600b
Update pandas/_libs/tslib.pyx
arw2019 c7a3b08
fix typo
arw2019 c0c31ca
silence numpy-dev warning
arw2019 111abb7
Merge remote-tracking branch 'upstream/master' into pd-todatetime-uni…
arw2019 59290a0
feedback
arw2019 611dad0
fix handling of iNaT with astype(float)
arw2019 63fa94b
fix floating point errors in sas datetime test
arw2019 76cd0eb
round floating point error manually in test
arw2019 46f25a4
Merge remote-tracking branch 'upstream/master' into pd-todatetime-uni…
arw2019 b308ba7
add note in whatsnew 1.2
arw2019 1aa7bb2
remove trailing whitespaces
arw2019 a3f42df
fix typo in added benchmark
arw2019 8837ff4
flake8 asv_bench
arw2019 6f9caeb
Merge remote-tracking branch 'upstream/master' into pd-todatetime-uni…
arw2019 1ff89d4
reorder imports
arw2019 8084caf
Merge remote-tracking branch 'upstream/master' into pd-todatetime-uni…
arw2019 c238cec
styling fixes
arw2019 416035b
restore/add comments re: floating point errors
arw2019 47c2b5f
rewrote added benchmark
arw2019 f216a43
typo
arw2019 5f76f48
merge with upstream
arw2019 bb8c35b
feedback
arw2019 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Date1,Date2,DateTime,DateTimeHi,Taiw | ||
1677-09-22,1677-09-22,1677-09-21 00:12:44,1677-09-21 00:12:43.145226,1912-01-01 | ||
1677-09-22,1677-09-22,1677-09-21 00:12:44,1677-09-21 00:12:43.145225,1912-01-01 | ||
1960-01-01,1960-01-01,1960-01-01 00:00:00,1960-01-01 00:00:00.000000,1960-01-01 | ||
2016-02-29,2016-02-29,2016-02-29 23:59:59,2016-02-29 23:59:59.123456,2016-02-29 | ||
2262-04-11,2262-04-11,2262-04-11 23:47:16,2262-04-11 23:47:16.854774,2262-04-11 | ||
2262-04-11,2262-04-11,2262-04-11 23:47:16,2262-04-11 23:47:16.854775,2262-04-11 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does astype of floats directly to M8 work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess it does (as you use it below), but do we have a test specifically for float with unit='ns'?
also can try .astype(..., copy=False)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be better to do, here and below:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll look some more but I think we don't. Will add unless I find one