@@ -2584,6 +2584,33 @@ def any(self, *, axis=0, bool_only: bool = False):
2584
2584
along a Dataframe axis that is True or equivalent (e.g. non-zero or
2585
2585
non-empty).
2586
2586
2587
+ **Examples:**
2588
+
2589
+ >>> import bigframes.pandas as bpd
2590
+ >>> bpd.options.display.progress_bar = None
2591
+
2592
+ >>> df = bpd.DataFrame({"A": [True, True], "B": [False, False]})
2593
+ >>> df
2594
+ A B
2595
+ 0 True False
2596
+ 1 True False
2597
+ <BLANKLINE>
2598
+ [2 rows x 2 columns]
2599
+
2600
+ Checking if each column contains at least one True element(the default behavior without an explicit axis parameter).
2601
+
2602
+ >>> df.any()
2603
+ A True
2604
+ B False
2605
+ dtype: boolean
2606
+
2607
+ Checking if each row contains at least one True element.
2608
+
2609
+ >>> df.any(axis=1)
2610
+ 0 True
2611
+ 1 True
2612
+ dtype: boolean
2613
+
2587
2614
Args:
2588
2615
axis ({index (0), columns (1)}):
2589
2616
Axis for the function to be applied on.
@@ -2604,6 +2631,33 @@ def all(self, axis=0, *, bool_only: bool = False):
2604
2631
along a DataFrame axis that is False or equivalent (e.g. zero or
2605
2632
empty).
2606
2633
2634
+ **Examples:**
2635
+
2636
+ >>> import bigframes.pandas as bpd
2637
+ >>> bpd.options.display.progress_bar = None
2638
+
2639
+ >>> df = bpd.DataFrame({"A": [True, True], "B": [False, False]})
2640
+ >>> df
2641
+ A B
2642
+ 0 True False
2643
+ 1 True False
2644
+ <BLANKLINE>
2645
+ [2 rows x 2 columns]
2646
+
2647
+ Checking if all values in each column are True(the default behavior without an explicit axis parameter).
2648
+
2649
+ >>> df.all()
2650
+ A True
2651
+ B False
2652
+ dtype: boolean
2653
+
2654
+ Checking across rows to see if all values are True.
2655
+
2656
+ >>> df.all(axis=1)
2657
+ 0 False
2658
+ 1 False
2659
+ dtype: boolean
2660
+
2607
2661
Args:
2608
2662
axis ({index (0), columns (1)}):
2609
2663
Axis for the function to be applied on.
@@ -2620,8 +2674,37 @@ def prod(self, axis=0, *, numeric_only: bool = False):
2620
2674
"""
2621
2675
Return the product of the values over the requested axis.
2622
2676
2677
+ **Examples:**
2678
+
2679
+ >>> import bigframes.pandas as bpd
2680
+ >>> bpd.options.display.progress_bar = None
2681
+
2682
+ >>> df = bpd.DataFrame({"A": [1, 2, 3], "B": [4.5, 5.5, 6.5]})
2683
+ >>> df
2684
+ A B
2685
+ 0 1 4.5
2686
+ 1 2 5.5
2687
+ 2 3 6.5
2688
+ <BLANKLINE>
2689
+ [3 rows x 2 columns]
2690
+
2691
+ Calculating the product of each column(the default behavior without an explicit axis parameter).
2692
+
2693
+ >>> df.prod()
2694
+ A 6.0
2695
+ B 160.875
2696
+ dtype: Float64
2697
+
2698
+ Calculating the product of each row.
2699
+
2700
+ >>> df.prod(axis=1)
2701
+ 0 4.5
2702
+ 1 11.0
2703
+ 2 19.5
2704
+ dtype: Float64
2705
+
2623
2706
Args:
2624
- aßxis ({index (0), columns (1)}):
2707
+ axis ({index (0), columns (1)}):
2625
2708
Axis for the function to be applied on.
2626
2709
For Series this parameter is unused and defaults to 0.
2627
2710
numeric_only (bool. default False):
0 commit comments