@@ -2852,6 +2852,33 @@ def sum(self, axis=0, *, numeric_only: bool = False):
2852
2852
def mean (self , axis = 0 , * , numeric_only : bool = False ):
2853
2853
"""Return the mean of the values over the requested axis.
2854
2854
2855
+ **Examples:**
2856
+
2857
+ >>> import bigframes.pandas as bpd
2858
+ >>> bpd.options.display.progress_bar = None
2859
+
2860
+ >>> df = bpd.DataFrame({"A": [1, 3], "B": [2, 4]})
2861
+ >>> df
2862
+ A B
2863
+ 0 1 2
2864
+ 1 3 4
2865
+ <BLANKLINE>
2866
+ [2 rows x 2 columns]
2867
+
2868
+ Calculating the mean of each column (the default behavior without an explicit axis parameter).
2869
+
2870
+ >>> df.mean()
2871
+ A 2.0
2872
+ B 3.0
2873
+ dtype: Float64
2874
+
2875
+ Calculating the mean of each row.
2876
+
2877
+ >>> df.mean(axis=1)
2878
+ 0 1.5
2879
+ 1 3.5
2880
+ dtype: Float64
2881
+
2855
2882
Args:
2856
2883
axis ({index (0), columns (1)}):
2857
2884
Axis for the function to be applied on.
@@ -2865,7 +2892,27 @@ def mean(self, axis=0, *, numeric_only: bool = False):
2865
2892
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
2866
2893
2867
2894
def median (self , * , numeric_only : bool = False , exact : bool = False ):
2868
- """Return the median of the values over the requested axis.
2895
+ """Return the median of the values over colunms.
2896
+
2897
+ **Examples:**
2898
+
2899
+ >>> import bigframes.pandas as bpd
2900
+ >>> bpd.options.display.progress_bar = None
2901
+
2902
+ >>> df = bpd.DataFrame({"A": [1, 3], "B": [2, 4]})
2903
+ >>> df
2904
+ A B
2905
+ 0 1 2
2906
+ 1 3 4
2907
+ <BLANKLINE>
2908
+ [2 rows x 2 columns]
2909
+
2910
+ Finding the median value of each column.
2911
+
2912
+ >>> df.median()
2913
+ A 1.0
2914
+ B 2.0
2915
+ dtype: Float64
2869
2916
2870
2917
Args:
2871
2918
numeric_only (bool. default False):
@@ -2884,6 +2931,34 @@ def var(self, axis=0, *, numeric_only: bool = False):
2884
2931
2885
2932
Normalized by N-1 by default.
2886
2933
2934
+ **Examples:**
2935
+
2936
+ >>> import bigframes.pandas as bpd
2937
+ >>> bpd.options.display.progress_bar = None
2938
+
2939
+ >>> df = bpd.DataFrame({"A": [1, 3], "B": [2, 4]})
2940
+ >>> df
2941
+ A B
2942
+ 0 1 2
2943
+ 1 3 4
2944
+ <BLANKLINE>
2945
+ [2 rows x 2 columns]
2946
+
2947
+ Calculating the variance of each column (the default behavior without an explicit axis parameter).
2948
+
2949
+ >>> df.var()
2950
+ A 2.0
2951
+ B 2.0
2952
+ dtype: Float64
2953
+
2954
+ Calculating the variance of each row.
2955
+
2956
+ >>> df.var(axis=1)
2957
+ 0 0.5
2958
+ 1 0.5
2959
+ dtype: Float64
2960
+
2961
+
2887
2962
Args:
2888
2963
axis ({index (0), columns (1)}):
2889
2964
Axis for the function to be applied on.
@@ -2897,10 +2972,36 @@ def var(self, axis=0, *, numeric_only: bool = False):
2897
2972
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
2898
2973
2899
2974
def skew (self , * , numeric_only : bool = False ):
2900
- """Return unbiased skew over requested axis .
2975
+ """Return unbiased skew over columns .
2901
2976
2902
2977
Normalized by N-1.
2903
2978
2979
+ **Examples:**
2980
+
2981
+ >>> import bigframes.pandas as bpd
2982
+ >>> bpd.options.display.progress_bar = None
2983
+
2984
+ >>> df = bpd.DataFrame({'A': [1, 2, 3, 4, 5],
2985
+ ... 'B': [5, 4, 3, 2, 1],
2986
+ ... 'C': [2, 2, 3, 2, 2]})
2987
+ >>> df
2988
+ A B C
2989
+ 0 1 5 2
2990
+ 1 2 4 2
2991
+ 2 3 3 3
2992
+ 3 4 2 2
2993
+ 4 5 1 2
2994
+ <BLANKLINE>
2995
+ [5 rows x 3 columns]
2996
+
2997
+ Calculating the skewness of each column.
2998
+
2999
+ >>> df.skew()
3000
+ A 0.0
3001
+ B 0.0
3002
+ C 2.236068
3003
+ dtype: Float64
3004
+
2904
3005
Args:
2905
3006
numeric_only (bool, default False):
2906
3007
Include only float, int, boolean columns.
0 commit comments