Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas print nonzero in series

>>> s = pd.Series([0, 3, 0, 4])

>>> s.iloc[s.nonzero()[0]]
1    3
3    4
dtype: int64
Source by pandas.pydata.org #
 
PREVIOUS NEXT
Tagged: #pandas #print #nonzero #series
ADD COMMENT
Topic
Name
6+6 =