SparseSeries should have a density attribute #2384

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

Comments

Projects
None yet
2 participants
Contributor

benjello commented Nov 29, 2012

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

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

Contributor

changhiskhan commented Nov 29, 2012

closed via 95500f0

Contributor

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()

benjello referenced this issue in openfisca/openfisca-core Feb 28, 2014

Closed

Better handling of memory usage #92

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