Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/pandas/core/ops/__init__.py: 100%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

9 statements  

1""" 

2Arithmetic operations for PandasObjects 

3 

4This is not a public API. 

5""" 

6 

7from __future__ import annotations 

8 

9from pandas.core.ops.array_ops import ( 

10 arithmetic_op, 

11 comp_method_OBJECT_ARRAY, 

12 comparison_op, 

13 fill_binop, 

14 get_array_op, 

15 logical_op, 

16 maybe_prepare_scalar_for_op, 

17) 

18from pandas.core.ops.common import ( 

19 get_op_result_name, 

20 has_castable_attr, 

21 maybe_warn_listlike, 

22 raise_if_2d, 

23 unpack_zerodim_and_defer, 

24) 

25from pandas.core.ops.invalid import ( 

26 disallow_datetimelike_logical_op, 

27 disallow_datetimelike_logical_ufunc, 

28 invalid_comparison, 

29) 

30from pandas.core.ops.mask_ops import ( 

31 kleene_and, 

32 kleene_or, 

33 kleene_xor, 

34) 

35from pandas.core.roperator import ( 

36 radd, 

37 rand_, 

38 rdiv, 

39 rdivmod, 

40 rfloordiv, 

41 rmod, 

42 rmul, 

43 ror_, 

44 rpow, 

45 rsub, 

46 rtruediv, 

47 rxor, 

48) 

49 

50# ----------------------------------------------------------------------------- 

51# constants 

52ARITHMETIC_BINOPS: set[str] = { 

53 "add", 

54 "sub", 

55 "mul", 

56 "pow", 

57 "mod", 

58 "floordiv", 

59 "truediv", 

60 "divmod", 

61 "radd", 

62 "rsub", 

63 "rmul", 

64 "rpow", 

65 "rmod", 

66 "rfloordiv", 

67 "rtruediv", 

68 "rdivmod", 

69} 

70 

71 

72__all__ = [ 

73 "ARITHMETIC_BINOPS", 

74 "arithmetic_op", 

75 "comp_method_OBJECT_ARRAY", 

76 "comparison_op", 

77 "disallow_datetimelike_logical_op", 

78 "disallow_datetimelike_logical_ufunc", 

79 "fill_binop", 

80 "get_array_op", 

81 "get_op_result_name", 

82 "has_castable_attr", 

83 "invalid_comparison", 

84 "kleene_and", 

85 "kleene_or", 

86 "kleene_xor", 

87 "logical_op", 

88 "maybe_prepare_scalar_for_op", 

89 "maybe_warn_listlike", 

90 "radd", 

91 "raise_if_2d", 

92 "rand_", 

93 "rdiv", 

94 "rdivmod", 

95 "rfloordiv", 

96 "rmod", 

97 "rmul", 

98 "ror_", 

99 "rpow", 

100 "rsub", 

101 "rtruediv", 

102 "rxor", 

103 "unpack_zerodim_and_defer", 

104]