jreback on master
Added paragraph on creating Dat… (compare)
Today I had to use
DataFrame.lookup on a dataframe of +- 1.5 million rows and 30 columns and found it wasn't very performant, then I looked at the code and saw it's a for loop internally.
for i, (r, c) in enumerate(zip(row_labels, col_labels)): result[i] = self._get_value(r, c)
I created my own method with
loc, which performed better:
def lookup(data, col_label): result = data.melt(id_vars=col_label) result = values.loc[values[col_label] == values['variable'], 'value'] return result
Would it be an idea to open a ENH ticket for this? Thought I check it here first.
Deprecation warning should precede extended summary. I tried to move it around in the docstring (starting at the top of the docstring), but still get the error when I try to validate here. I checked some other example where deprecation warning is added, and they look similar to mine. Can someone point me in the right direction here? Thanks
Here's the current
def f(x): if isinstance(x, dict): return x.get(i) elif len(x) > i >= -len(x): return x[i] return np.nan
Can we change it to something like this:
def f(x): try: return x[i] except (KeyError, IndexError): return np.nan
pd.Series.str.get documentation states parameters as:
Parameters: i: int Position of element to extract.
i can be any hashable object right? In the case of dictionaries
i need not necessarily be an
int. Would it be good to change it to
i: hashable object?
import pandas as pd; pd.Timestamp("2019-10-27 02:00:00+02:00", tz="Europe/Warsaw").ceil(freq="1H")erroring out with
pytz.exceptions.AmbiguousTimeError: Cannot infer dst time from 2019-10-27 02:00:00, try using the 'ambiguous' argument? I would expect the
.ceilto be a no-op here. Pandas 1.0.5
For a PR to be merged is it a requirement that all of the Checks pass? Or can a PR be merged with some of the Checks failing?
I ask because some tests are failing on py37_np_dev; looks like they are failing for every PR.
Is it still worth chasing PR for approval/merge while the tests are in this failing state or should we wait til these tests are fixed?
@jreback @WillAyd @rhshadrach I'm sure any one of you could answer.