Powered By GitBook
Series.str.charAt
Obtain the character at the specified index (position)
danfo.Series.str.charAt(index) [source]
Parameters
Type
Description
Default
index
int
the index at which to obtain the character
0
options
Object
inplace: Whether to perform the operation in-place or not.
{
inplace: false
}
Returns: Series (Character element)
Example
Obtain the character at index 2 of all string elements in the series.
Node
Browser
1
const dfd = require("danfojs-node")
2
3
let data = ['lower boy', 'CAPITALS', 'sentence', 'SwApCaSe']
4
let sf = new dfd.Series(data)
5
sf.str.charAt(2).print()
Copied!
1
Copied!
Output
1
╔═══╤══════════════════════╗
2
║ │ 0 ║
3
╟───┼──────────────────────╢
4
║ 0 │ w ║
5
╟───┼──────────────────────╢
6
║ 1 │ P ║
7
╟───┼──────────────────────╢
8
║ 2 │ n ║
9
╟───┼──────────────────────╢
10
║ 3 │ A ║
11
╚═══╧══════════════════════╝
Copied!
Last modified 24d ago
Copy link