MCPcopy
hub / github.com/pandas-dev/pandas / nonzero

Method nonzero

pandas/core/arrays/sparse/array.py:1434–1438  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1432 self.__dict__.update(state)
1433
1434 def nonzero(self) -> tuple[npt.NDArray[np.int32]]:
1435 if self.fill_value == 0:
1436 return (self.sp_index.indices,)
1437 else:
1438 return (self.sp_index.indices[self.sp_values != 0],)
1439
1440 # ------------------------------------------------------------------------
1441 # Reductions

Callers 15

test_nonzeroMethod · 0.95
_period_breakFunction · 0.80
_monthly_finderFunction · 0.80
_quarterly_finderFunction · 0.80
__setitem__Method · 0.80
_sort_mixedFunction · 0.80
nargsortFunction · 0.80
_getitem_bool_arrayMethod · 0.80
_setitem_arrayMethod · 0.80
_set_item_frame_valueMethod · 0.80
_getbool_axisMethod · 0.80

Calls

no outgoing calls

Tested by 5

test_nonzeroMethod · 0.76
fMethod · 0.64