MCPcopy Index your code
hub / github.com/dask/dask / value_counts

Method value_counts

dask/dataframe/dask_expr/_collection.py:4271–4301  ·  view source on GitHub ↗
(
        self,
        sort=None,
        ascending=False,
        dropna=True,
        normalize=False,
        split_every=None,
        split_out=no_default,
    )

Source from the content-addressed store, hash-verified

4269
4270 @derived_from(pd.Series)
4271 def value_counts(
4272 self,
4273 sort=None,
4274 ascending=False,
4275 dropna=True,
4276 normalize=False,
4277 split_every=None,
4278 split_out=no_default,
4279 ):
4280 if split_out is no_default:
4281 if isinstance(self.dtype, CategoricalDtype):
4282 # unobserved or huge categories will lead to oom errors
4283 if self.cat.known:
4284 split_out = 1 + len(self.dtype.categories) // 100_000
4285 else:
4286 split_out = True
4287 else:
4288 split_out = True
4289 if split_out == 1 and split_out is not True and sort is None:
4290 sort = True
4291
4292 length = None
4293 if (split_out > 1 or split_out is True) and normalize:
4294 frame = self if not dropna else self.dropna()
4295 length = Len(frame)
4296
4297 return new_collection(
4298 ValueCounts(
4299 self, sort, ascending, dropna, normalize, split_every, split_out, length
4300 )
4301 )
4302
4303 @derived_from(pd.Series)
4304 def mode(self, dropna=True, split_every=False):

Callers 15

assert_eq_dtypesFunction · 0.45
_value_countsFunction · 0.45
_metaMethod · 0.45
infoMethod · 0.45
test_value_countsFunction · 0.45
test_value_countsFunction · 0.45
test_value_counts_sortFunction · 0.45

Calls 4

dropnaMethod · 0.95
LenClass · 0.90
new_collectionFunction · 0.90
ValueCountsClass · 0.90