Series.map
Map the value of a series to a function or Object
danfo.series.map(callable)
Parameter
Type
Description
Default
callable
Function or Object
A function or object({})
options
Object
inplace: Boolean indicating whether to perform the operation inplace or not. Defaults to false
{
inplace: false
}
Example
Mapping the element in a Series words in an Object
const dfd = require("danfojs-node")
let sf = new dfd.Series([1, 2, 3, 4])
let map = { 1: "ok", 2: "okie", 3: "frit", 4: "gop" }
sf.map(map).print()╔═══╤══════╗
║ 0 │ ok ║
╟───┼──────╢
║ 1 │ okie ║
╟───┼──────╢
║ 2 │ frit ║
╟───┼──────╢
║ 3 │ gop ║
╚═══╧══════╝Mapping values in a Series to a representation using functions.
Last updated
Was this helpful?