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

ENH: Add ignore_empty and ignore_all_na arguments to pd.concat #61210

Open
1 of 3 tasks
sergei3000 opened this issue Apr 1, 2025 · 2 comments
Open
1 of 3 tasks

ENH: Add ignore_empty and ignore_all_na arguments to pd.concat #61210

sergei3000 opened this issue Apr 1, 2025 · 2 comments
Assignees
Labels
Enhancement Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@sergei3000
Copy link
Contributor

Feature Type

  • Adding new functionality to pandas

  • Changing existing functionality in pandas

  • Removing existing functionality in pandas

Problem Description

I'd like this warning of pd.concat() be solved with an argument

FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.
    return pd.concat(orders_for_plotting)

Feature Description

I mean instead of changing my code to something like

result = pd.concat([df for df in [df1, df2] if not df.empty])

I think it'd be cool to have arguments like ignore_empty: bool = True and ignore_all_na: bool = True (which would turn into = False in the future) in pd.concat, so I'd be all good by just adding one argument in my codebase to deal with the future behavior.

Alternative Solutions

An alternative solution would be not doing this and making people change their code to keep their legacy stuff intact

Additional Context

No response

@sergei3000 sergei3000 added Enhancement Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 1, 2025
@gsmll
Copy link

gsmll commented Apr 2, 2025

take

@gsmll
Copy link

gsmll commented Apr 3, 2025

In main this is already depreciated, someone else can take over if wanted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

No branches or pull requests

2 participants