danfo.Str
Accessor object for String-like properties of Series values.
For example, in the following example, we convert a Series to an Str instance and apply a couple of String methods.
Node
1
import { Str, Series } from "danfojs-node"
2
3
const sf = new Series(["Dog", "Cat", "Bird", "Fish", "ShArk", "tiGer"])
4
const sfStr = new Str(sf)
5
6
sfStr.toLowerCase().print()
7
sfStr.toUpperCase().print()
8
sfStr.join("Added", "-").print()
Copied!
1
// output
2
╔═══╤═══════╗
3
║ 0 │ dog ║
4
╟───┼───────╢
5
║ 1 │ cat ║
6
╟───┼───────╢
7
║ 2 │ bird ║
8
╟───┼───────╢
9
║ 3 │ fish ║
10
╟───┼───────╢
11
║ 4 │ shark ║
12
╟───┼───────╢
13
║ 5 │ tiger ║
14
╚═══╧═══════╝
15
16
╔═══╤═══════╗
17
║ 0 │ DOG ║
18
╟───┼───────╢
19
║ 1 │ CAT ║
20
╟───┼───────╢
21
║ 2 │ BIRD ║
22
╟───┼───────╢
23
║ 3 │ FISH ║
24
╟───┼───────╢
25
║ 4 │ SHARK ║
26
╟───┼───────╢
27
║ 5 │ TIGER ║
28
╚═══╧═══════╝
29
╔═══╤═════════════╗
30
║ 0 │ Dog-Added ║
31
╟───┼─────────────╢
32
║ 1 │ Cat-Added ║
33
╟───┼─────────────╢
34
║ 2 │ Bird-Added ║
35
╟───┼─────────────╢
36
║ 3 │ Fish-Added ║
37
╟───┼─────────────╢
38
║ 4 │ ShArk-Added ║
39
╟───┼─────────────╢
40
║ 5 │ tiGer-Added ║
41
╚═══╧═════════════╝
Copied!
Last modified 5mo ago
Copy link