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.Dt
Accessor object for date time properties of the Series values.
For example, in the following example, we convert a Series to an
Dt
instance and apply a couple of
DateTime
methods.
Node
1
import
{
Dt
,
Series
}
from
"danfojs-node-nightly"
2
3
const
sf
=
new
Series
([
"1/1/2000"
,
"1/2/2000"
,
"2/3/2000"
,
"1/4/2000"
,
"4/5/2000"
])
4
const
dtS
=
new
Dt
(
sf
)
5
6
dtS
.
dayOfWeekName
().
print
()
7
dtS
.
monthName
().
print
()
Copied!
1
// output
2
╔═══╤═══════════╗
3
║ 0 │ Saturday ║
4
╟───┼───────────╢
5
║ 1 │ Sunday ║
6
╟───┼───────────╢
7
║ 2 │ Thursday ║
8
╟───┼───────────╢
9
║ 3 │ Tuesday ║
10
╟───┼───────────╢
11
║ 4 │ Wednesday ║
12
╚═══╧═══════════╝
13
14
╔═══╤══════════╗
15
║ 0 │ January ║
16
╟───┼──────────╢
17
║ 1 │ January ║
18
╟───┼──────────╢
19
║ 2 │ February ║
20
╟───┼──────────╢
21
║ 3 │ January ║
22
╟───┼──────────╢
23
║ 4 │ April ║
24
╚═══╧══════════╝
Copied!
Previous
danfo.Str
Next
danfo.dateRange
Last modified
5mo ago
Copy link