Series.mul

Return Multiplication of series and other, element-wise (binary operator mul).

danfo.Series.mul(other) [source]

Parameters

Type

Description

Default

other

Series|int|

values

Return: Series

Example

multiplication with values of another series

Node
Node
const dfd = require("danfojs-node")
let data1 = [30, 40, 3, 5]
let data2 = [1, 2, 3, 4]
let sf1 = new dfd.Series(data1)
let sf2 = new dfd.Series(data2)
sf1.mul(sf2).print()
Output
Output
╔═══╤══════════════════════╗
║ │ 0 ║
╟───┼──────────────────────╢
║ 0 │ 30 ║
╟───┼──────────────────────╢
║ 1 │ 80 ║
╟───┼──────────────────────╢
║ 2 │ 9 ║
╟───┼──────────────────────╢
║ 3 │ 20 ║
╚═══╧══════════════════════╝

multiply with a value

Node
Node
const dfd = require("danfojs-node")
let data1 = [1, 2, 3, 4, 5]
let sf1 = new dfd.Series(data1)
sf1.mul(2).print()
Output
Output
╔═══╤══════════════════════╗
║ │ 0 ║
╟───┼──────────────────────╢
║ 0 │ 2 ║
╟───┼──────────────────────╢
║ 1 │ 4 ║
╟───┼──────────────────────╢
║ 2 │ 6 ║
╟───┼──────────────────────╢
║ 3 │ 8 ║
╟───┼──────────────────────╢
║ 4 │ 10 ║
╚═══╧══════════════════════╝