@@ -975,6 +975,85 @@ def isin(self, values):
|
975 | 975 | """
|
976 | 976 | raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
|
977 | 977 |
|
| 978 | +def keys(self): |
| 979 | +""" |
| 980 | +Get the 'info axis'. |
| 981 | +
|
| 982 | +This is index for Series, columns for DataFrame. |
| 983 | +
|
| 984 | +Returns: |
| 985 | +Index: Info axis. |
| 986 | +
|
| 987 | +**Examples:** |
| 988 | +
|
| 989 | +>>> import bigframes.pandas as bpd |
| 990 | +>>> bpd.options.display.progress_bar = None |
| 991 | +
|
| 992 | +>>> df = bpd.DataFrame({ |
| 993 | +... 'A': [1, 2, 3], |
| 994 | +... 'B': [4, 5, 6], |
| 995 | +... }) |
| 996 | +>>> df.keys() |
| 997 | +Index(['A', 'B'], dtype='object') |
| 998 | +""" |
| 999 | +raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE) |
| 1000 | + |
| 1001 | +def iterrows(self): |
| 1002 | +""" |
| 1003 | +Iterate over DataFrame rows as (index, Series) pairs. |
| 1004 | +
|
| 1005 | +Yields: |
| 1006 | +a tuple (index, data) where data contains row values as a Series |
| 1007 | +
|
| 1008 | +**Examples:** |
| 1009 | +
|
| 1010 | +>>> import bigframes.pandas as bpd |
| 1011 | +>>> bpd.options.display.progress_bar = None |
| 1012 | +>>> df = bpd.DataFrame({ |
| 1013 | +... 'A': [1, 2, 3], |
| 1014 | +... 'B': [4, 5, 6], |
| 1015 | +... }) |
| 1016 | +>>> index, row = next(df.iterrows()) |
| 1017 | +>>> index |
| 1018 | +0 |
| 1019 | +>>> row |
| 1020 | +A 1 |
| 1021 | +B 4 |
| 1022 | +Name: 0, dtype: object |
| 1023 | +""" |
| 1024 | +raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE) |
| 1025 | + |
| 1026 | +def itertuples(self, index: bool = True, name: str | None = "Pandas"): |
| 1027 | +""" |
| 1028 | +Iterate over DataFrame rows as namedtuples. |
| 1029 | +
|
| 1030 | +Args: |
| 1031 | +index (bool, default True): |
| 1032 | +If True, return the index as the first element of the tuple. |
| 1033 | +name (str or None, default "Pandas"): |
| 1034 | +The name of the returned namedtuples or None to return regular |
| 1035 | +tuples. |
| 1036 | +
|
| 1037 | +Returns: |
| 1038 | +iterator: |
| 1039 | +An object to iterate over namedtuples for each row in the |
| 1040 | +DataFrame with the first field possibly being the index and |
| 1041 | +following fields being the column values. |
| 1042 | +
|
| 1043 | +
|
| 1044 | +**Examples:** |
| 1045 | +
|
| 1046 | +>>> import bigframes.pandas as bpd |
| 1047 | +>>> bpd.options.display.progress_bar = None |
| 1048 | +>>> df = bpd.DataFrame({ |
| 1049 | +... 'A': [1, 2, 3], |
| 1050 | +... 'B': [4, 5, 6], |
| 1051 | +... }) |
| 1052 | +>>> next(df.itertuples(name="Pair")) |
| 1053 | +Pair(Index=0, A=1, B=4) |
| 1054 | +""" |
| 1055 | +raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE) |
| 1056 | + |
978 | 1057 | def items(self):
|
979 | 1058 | """
|
980 | 1059 | Iterate over (column name, Series) pairs.
|
|
0 commit comments