Series.str.len

Obtain the length of each string element in a Series

danfo.Series.str.len(options) [source]

ParametersTypeDescriptionDefault

options

Object

inplace: Whether to perform the operation in-place or not.

{

inplace: false

}

Examples

Returns the length (number of character) of a string, and also return the length (number of elements) of Array

const dfd = require("danfojs-node")

let data = ["dog", 5,"cat","fog","mug","animals"]
let sf = new dfd.Series(data)
sf.str.len().print()
╔═══╤═══╗
║ 0 │ 3 ║
╟───┼───╢
║ 1 │ 1 ║
╟───┼───╢
║ 2 │ 3 ║
╟───┼───╢
║ 3 │ 3 ║
╟───┼───╢
║ 4 │ 3 ║
╟───┼───╢
║ 5 │ 7 ║
╚═══╧═══╝

Last updated