Danfo.js
Getting Started
API Reference
Contributing Guide
Github
Search…
Danfo.js Documentation
Getting Started
API reference
General Functions
Input/Output
Series
Creating a Series
Series.append
Series.cumSum
Series.cumMax
Series.cumProd
Series.cumMin
Series.str.split
Series.str.len
Series.str.join
Series.str.trim
Series.str.substring
Series.str.substr
Series.str.slice
Series.str.search
Series.str.repeat
Series.str.replace
Series.str.lastIndexOf
Series.str.indexOf
Series.str.includes
Series.str.endsWith
Series.str.startsWith
Series.str.concat
Series.str.charAt
Series.str.toUpperCase
Series.str.toLowerCase
Series.str.capitalize
Series.dt.seconds
Series.dt.minutes
Series.dt.dayOfMonth
Series.dt.monthName
Series.dt.hours
Series.dt.dayOfWeek
Series.dt.dayOfWeek
Series.dt.month
Series.dt.year
Series.argMax
Series.argMin
Series.argSort
Series.replace
Series.isNa
Series.fillNa
Series.dropNa
Series.dropDuplicates
Series.valueCounts
Series.nUnique
Series.unique
Series.abs
Series.ne
Series.eq
Series.ge
Series.le
Series.gt
Series.lt
Series.iloc
Series.loc
Series.at
Series.iat
Series.ndim
Series.shape
Series.dtype
Series.values
Series.tensor
Series.index
Series.apply
Series.map
Series.setIndex
Series.resetIndex
Series.describe
Series.copy
Series.sortValues
Series.var
Series.std
Series.round
Series.minimum
Series.maximum
Series.count
Series.sum
Series.max
Series.min
Series.mode
Series.median
Series.mean
Series.mod
Series.pow
Series.div
Series.mul
Series.sub
Series.add
Series.sample
Series.tail
Series.head
Series.and
Series.or
Dataframe
Configuration Options
Plotting
Groupby
User Guides
Building Data Driven Applications with Danfo.js - Book
Contributing Guide
Release Notes
Powered By
GitBook
Series.append
Add a new value or values to the end of a Series.
danfo.Series.
append
(newValue, index, options)
Parameters
Type
Description
Default
newValue
Array, Series
Object to append
index
Array
The new index value(s) to append to the Series. Must contain the same number of values as
newValues
as they map
1 - 1
.
options
Object
{
inplace
: Whether to perform operation in-place or not.
}
false
Append new Series to the end of a Series
Node
1
const
dfd
=
require
(
"danfojs-node"
)
2
3
let
sf1
=
new
dfd
.
Series
([
1
,
2
,
3
,
4
],
{
index
:
[
'f1'
,
'f2'
,
'f3'
,
'f4'
]
})
4
let
sf2
=
new
dfd
.
Series
([
"a"
,
"b"
,
"c"
])
5
6
new_sf
=
sf1
.
append
(
sf2
,
[
"f5"
,
"f6"
,
"f7"
])
7
new_sf
.
print
()
Copied!
Output
1
╔════╤═══╗
2
║ f1 │ 1 ║
3
╟────┼───╢
4
║ f2 │ 2 ║
5
╟────┼───╢
6
║ f3 │ 3 ║
7
╟────┼───╢
8
║ f4 │ 4 ║
9
╟────┼───╢
10
║ f5 │ a ║
11
╟────┼───╢
12
║ f6 │ b ║
13
╟────┼───╢
14
║ f7 │ c ║
15
╚════╧═══╝
Copied!
Append new Series to the end of a Series in-place
Node
1
const
dfd
=
require
(
"danfojs-node"
)
2
3
let
sf1
=
new
dfd
.
Series
([
1
,
2
,
3
,
4
],
{
index
:
[
'f1'
,
'f2'
,
'f3'
,
'f4'
]
})
4
let
sf2
=
new
dfd
.
Series
([
"a"
,
"b"
,
"c"
])
5
let
newIndex
=
[
"f5"
,
"f6"
,
"f7"
]
6
7
sf1
.
append
(
sf2
,
newIndex
,
{
inplace
:
true
})
8
sf1
.
print
()
Copied!
1
╔════╤═══╗
2
║ f1 │ 1 ║
3
╟────┼───╢
4
║ f2 │ 2 ║
5
╟────┼───╢
6
║ f3 │ 3 ║
7
╟────┼───╢
8
║ f4 │ 4 ║
9
╟────┼───╢
10
║ f5 │ a ║
11
╟────┼───╢
12
║ f6 │ b ║
13
╟────┼───╢
14
║ f7 │ c ║
15
╚════╧═══╝
Copied!
Append an array to the end of Series
Node
Browser
1
let
sf1
=
new
dfd
.
Series
([
1
,
2
,
3
,
4
],
{
index
:
[
'f1'
,
'f2'
,
'f3'
,
'f4'
]
})
2
let
sfArr
=
[
"a"
,
"b"
,
"c"
]
3
4
new_sf
=
sf1
.
append
(
sfArr
,
[
"f5"
,
"f6"
,
"f7"
])
5
new_sf
.
print
()
Copied!
1
Copied!
Output
1
╔════╤═══╗
2
║ f1 │ 1 ║
3
╟────┼───╢
4
║ f2 │ 2 ║
5
╟────┼───╢
6
║ f3 │ 3 ║
7
╟────┼───╢
8
║ f4 │ 4 ║
9
╟────┼───╢
10
║ f5 │ a ║
11
╟────┼───╢
12
║ f6 │ b ║
13
╟────┼───╢
14
║ f7 │ c ║
15
╚════╧═══╝
Copied!
Previous
Creating a Series
Next
Series.cumSum
Last modified
4mo ago
Copy link
Contents
Append new Series to the end of a Series
Append new Series to the end of a Series in-place
Append an array to the end of Series