-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
concat([sparse]) should be a Series / DataFrame #25702
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
Comments
What's the downside to option a? I admittedly don't use these objects a lot but to cast a vote in there that seems more intuitive to me |
For 0.25.0, I want to ensure that pandas only returns a SparseDataFrame if
you're already using them. I hoped we
did that for 0.24.0, but I missed this case apparently.
Option a is a (slightly) larger API-breaking change.
…On Tue, Mar 12, 2019 at 9:51 PM William Ayd ***@***.***> wrote:
What's the downside to option a? I admittedly don't use these objects a
lot but to cast a vote in there that seems more intuitive to me
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#25702 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQHIgQSCvTNXliqdmNCdsjk39dZuGrAks5vWGfCgaJpZM4bsOnJ>
.
|
Note that this only affects DataFrame. In [4]: type(pd.concat([pd.Series(pd.SparseArray([0, 1]))] * 2))
Out[4]: pandas.core.series.Series |
TomAugspurger
added a commit
to TomAugspurger/pandas
that referenced
this issue
Mar 13, 2019
API breaking change to `concat(List[DataFrame[Sparse]])` to return a DataFrame with sparse values, rather than a SparseDataFrame. Doing an outright break, rather than deprecation, because I have a followup PR deprecating SparseDataFrame. We return this internally in a few places (e.g. get_dummies on all-sparse data). Closes pandas-dev#25702
TomAugspurger
added a commit
to TomAugspurger/pandas
that referenced
this issue
Mar 15, 2019
commit 96508ca Author: Tom Augspurger <[email protected]> Date: Wed Mar 13 08:23:21 2019 -0500 API: concat on sparse values API breaking change to `concat(List[DataFrame[Sparse]])` to return a DataFrame with sparse values, rather than a SparseDataFrame. Doing an outright break, rather than deprecation, because I have a followup PR deprecating SparseDataFrame. We return this internally in a few places (e.g. get_dummies on all-sparse data). Closes pandas-dev#25702
jreback
pushed a commit
that referenced
this issue
Mar 19, 2019
API breaking change to `concat(List[DataFrame[Sparse]])` to return a DataFrame with sparse values, rather than a SparseDataFrame. Doing an outright break, rather than deprecation, because I have a followup PR deprecating SparseDataFrame. We return this internally in a few places (e.g. get_dummies on all-sparse data). Closes #25702
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I messed up the logic somewhere along the way.
That should be a DataFrame with sparse values.
When should concat return a SparseSeries/Frame?
a.) When any of the inputs are
SparseSeries
/SparseDataFrame
b.) When all of the inputs are SparseSeries/Frame.
Option b is probably least disruptive. Implementing it isn't a pain.
The text was updated successfully, but these errors were encountered: