Danfo.js
Getting Started
API Reference
Contributing Guide
Github
Search…
Danfo.js Documentation
Getting Started
API reference
General Functions
danfo.tensorflow
danfo. convertFunctionTotransformer
danfo.streamCsvTransformer
danfo.streamJSON
danfo.streamCSV
danfo.Utils
danfo.Str
danfo.Dt
danfo.dateRange
danfo.OneHotEncoder
danfo.StandardScaler
danfo.MinMaxScaler
danfo.LabelEncoder
danfo.toDateTime
danfo.getDummies
danfo.concat
danfo.merge
Input/Output
Series
Dataframe
Configuration Options
Plotting
Groupby
User Guides
Building Data Driven Applications with Danfo.js - Book
Contributing Guide
Release Notes
Powered By
GitBook
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!
Previous
danfo.Utils
Next
danfo.Dt
Last modified
5mo ago
Copy link