Skip to content

DEPR: Enforce Series(float_with_nan, dtype=inty) #49605

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
merged 4 commits into from
Nov 10, 2022

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@mroeschke mroeschke added the Deprecate Functionality to remove in pandas label Nov 9, 2022
@mroeschke mroeschke added this to the 2.0 milestone Nov 10, 2022

def time_frame_transform(self, dtype, method):
self.df.groupby("key").transform(method)

def time_frame_transform_many_nulls(self, dtype, method):
if dtype == "int64":
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, this may cause the benchmark tracking to look odd with the prior benchmark having some finite time to then completing almost instantly.

Could this benchmark be wholly refactored like:

    param_names = ["dtype", "method", "with_nans"]
    params = [
        ["float64", "int64", "Float64", "Int64"],
        ["cummin", "cummax", "cumsum"],
        [True, False]
    ]

    def setup(self, dtype, method, with_nans):
          vals = np.random.randint(-10, 10, (N, 5))
          if with_nans
              if dtype = "int64":
                  raise NotImplementedError
              else:
                  vals = vals.astype(float, copy=True)
                  vals[::2, :] = np.nan
                  vals[::3, :] = np.nan
          ....

    def time_frame_transform(self, dtype, method, with_nans):

Copy link
Member Author

Choose a reason for hiding this comment

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

sure

@mroeschke mroeschke merged commit f81f687 into pandas-dev:main Nov 10, 2022
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the depr-nansafe branch November 10, 2022 22:19
codamuse pushed a commit to codamuse/pandas that referenced this pull request Nov 12, 2022
* DEPR: Enforce Series(float_with_nan, dtype=inty)

* update asv

* troubleshoot asv

* suggested asv edit
mliu08 pushed a commit to mliu08/pandas that referenced this pull request Nov 27, 2022
* DEPR: Enforce Series(float_with_nan, dtype=inty)

* update asv

* troubleshoot asv

* suggested asv edit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants