File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -1306,6 +1306,9 @@ def __pos__(self) -> DataFrame:
13061306 def __neg__ (self ) -> DataFrame :
13071307 return self ._apply_unary_op (ops .neg_op )
13081308
1309+ def __abs__ (self ) -> DataFrame :
1310+ return self ._apply_unary_op (ops .abs_op )
1311+
13091312 def align (
13101313 self ,
13111314 other : typing .Union [DataFrame , bigframes .series .Series ],
Original file line number Diff line number Diff line change @@ -2460,6 +2460,16 @@ def test_df_neg(scalars_dfs):
24602460 assert_pandas_df_equal (pd_result , bf_result )
24612461
24622462
2463+ def test_df__abs__ (scalars_dfs ):
2464+ scalars_df , scalars_pandas_df = scalars_dfs
2465+ bf_result = (
2466+ abs (scalars_df [["int64_col" , "numeric_col" , "float64_col" ]])
2467+ ).to_pandas ()
2468+ pd_result = abs (scalars_pandas_df [["int64_col" , "numeric_col" , "float64_col" ]])
2469+
2470+ assert_pandas_df_equal (pd_result , bf_result )
2471+
2472+
24632473def test_df_invert (scalars_dfs ):
24642474 scalars_df , scalars_pandas_df = scalars_dfs
24652475 columns = ["int64_col" , "bool_col" ]
You can’t perform that action at this time.
0 commit comments