w3resource

Pandas Series: sparse.npoints() function

Series-sparse.npoints() function

The number of non- fill_value points.

Syntax:

Series.sparse.npoints
Pandas Series: sparse.npoints() function

Example:

Python-Pandas Code:

import numpy as np
import pandas as pd
s = pd.SparseArray([1, 0, 2, 1, 1], fill_value=0)
s.npoints

Output:

4

Previous: Series-to_latex() function
Next: Series-sparse.density() function



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/pandas/series/series-sparse-npoints.php