Series.dropNa
Remove missing values from Series
danfo.Series.dropNa(options) [source]
Parameters
Type
Description
Default
options
Object
inplace: Boolean indicating whether to perform the operation inplace or not. Defaults to false
{ inplace: false
}

Drop all missing values and then return New Series.

Node
const dfd = require("danfojs-node")
let data1 = [10, 45, undefined, 10, 23, 20, null, 10]
let sf = new dfd.Series(data1)
let sf_rep = sf.dropNa()
sf_rep.print()
Output
╔═══╤════╗
║ 0 │ 10 ║
╟───┼────╢
║ 1 │ 45 ║
╟───┼────╢
║ 3 │ 10 ║
╟───┼────╢
║ 4 │ 23 ║
╟───┼────╢
║ 5 │ 20 ║
╟───┼────╢
║ 7 │ 10 ║
╚═══╧════╝

Drop nan values in-place

Node
const dfd = require("danfojs-node")
let data1 = [10, 45, undefined, 10, 23, 20, undefined, 10]
let sf = new dfd.Series(data1)
sf.dropNa({inplace:true})
sf.print()
Output
╔═══╤════╗
║ 0 │ 10 ║
╟───┼────╢
║ 1 │ 45 ║
╟───┼────╢
║ 3 │ 10 ║
╟───┼────╢
║ 4 │ 23 ║
╟───┼────╢
║ 5 │ 20 ║
╟───┼────╢
║ 7 │ 10 ║
╚═══╧════╝
Copy link
On this page
Drop all missing values and then return New Series.
Drop nan values in-place