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