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

deprecation warning in basic example #1442

Open
fkgruber opened this issue Jan 30, 2025 · 1 comment
Open

deprecation warning in basic example #1442

fkgruber opened this issue Jan 30, 2025 · 1 comment

Comments

@fkgruber
Copy link

Brief Description

Running the basic example gives deprecation warning

System Information

  • Operating system: macOS/Linux/Windows
- lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.6 LTS
Release:	20.04
Codename:	focal
  • Python version (required):
    Python 3.10.14 (main, May 6 2024, 19:42:50) [GCC 11.2.0] on linux

janitor '0.30.0'

Minimally Reproducible Code

import numpy as np
import pandas as pd
import janitor

# Sample Data curated for this example
company_sales = {
    'SalesMonth': ['Jan', 'Feb', 'Mar', 'April'],
    'Company1': [150.0, 200.0, 300.0, 400.0],
    'Company2': [180.0, 250.0, np.nan, 500.0],
    'Company3': [400.0, 500.0, 600.0, 675.0]
}

df = (
    pd.DataFrame.from_dict(company_sales)
    .remove_columns(["Company1"])
    .dropna(subset=["Company2", "Company3"])
    .rename_column("Company2", "Amazon")
    .rename_column("Company3", "Facebook")
    .add_column("Google", [450.0, 550.0, 800.0])
)

Warning Messages

/home/user/.conda/myenv/lib/python3.10/site-packages/pandas_flavor/register.py:157: FutureWarning: This function will be deprecated in a 1.x release. Please use `pd.DataFrame.drop` instead.
  return method(self._obj, *args, **kwargs)
/home/user/.conda/myenv/lib/python3.10/site-packages/pandas_flavor/register.py:157: FutureWarning: This function will be deprecated in a 1.x release. Please use `pd.DataFrame.rename` instead.
  return method(self._obj, *args, **kwargs)
/home/user/.conda/myenv/lib/python3.10/site-packages/pandas_flavor/register.py:157: FutureWarning: This function will be deprecated in a 1.x release. Please use `pd.DataFrame.assign` instead.
  return method(self._obj, *args, **kwargs)
@samukweku
Copy link
Collaborator

@fkgruber thanks for raising an issue. Some of these functions will be deprecated in version 1.9. the warning is meant to give you a heads up. Is there a suggestion or alternative you want to present? The team is happy to receive feedback/ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants