|
35 | 35 | DateTimeDefault,
|
36 | 36 | ExpandingDefault,
|
37 | 37 | GroupByDefault,
|
| 38 | + ListDefault, |
38 | 39 | ResampleDefault,
|
39 | 40 | RollingDefault,
|
40 | 41 | SeriesDefault,
|
41 | 42 | SeriesGroupByDefault,
|
42 | 43 | StrDefault,
|
| 44 | + StructDefault, |
43 | 45 | )
|
44 | 46 | from modin.error_message import ErrorMessage
|
45 | 47 | from modin.logging import ClassLogger
|
@@ -6563,6 +6565,88 @@ def cat_codes(self):
|
6563 | 6565 |
|
6564 | 6566 | # End of Categories methods
|
6565 | 6567 |
|
| 6568 | + # List accessor's methods |
| 6569 | + |
| 6570 | + @doc_utils.add_one_column_warning |
| 6571 | + @doc_utils.add_refer_to("Series.list.flatten") |
| 6572 | + def list_flatten(self): |
| 6573 | + """ |
| 6574 | + Flatten list values. |
| 6575 | +
|
| 6576 | + Returns |
| 6577 | + ------- |
| 6578 | + BaseQueryCompiler |
| 6579 | + """ |
| 6580 | + return ListDefault.register(pandas.Series.list.flatten)(self) |
| 6581 | + |
| 6582 | + @doc_utils.add_one_column_warning |
| 6583 | + @doc_utils.add_refer_to("Series.list.len") |
| 6584 | + def list_len(self): |
| 6585 | + """ |
| 6586 | + Return the length of each list in the Series. |
| 6587 | +
|
| 6588 | + Returns |
| 6589 | + ------- |
| 6590 | + BaseQueryCompiler |
| 6591 | + """ |
| 6592 | + return ListDefault.register(pandas.Series.list.len)(self) |
| 6593 | + |
| 6594 | + @doc_utils.add_one_column_warning |
| 6595 | + @doc_utils.add_refer_to("Series.list.__getitem__") |
| 6596 | + def list__getitem__(self, key): # noqa: PR01 |
| 6597 | + """ |
| 6598 | + Index or slice lists in the Series. |
| 6599 | +
|
| 6600 | + Returns |
| 6601 | + ------- |
| 6602 | + BaseQueryCompiler |
| 6603 | + """ |
| 6604 | + return ListDefault.register(pandas.Series.list.__getitem__)(self, key=key) |
| 6605 | + |
| 6606 | + # End of List accessor's methods |
| 6607 | + |
| 6608 | + # Struct accessor's methods |
| 6609 | + |
| 6610 | + @doc_utils.add_one_column_warning |
| 6611 | + @doc_utils.add_refer_to("Series.struct.dtypes") |
| 6612 | + def struct_dtypes(self): |
| 6613 | + """ |
| 6614 | + Return the dtype object of each child field of the struct. |
| 6615 | +
|
| 6616 | + Returns |
| 6617 | + ------- |
| 6618 | + BaseQueryCompiler |
| 6619 | + """ |
| 6620 | + return StructDefault.register(pandas.Series.struct.dtypes)(self) |
| 6621 | + |
| 6622 | + @doc_utils.add_one_column_warning |
| 6623 | + @doc_utils.add_refer_to("Series.struct.field") |
| 6624 | + def struct_field(self, name_or_index): # noqa: PR01 |
| 6625 | + """ |
| 6626 | + Extract a child field of a struct as a Series. |
| 6627 | +
|
| 6628 | + Returns |
| 6629 | + ------- |
| 6630 | + BaseQueryCompiler |
| 6631 | + """ |
| 6632 | + return StructDefault.register(pandas.Series.struct.field)( |
| 6633 | + self, name_or_index=name_or_index |
| 6634 | + ) |
| 6635 | + |
| 6636 | + @doc_utils.add_one_column_warning |
| 6637 | + @doc_utils.add_refer_to("Series.struct.explode") |
| 6638 | + def struct_explode(self): |
| 6639 | + """ |
| 6640 | + Extract all child fields of a struct as a DataFrame. |
| 6641 | +
|
| 6642 | + Returns |
| 6643 | + ------- |
| 6644 | + BaseQueryCompiler |
| 6645 | + """ |
| 6646 | + return StructDefault.register(pandas.Series.struct.explode)(self) |
| 6647 | + |
| 6648 | + # End of Struct accessor's methods |
| 6649 | + |
6566 | 6650 | # DataFrame methods
|
6567 | 6651 |
|
6568 | 6652 | def invert(self):
|
@@ -6617,6 +6701,13 @@ def compare(self, other, align_axis, keep_shape, keep_equal, result_names):
|
6617 | 6701 | result_names=result_names,
|
6618 | 6702 | )
|
6619 | 6703 |
|
| 6704 | + @doc_utils.add_refer_to("Series.case_when") |
| 6705 | + def case_when(self, caselist): # noqa: PR01, RT01, D200 |
| 6706 | + """ |
| 6707 | + Replace values where the conditions are True. |
| 6708 | + """ |
| 6709 | + return SeriesDefault.register(pandas.Series.case_when)(self, caselist=caselist) |
| 6710 | + |
6620 | 6711 | def repartition(self, axis=None):
|
6621 | 6712 | """
|
6622 | 6713 | Repartitioning QueryCompiler objects to get ideal partitions inside.
|
|
0 commit comments