MCPcopy Create free account
hub / github.com/dask/dask / Series

Class Series

dask/dataframe/dask_expr/_collection.py:4132–4682  ·  view source on GitHub ↗

Series-like Expr Collection. The constructor takes the expression that represents the query as input. The class is not meant to be instantiated directly. Instead, use one of the IO connectors from Dask.

Source from the content-addressed store, hash-verified

4130
4131
4132class Series(FrameBase):
4133 """Series-like Expr Collection.
4134
4135 The constructor takes the expression that represents the query as input. The class
4136 is not meant to be instantiated directly. Instead, use one of the IO connectors from
4137 Dask.
4138 """
4139
4140 _accessors: ClassVar[set[str]] = set()
4141 _partition_type = pd.Series
4142
4143 @property
4144 def shape(self):
4145 """
4146 Return a tuple representing the dimensionality of the DataFrame.
4147
4148 The number of rows is a Delayed result. The number of columns
4149 is a concrete integer.
4150 """
4151 return (self.size,)
4152
4153 @property
4154 def axes(self):
4155 return [self.index]
4156
4157 @property
4158 def ndim(self):
4159 """Return dimensionality"""
4160 return 1
4161
4162 @property
4163 def _elemwise(self):
4164 return elemwise
4165
4166 def __dir__(self):
4167 o = set(dir(type(self)))
4168 o.update(self.__dict__)
4169 o.update(set(dir(expr.Expr)))
4170 for accessor in ["cat", "str"]:
4171 if not hasattr(self._meta, accessor):
4172 o.remove(accessor)
4173 return list(o)
4174
4175 def __contains__(self, item):
4176 raise NotImplementedError(
4177 "Using 'in' to test for membership is not supported. Use the values instead"
4178 )
4179
4180 @derived_from(pd.Series)
4181 def __iter__(self):
4182 frame = self.optimize()
4183 for i in range(self.npartitions):
4184 s = frame.get_partition(i).compute()
4185 yield from s
4186
4187 def __getitem__(self, key):
4188 if isinstance(key, Series) or self.npartitions == 1:
4189 return super().__getitem__(key)

Callers 1

test_check_meta_flagFunction · 0.85

Calls 2

CachedAccessorClass · 0.90
setClass · 0.85

Tested by 1

test_check_meta_flagFunction · 0.68