Series.str.slice

Obtain the substring of each element in a series

danfo.Series.str.slice(startIndex, endIndex, options) [source]

Returns:

**** return Series.

Example

const dfd = require("danfojs-node")

let data = ['lower part ', ' CAPITALS city', ' this is a sentence', '  SwAp CaSe']
let sf = new dfd.Series(data)
sf.str.slice(2, 4).print()
╔═══╤══════════════════════╗
║   │ 0                    ║
╟───┼──────────────────────╢
║ 0 │ we                   ║
╟───┼──────────────────────╢
║ 1 │ AP                   ║
╟───┼──────────────────────╢
║ 2 │ hi                   ║
╟───┼──────────────────────╢
║ 3 │ Sw                   ║
╚═══╧══════════════════════╝

Last updated