@@ -2597,14 +2597,14 @@ def any(self, *, axis=0, bool_only: bool = False):
2597
2597
<BLANKLINE>
2598
2598
[2 rows x 2 columns]
2599
2599
2600
- Checking if each column contains at least one True element (the default behavior without an explicit axis parameter).
2600
+ Checking if each column contains at least one True element(the default behavior without an explicit axis parameter):
2601
2601
2602
2602
>>> df.any()
2603
2603
A True
2604
2604
B False
2605
2605
dtype: boolean
2606
2606
2607
- Checking if each row contains at least one True element.
2607
+ Checking if each row contains at least one True element:
2608
2608
2609
2609
>>> df.any(axis=1)
2610
2610
0 True
@@ -2644,14 +2644,14 @@ def all(self, axis=0, *, bool_only: bool = False):
2644
2644
<BLANKLINE>
2645
2645
[2 rows x 2 columns]
2646
2646
2647
- Checking if all values in each column are True (the default behavior without an explicit axis parameter).
2647
+ Checking if all values in each column are True(the default behavior without an explicit axis parameter):
2648
2648
2649
2649
>>> df.all()
2650
2650
A True
2651
2651
B False
2652
2652
dtype: boolean
2653
2653
2654
- Checking across rows to see if all values are True.
2654
+ Checking across rows to see if all values are True:
2655
2655
2656
2656
>>> df.all(axis=1)
2657
2657
0 False
@@ -2688,14 +2688,14 @@ def prod(self, axis=0, *, numeric_only: bool = False):
2688
2688
<BLANKLINE>
2689
2689
[3 rows x 2 columns]
2690
2690
2691
- Calculating the product of each column (the default behavior without an explicit axis parameter).
2691
+ Calculating the product of each column(the default behavior without an explicit axis parameter):
2692
2692
2693
2693
>>> df.prod()
2694
2694
A 6.0
2695
2695
B 160.875
2696
2696
dtype: Float64
2697
2697
2698
- Calculating the product of each row.
2698
+ Calculating the product of each row:
2699
2699
2700
2700
>>> df.prod(axis=1)
2701
2701
0 4.5
@@ -2911,11 +2911,37 @@ def skew(self, *, numeric_only: bool = False):
2911
2911
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
2912
2912
2913
2913
def kurt (self , * , numeric_only : bool = False ):
2914
- """Return unbiased kurtosis over requested axis .
2914
+ """Return unbiased kurtosis over columns .
2915
2915
2916
2916
Kurtosis obtained using Fisher's definition of
2917
2917
kurtosis (kurtosis of normal == 0.0). Normalized by N-1.
2918
2918
2919
+ **Examples:**
2920
+
2921
+ >>> import bigframes.pandas as bpd
2922
+ >>> bpd.options.display.progress_bar = None
2923
+
2924
+ >>> df = bpd.DataFrame({"A": [1, 2, 3, 4, 5],
2925
+ ... "B": [3, 4, 3, 2, 1],
2926
+ ... "C": [2, 2, 3, 2, 2]})
2927
+ >>> df
2928
+ A B C
2929
+ 0 1 3 2
2930
+ 1 2 4 2
2931
+ 2 3 3 3
2932
+ 3 4 2 2
2933
+ 4 5 1 2
2934
+ <BLANKLINE>
2935
+ [5 rows x 3 columns]
2936
+
2937
+ Calculating the kurtosis value of each column:
2938
+
2939
+ >>> df.kurt()
2940
+ A -1.2
2941
+ B -0.177515
2942
+ C 5.0
2943
+ dtype: Float64
2944
+
2919
2945
Args:
2920
2946
numeric_only (bool, default False):
2921
2947
Include only float, int, boolean columns.
@@ -2926,10 +2952,36 @@ def kurt(self, *, numeric_only: bool = False):
2926
2952
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
2927
2953
2928
2954
def std (self , * , numeric_only : bool = False ):
2929
- """Return sample standard deviation over requested axis .
2955
+ """Return sample standard deviation over columns .
2930
2956
2931
2957
Normalized by N-1 by default.
2932
2958
2959
+ **Examples:**
2960
+
2961
+ >>> import bigframes.pandas as bpd
2962
+ >>> bpd.options.display.progress_bar = None
2963
+
2964
+ >>> df = bpd.DataFrame({"A": [1, 2, 3, 4, 5],
2965
+ ... "B": [3, 4, 3, 2, 1],
2966
+ ... "C": [2, 2, 3, 2, 2]})
2967
+ >>> df
2968
+ A B C
2969
+ 0 1 3 2
2970
+ 1 2 4 2
2971
+ 2 3 3 3
2972
+ 3 4 2 2
2973
+ 4 5 1 2
2974
+ <BLANKLINE>
2975
+ [5 rows x 3 columns]
2976
+
2977
+ Calculating the standard deviation of each column:
2978
+
2979
+ >>> df.std()
2980
+ A 1.581139
2981
+ B 1.140175
2982
+ C 0.447214
2983
+ dtype: Float64
2984
+
2933
2985
Args:
2934
2986
numeric_only (bool. default False):
2935
2987
Default False. Include only float, int, boolean columns.
@@ -2941,11 +2993,37 @@ def std(self, *, numeric_only: bool = False):
2941
2993
2942
2994
def count (self , * , numeric_only : bool = False ):
2943
2995
"""
2944
- Count non-NA cells for each column or row .
2996
+ Count non-NA cells for each column.
2945
2997
2946
2998
The values `None`, `NaN`, `NaT`, and optionally `numpy.inf` (depending
2947
2999
on `pandas.options.mode.use_inf_as_na`) are considered NA.
2948
3000
3001
+ **Examples:**
3002
+
3003
+ >>> import bigframes.pandas as bpd
3004
+ >>> bpd.options.display.progress_bar = None
3005
+
3006
+ >>> df = bpd.DataFrame({"A": [1, None, 3, 4, 5],
3007
+ ... "B": [1, 2, 3, 4, 5],
3008
+ ... "C": [None, 3.5, None, 4.5, 5.0]})
3009
+ >>> df
3010
+ A B C
3011
+ 0 1.0 1 <NA>
3012
+ 1 <NA> 2 3.5
3013
+ 2 3.0 3 <NA>
3014
+ 3 4.0 4 4.5
3015
+ 4 5.0 5 5.0
3016
+ <BLANKLINE>
3017
+ [5 rows x 3 columns]
3018
+
3019
+ Counting non-NA values for each column:
3020
+
3021
+ >>> df.count()
3022
+ A 4.0
3023
+ B 5.0
3024
+ C 3.0
3025
+ dtype: Float64
3026
+
2949
3027
Args:
2950
3028
numeric_only (bool, default False):
2951
3029
Include only `float`, `int` or `boolean` data.
0 commit comments