DataFrame.mod
Get Modulo of DataFrame and other, element-wise (binary operator mod).
Parameters
Type
Description
Default
Examples
Modulo 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.mod(2)
df_new.print()╔════════════╤═══════════════════╤═══════════════════╗
║ │ Col1 │ Col2 ║
╟────────────┼───────────────────┼───────────────────╢
║ 0 │ 0 │ 1 ║
╟────────────┼───────────────────┼───────────────────╢
║ 1 │ 1 │ 0 ║
╟────────────┼───────────────────┼───────────────────╢
║ 2 │ 0 │ 0 ║
╟────────────┼───────────────────┼───────────────────╢
║ 3 │ 0 │ 0 ║
╚════════════╧═══════════════════╧═══════════════════╝
Modulo of Series with DataFrame along axis 0
Modulo of DataFrame with a DataFrame
Modulo of Array with DataFrame along axis 0
Modulo works inplace
Last updated