Answers for "pandas print nonzero in series"

0

pandas print nonzero in series

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

>>> s.iloc[s.nonzero()[0]]
1    3
3    4
dtype: int64
Posted by: Guest on September-02-2021

Python Answers by Framework

Browse Popular Code Answers by Language