Skip to content
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

CLN: BlockManager.apply #29825

Merged
merged 13 commits into from
Dec 1, 2019
Merged

CLN: BlockManager.apply #29825

merged 13 commits into from
Dec 1, 2019

Conversation

jbrockmendel
Copy link
Member

Working on arithmetic, we're going to be sending some functions through BlockManager.apply. This is just cleaning that up a bit as a preliminary.

pandas/core/internals/managers.py Outdated Show resolved Hide resolved
@@ -772,13 +756,15 @@ def copy(self, deep=True):
# this preserves the notion of view copying of axes
if deep:
if deep == "all":
copy = lambda ax: ax.copy(deep=True)
copy_func = lambda ax: ax.copy(deep=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you make this a named function? Same below.

@topper-123 topper-123 added Internals Related to non-user accessible pandas implementation Clean labels Nov 24, 2019
@topper-123 topper-123 added this to the 1.0 milestone Nov 24, 2019
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

lgtm, comment by @topper-123

@jbrockmendel
Copy link
Member Author

rebased+green

@@ -5664,7 +5664,7 @@ def _to_dict_of_blocks(self, copy=True):
for k, v, in self._data.to_dict(copy=copy).items()
}

def astype(self, dtype, copy=True, errors="raise"):
def astype(self, dtype, copy: bool_t = True, errors: str = "raise"):
Copy link
Contributor

Choose a reason for hiding this comment

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

did you mean to use bool_t here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. We can't use bool here because NDFrame defines bool, see note on L142

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, interesting

@jreback jreback merged commit 4bec9c4 into pandas-dev:master Dec 1, 2019
@jreback
Copy link
Contributor

jreback commented Dec 1, 2019

thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the cln-internals branch December 1, 2019 23:37
keechongtan added a commit to keechongtan/pandas that referenced this pull request Dec 2, 2019
…ndexing-1row-df

* upstream/master: (49 commits)
  repr() (pandas-dev#29959)
  DOC : Typo fix in userguide/Styling (pandas-dev#29956)
  CLN: small things in pytables (pandas-dev#29958)
  API/DEPR: Change default skipna behaviour + deprecate numeric_only in Categorical.min and max (pandas-dev#27929)
  DEPR: DTI/TDI/PI constructor arguments (pandas-dev#29930)
  CLN: fix pytables passing too many kwargs (pandas-dev#29951)
  Typing (pandas-dev#29947)
  repr() (pandas-dev#29948)
  repr() (pandas-dev#29950)
  Added space at the end of the sentence (pandas-dev#29949)
  ENH: add NA scalar for missing value indicator, use in StringArray. (pandas-dev#29597)
  CLN: BlockManager.apply (pandas-dev#29825)
  TST: add test for rolling max/min/mean with DatetimeIndex over different frequencies (pandas-dev#29932)
  CLN: explicit signature for to_hdf (pandas-dev#29939)
  CLN: make kwargs explicit for pytables read_ methods (pandas-dev#29935)
  Convert core/indexes/base.py to f-strings (pandas-dev#29903)
  DEPR: dropna multiple axes, fillna int for td64, from_codes with floats, Series.nonzero (pandas-dev#29875)
  CLN: make kwargs explicit in pytables constructors (pandas-dev#29936)
  DEPR: tz_convert in the Timestamp constructor raises (pandas-dev#29929)
  STY: F-strings and repr (pandas-dev#29938)
  ...
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Internals Related to non-user accessible pandas implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants