Module: Daru::Maths::Arithmetic::DataFrame
- Included in:
- DataFrame
- Defined in:
- lib/daru/maths/arithmetic/dataframe.rb
Instance Method Summary collapse
-
#%(other) ⇒ Object
Modulus with a scalar or another DataFrame.
-
#*(other) ⇒ Object
Multiply a scalar or another DataFrame.
-
#**(other) ⇒ Object
Exponent with a scalar or another DataFrame.
-
#+(other) ⇒ Object
Add a scalar or another DataFrame.
-
#-(other) ⇒ Object
Subtract a scalar or another DataFrame.
-
#/(other) ⇒ Object
Divide a scalar or another DataFrame.
-
#exp ⇒ Object
Calculate exponenential of all vectors with numeric values.
- #round(precision = 0) ⇒ Object
-
#sqrt ⇒ Object
Calcuate square root of numeric vectors.
Instance Method Details
#%(other) ⇒ Object
Modulus with a scalar or another DataFrame.
28 29 30 |
# File 'lib/daru/maths/arithmetic/dataframe.rb', line 28 def % other binary_operation :%, other end |
#*(other) ⇒ Object
Multiply a scalar or another DataFrame.
18 19 20 |
# File 'lib/daru/maths/arithmetic/dataframe.rb', line 18 def * other binary_operation :*, other end |
#**(other) ⇒ Object
Exponent with a scalar or another DataFrame.
33 34 35 |
# File 'lib/daru/maths/arithmetic/dataframe.rb', line 33 def ** other binary_operation :**, other end |
#+(other) ⇒ Object
Add a scalar or another DataFrame
8 9 10 |
# File 'lib/daru/maths/arithmetic/dataframe.rb', line 8 def + other binary_operation :+, other end |
#-(other) ⇒ Object
Subtract a scalar or another DataFrame.
13 14 15 |
# File 'lib/daru/maths/arithmetic/dataframe.rb', line 13 def - other binary_operation :-, other end |
#/(other) ⇒ Object
Divide a scalar or another DataFrame.
23 24 25 |
# File 'lib/daru/maths/arithmetic/dataframe.rb', line 23 def / other binary_operation :/, other end |
#exp ⇒ Object
Calculate exponenential of all vectors with numeric values.
38 39 40 |
# File 'lib/daru/maths/arithmetic/dataframe.rb', line 38 def exp only_numerics(clone: false).recode { |v| v.exp } end |
#round(precision = 0) ⇒ Object
47 48 49 |
# File 'lib/daru/maths/arithmetic/dataframe.rb', line 47 def round precision=0 only_numerics(clone: false).recode { |v| v.round(precision) } end |
#sqrt ⇒ Object
Calcuate square root of numeric vectors.
43 44 45 |
# File 'lib/daru/maths/arithmetic/dataframe.rb', line 43 def sqrt only_numerics(clone: false).recode { |v| v.sqrt } end |