-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
ENH: support of pandas.DataFrame.hist for datetime data #36287
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 18 commits into
pandas-dev:master
from
onshek:issue32590-Histogram-or-kde-from-datetime-column
Oct 10, 2020
Merged
Changes from 4 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
e8989e6
ENH: support of pandas.DataFrame.hist for datetime data
onshek ed86887
Revert "ENH: support of pandas.DataFrame.hist for datetime data"
onshek 9dc96cf
ENH: support of pandas.DataFrame.hist for datetime data
onshek 602c59b
REF: reformat imports
onshek 17c182f
UPD: changed as requested
onshek aad3433
Merge branch 'master' into issue32590-Histogram-or-kde-from-datetime-…
onshek 2cfc979
FIX: recover whatsnew note v1.2.0
onshek 7569a31
UPD: delete an extra line
onshek 35cccd6
UPD: explicit is better than implicit
onshek bd7f450
UPD: hist support for type of datetime64 and datetimetz
onshek 731f097
Merge branch 'master' into issue32590-Histogram-or-kde-from-datetime-…
onshek 3a99250
UPD: modify and reformat related tests
onshek e9fa7ec
UPD: reformat code
onshek 1c098c8
Merge branch 'master' into issue32590-Histogram-or-kde-from-datetime-…
onshek b24df4d
UPD: focus on main issues
onshek b02c017
UPD: recover # GH 9351
onshek 315d77e
UPD: recover a blank line
onshek c8c7460
UPD: reformat the blank line
onshek 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
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.
should only
datetime
type be included? what abouttimedelta
? could you pls check iftimedelta
should also be supported?if so you could do something like:
or you could even do
then probably you could avoid using
data._get_numeric_data()
andconcat
.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.
Agree with the first point.
Would it be ok to use
np.number
instead of_get_numeric_data()
? I'm not sure about this.I'll have a check on both.
Uh oh!
There was an error while loading. Please reload this page.
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.
@charlesdong1991 @jreback
timedelta
is not supported even inpd.Series.hist
but, we can convert bothtimedelta
anddatetime[ns]
intonp.int64
then keep originaldata=data._get_numeric_data()
.As to the second point, this minimal exsample shows
df.select_dtypes(include=np.number)
diffs fromdf._get_numeric_data()
:Any thought?
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.
yeah,
timedelta
is treated as numbers since it represents interval, probably_get_numeric_data
does some other processingss to filter them out, then I think you could keep_get_numeric_data
andconcat
in this PR!