bigframes.pandas.api.typing.DataFrameGroupBy.any#
- DataFrameGroupBy.any() DataFrame[source]#
Return True if any value in the group is true, else False.
Examples:
For SeriesGroupBy:
>>> lst = ['a', 'a', 'b'] >>> ser = bpd.Series([1, 2, 0], index=lst) >>> ser.groupby(level=0).any() a True b False dtype: boolean
For DataFrameGroupBy:
>>> data = [[1, 0, 3], [1, 0, 6], [7, 1, 9]] >>> df = bpd.DataFrame(data, columns=["a", "b", "c"], ... index=["ostrich", "penguin", "parrot"]) >>> df.groupby(by=["a"]).any() b c a 1 False True 7 True True [2 rows x 2 columns]
- Returns:
DataFrame or Series of boolean values, where a value is True if any element is True within its respective group; otherwise False.
- Return type: