2
2
3
3
from typing import Any ,NoReturn , Sequence , TYPE_CHECKING , Literal , Generic
4
4
5
- from ._types import DType
5
+ from ._types import DTypeT
6
6
7
7
if TYPE_CHECKING :
8
8
from . import Bool , null
12
12
__all__ = ['Column' ]
13
13
14
14
15
- class Column (Generic [DType ]):
15
+ class Column (Generic [DTypeT ]):
16
16
"""
17
17
Column object
18
18
@@ -81,7 +81,7 @@ def dtype(self) -> Any:
81
81
Return data type of column.
82
82
"""
83
83
84
- def get_rows (self : Column [DType ], indices : Column [Any ]) -> Column [DType ]:
84
+ def get_rows (self : Column [DTypeT ], indices : Column [Any ]) -> Column [DTypeT ]:
85
85
"""
86
86
Select a subset of rows, similar to `ndarray.take`.
87
87
@@ -157,7 +157,7 @@ def __eq__(self, other: Column[Any] | Scalar) -> Column[Bool]: # type: ignore[o
157
157
Column
158
158
"""
159
159
160
- def __ne__ (self : Column [DType ], other : Column [DType ] | Scalar ) -> Column [Bool ]: # type: ignore[override]
160
+ def __ne__ (self : Column [DTypeT ], other : Column [DTypeT ] | Scalar ) -> Column [Bool ]: # type: ignore[override]
161
161
"""
162
162
Compare for non-equality.
163
163
@@ -175,7 +175,7 @@ def __ne__(self: Column[DType], other: Column[DType] | Scalar) -> Column[Bool]:
175
175
Column
176
176
"""
177
177
178
- def __ge__ (self : Column [DType ], other : Column [DType ] | Scalar ) -> Column [Bool ]:
178
+ def __ge__ (self : Column [DTypeT ], other : Column [DTypeT ] | Scalar ) -> Column [Bool ]:
179
179
"""
180
180
Compare for "greater than or equal to" `other`.
181
181
@@ -191,7 +191,7 @@ def __ge__(self: Column[DType], other: Column[DType] | Scalar) -> Column[Bool]:
191
191
Column
192
192
"""
193
193
194
- def __gt__ (self : Column [DType ], other : Column [DType ] | Scalar ) -> Column [Bool ]:
194
+ def __gt__ (self : Column [DTypeT ], other : Column [DTypeT ] | Scalar ) -> Column [Bool ]:
195
195
"""
196
196
Compare for "greater than" `other`.
197
197
@@ -207,7 +207,7 @@ def __gt__(self: Column[DType], other: Column[DType] | Scalar) -> Column[Bool]:
207
207
Column
208
208
"""
209
209
210
- def __le__ (self : Column [DType ], other : Column [DType ] | Scalar ) -> Column [Bool ]:
210
+ def __le__ (self : Column [DTypeT ], other : Column [DTypeT ] | Scalar ) -> Column [Bool ]:
211
211
"""
212
212
Compare for "less than or equal to" `other`.
213
213
@@ -223,7 +223,7 @@ def __le__(self: Column[DType], other: Column[DType] | Scalar) -> Column[Bool]:
223
223
Column
224
224
"""
225
225
226
- def __lt__ (self : Column [DType ], other : Column [DType ] | Scalar ) -> Column [Bool ]:
226
+ def __lt__ (self : Column [DTypeT ], other : Column [DTypeT ] | Scalar ) -> Column [Bool ]:
227
227
"""
228
228
Compare for "less than" `other`.
229
229
@@ -527,26 +527,26 @@ def var(self, *, correction: int | float = 1, skip_nulls: bool = True) -> Scalar
527
527
Whether to skip null values.
528
528
"""
529
529
530
- def cumulative_max (self : Column [DType ]) -> Column [DType ]:
530
+ def cumulative_max (self : Column [DTypeT ]) -> Column [DTypeT ]:
531
531
"""
532
532
Reduction returns a Column. Any data type that supports comparisons
533
533
must be supported. The returned value has the same dtype as the column.
534
534
"""
535
535
536
- def cumulative_min (self : Column [DType ]) -> Column [DType ]:
536
+ def cumulative_min (self : Column [DTypeT ]) -> Column [DTypeT ]:
537
537
"""
538
538
Reduction returns a Column. Any data type that supports comparisons
539
539
must be supported. The returned value has the same dtype as the column.
540
540
"""
541
541
542
- def cumulative_sum (self : Column [DType ]) -> Column [DType ]:
542
+ def cumulative_sum (self : Column [DTypeT ]) -> Column [DTypeT ]:
543
543
"""
544
544
Reduction returns a Column. Must be supported for numerical and
545
545
datetime data types. The returned value has the same dtype as the
546
546
column.
547
547
"""
548
548
549
- def cumulative_prod (self : Column [DType ]) -> Column [DType ]:
549
+ def cumulative_prod (self : Column [DTypeT ]) -> Column [DTypeT ]:
550
550
"""
551
551
Reduction returns a Column. Must be supported for numerical and
552
552
datetime data types. The returned value has the same dtype as the
@@ -591,7 +591,7 @@ def is_nan(self) -> Column[Bool]:
591
591
In particular, does not check for `np.timedelta64('NaT')`.
592
592
"""
593
593
594
- def is_in (self : Column [DType ], values : Column [DType ]) -> Column [Bool ]:
594
+ def is_in (self : Column [DTypeT ], values : Column [DTypeT ]) -> Column [Bool ]:
595
595
"""
596
596
Indicate whether the value at each row matches any value in `values`.
597
597
@@ -630,7 +630,7 @@ def unique_indices(self, *, skip_nulls: bool = True) -> Column[Any]:
630
630
"""
631
631
...
632
632
633
- def fill_nan (self : Column [DType ], value : float | 'null' , / ) -> Column [DType ]:
633
+ def fill_nan (self : Column [DTypeT ], value : float | 'null' , / ) -> Column [DTypeT ]:
634
634
"""
635
635
Fill floating point ``nan`` values with the given fill value.
636
636
@@ -644,7 +644,7 @@ def fill_nan(self: Column[DType], value: float | 'null', /) -> Column[DType]:
644
644
"""
645
645
...
646
646
647
- def fill_null (self : Column [DType ], value : Scalar , / ) -> Column [DType ]:
647
+ def fill_null (self : Column [DTypeT ], value : Scalar , / ) -> Column [DTypeT ]:
648
648
"""
649
649
Fill null values with the given fill value.
650
650
0 commit comments