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

SparseSeries should have a density attribute #2384

Closed
benjello opened this issue Nov 29, 2012 · 2 comments
Closed

SparseSeries should have a density attribute #2384

benjello opened this issue Nov 29, 2012 · 2 comments
Milestone

Comments

@benjello
Copy link
Contributor

ts = Series(randn(10))
ts[2:-2] = nan
sts = ts.to_sparse()
print sts
print sts.density

AttributeError: 'SparseSeries' object has no attribute 'density'

@changhiskhan
Copy link
Contributor

closed via 95500f0

@benjello
Copy link
Contributor Author

benjello commented Feb 5, 2013

ts = Series(randn(10))
ts[2:-2] = nan
sts = ts.to_sparse()
print sts
print sts.density

yields the following error
return float(len(self.sp_index)) / len(self.index)
TypeError: object of type 'pandas._sparse.BlockIndex' has no len()

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

No branches or pull requests

2 participants