DataFrame.div
Get division of DataFrame and other, element-wise
Parameters
Type
Description
Default
Examples
Division of scalar with DataFrame along default axis 1
const dfd = require("danfojs-node")
let data = {
"Col1": [10, 45, 56, 10],
"Col2": [23, 20, 10, 24]
}
let df = new dfd.DataFrame(data)
let df_new = df.div(2)
df_new.print()╔════════════╤═══════════════════╤═══════════════════╗
║ │ Col1 │ Col2 ║
╟────────────┼───────────────────┼───────────────────╢
║ 0 │ 5 │ 11.5 ║
╟────────────┼───────────────────┼───────────────────╢
║ 1 │ 22.5 │ 10 ║
╟────────────┼───────────────────┼───────────────────╢
║ 2 │ 28 │ 5 ║
╟────────────┼───────────────────┼───────────────────╢
║ 3 │ 5 │ 12 ║
╚════════════╧═══════════════════╧═══════════════════╝Division of Series with DataFrame along axis 0
Division of DataFrame with another DataFrame
Division of Array with DataFrame along axis 0
Division works inplace
Last updated