Open edschofield opened 7 years ago
nlargest
is not a first class operation on resample, so you need to do this.
In [4]: rain_random.resample('A').apply(lambda x: x.nlargest(3))
Out[4]:
2010-12-31 2010-09-24 0.998530
2010-04-27 0.997371
2010-03-09 0.996582
2011-12-31 2011-11-30 0.999936
2011-02-20 0.997470
2011-01-17 0.992270
2012-12-31 2012-07-23 0.999762
2012-06-20 0.998130
2012-02-25 0.998010
dtype: float64
@jreback @sinhrks The bug is not reproducible now:
In [14]: rain_random.resample('A').nlargest(3)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-14-ec29cc197ee8> in <module>()
----> 1 rain_random.resample('A').nlargest(3)
/Users/discort/python/fun/pandas/pandas/core/resample.py in __getattr__(self, attr)
96 return self[attr]
97
---> 98 return object.__getattribute__(self, attr)
99
100 def __iter__(self):
AttributeError: 'DatetimeIndexResampler' object has no attribute 'nlargest'
I am using pandas version 1.0.1 and rain_random.resample('A').nlargest(3)
is still not working. Hope this function is added in the following updates.
AttributeError Traceback (most recent call last)
<ipython-input-102-7057e1436432> in <module>
----> 1 rain_random.resample('A').nlargest(3)
~\anaconda3\lib\site-packages\pandas\core\resample.py in __getattr__(self, attr)
105 return self[attr]
106
--> 107 return object.__getattribute__(self, attr)
108
109 def __iter__(self):
AttributeError: 'DatetimeIndexResampler' object has no attribute 'nlargest'
pull requests are accepted; this is how issues get addressed in open source
pull requests are accepted; this is how issues get addressed in open source
May I ask what you mean by "this is how issues get addressed in open source?"
pandas and virtually all open source project are all volunteer
the core team will review pull requests
since there are 3000+ open issue most patches must come from the community
issues get fixed when folks like you open pull requests
pandas and virtually all open source project are all volunteer
the core team will review pull requests
since there are 3000+ open issue most patches must come from the community
issues get fixed when folks like you open pull requests
Yeah I know that Pandas is an open-source project. But regarding this issue resample('D').nlargest(3)
, I cannot see neither the assignees nor linked pull requests, which can be found on the right side of this webpage. So I was curious to know what you meant by "pull requests are accepted".
And since this issue was raised about 2 years and a half ago, I just wanted to point out that this has not been resolved yet. So it made me puzzle a little bit when you said "this is how issues get addressed in open source".
there are no assignees (who would we assign?)
and PRs would be linked to the issue
that’s the point here - no one has submitted anything
you or anyone else are welcome to do so
in this or any other issue
noting that something is not done is not that helpful - the issue is marked open
what IS helpful is submitting changes / examples / tests
there are no assignees (who would we assign?)
and PRs would be linked to the issue
that’s the point here - no one has submitted anything
you or anyone else are welcome to do so
in this or any other issue
noting that something is not done is not that helpful - the issue is marked open
what IS helpful is submitting changes / examples / tests
Now I can see why your replies have been sour. I am new to this pandas-dev zone, so if it is rude to report an old issue once again, I would like to apologize. You don't need to be sulky like that either because that IS NOT helpful either, right? Good day
@hellojinwoo thanks for the apology
we have been getting the: why has this x year old issue not been resolved
many times
and to be honest it’s very rude of folks to do this but i guess new folks just don’t realize this so ok
people work extremely hard in open source and volunteer much time - yet continued comments like this (and to be clear i am not calling you out at all) cause burnout for this thankless task
so thank you for commenting in the issue as i said above - if you would like to help out great
Code Sample, a copy-pastable example if possible
With this setup:
these two operations given different results:
Problem description
The
Series.resample().nlargest()
operation is inconsistent withDataFrame.resample()[column].nlargest()
and thegroupby
equivalent. It emits a warningOutput:
Expected output: