Danfo.js
Getting Started
API Reference
Contributing Guide
Github
Search…
Danfo.js Documentation
Getting Started
API reference
General Functions
Input/Output
Series
Dataframe
Creating a DataFrame
DataFrame.sortIndex
DataFrame.append
DataFrame.nUnique
DataFrame.tensor
DataFrame.print
DataFrame.toCSV
DataFrame.toJSON
DataFrame.toExcel
DataFrame.sortValues
DataFrame.setIndex
DataFrame.resetIndex
DataFrame.rename
DataFrame.drop
DataFrame.asType
DataFrame.shape
DataFrame.axis
DataFrame.ndim
DataFrame.values
DataFrame.selectDtypes
DataFrame.ctypes
DataFrame.index
DataFrame.loc
DataFrame.iloc
DataFrame.at
DataFrame.iat
DataFrame.head
DataFrame.tail
DataFrame.sample
DataFrame.add
DataFrame.sub
DataFrame.mul
DataFrame.div
DataFrame.pow
DataFrame.mod
DataFrame.mean
DataFrame.median
DataFrame.min
DataFrame.max
DataFrame.std
DataFrame.var
DataFrame.count
DataFrame.round
DataFrame.cumSum
DataFrame.cumMin
DataFrame.cumMax
DataFrame.cumProd
DataFrame.copy
DataFrame.describe
DataFrame.sum
DataFrame.abs
DataFrame.query
DataFrame.addColumn
DataFrame.groupby
DataFrame.column
DataFrame.fillNa
DataFrame.isNa
DataFrame.dropNa
DataFrame.apply
DataFrame.applyMap
DataFrame.It
DataFrame.gt
DataFrame.le
DataFrame.ge
DataFrame.ne
DataFrame.eq
DataFrame.replace
Configuration Options
Plotting
Groupby
User Guides
Building Data Driven Applications with Danfo.js - Book
Contributing Guide
Release Notes
Powered By
GitBook
DataFrame.ne
Get Not Equal to of DataFrame and other, element-wise (binary operator eq).
danfo.DataFrame.ne(other, options)
Parameters
Type
Description
Default
other
DataFrame, Series, Array, Scalar
Data structure, or array-like object to compare against
options
Object
axis
: 0 or 1. If 0, add column-wise, if 1, add row-wise
{axis: 1}
Returns:
Examples
Comparing a DataFrame with a scalar value:
Node
Browser
1
const
dfd
=
require
(
"danfojs-node"
)
2
3
let
data
=
{
"Col1"
:
[
10
,
45
,
56
,
10
],
4
"Col2"
:
[
23
,
20
,
10
,
24
]}
5
let
df
=
new
dfd
.
DataFrame
(
data
)
6
7
let
df_rep
=
df
.
ne
(
20
)
8
9
df_rep
.
print
()
Copied!
1
Copied!
Output
1
╔═══╤═══════════════════╤═══════════════════╗
2
║ │ Col1 │ Col2 ║
3
╟───┼───────────────────┼───────────────────╢
4
║ 0 │ true │ true ║
5
╟───┼───────────────────┼───────────────────╢
6
║ 1 │ true │ false ║
7
╟───┼───────────────────┼───────────────────╢
8
║ 2 │ true │ true ║
9
╟───┼───────────────────┼───────────────────╢
10
║ 3 │ true │ true ║
11
╚═══╧═══════════════════╧═══════════════════╝
Copied!
Comparing a DataFrame with a Series along the column axis:
Node
Browser
1
const
dfd
=
require
(
"danfojs-node"
)
2
3
let
data
=
{
"Col1"
:
[
10
,
45
,
56
,
10
],
4
"Col2"
:
[
23
,
20
,
10
,
24
]}
5
let
df
=
new
dfd
.
DataFrame
(
data
)
6
let
sf
=
new
dfd
.
Series
([
10
,
40
])
7
8
let
df_rep
=
df
.
ne
(
sf
,
{
axis
:
1
})
9
10
df_rep
.
print
()
Copied!
1
Copied!
Output
1
╔═══╤═══════════════════╤═══════════════════╗
2
║ │ Col1 │ Col2 ║
3
╟───┼───────────────────┼───────────────────╢
4
║ 0 │ false │ true ║
5
╟───┼───────────────────┼───────────────────╢
6
║ 1 │ true │ true ║
7
╟───┼───────────────────┼───────────────────╢
8
║ 2 │ true │ true ║
9
╟───┼───────────────────┼───────────────────╢
10
║ 3 │ false │ true ║
11
╚═══╧═══════════════════╧═══════════════════╝
Copied!
Comparing a DataFrame with a DataFrame
Node
Browser
1
const
dfd
=
require
(
"danfojs-node"
)
2
3
let
data
=
{
"Col1"
:
[
10
,
45
,
56
,
10
],
4
"Col2"
:
[
23
,
20
,
10
,
24
]}
5
let
data2
=
{
"new_col1"
:
[
10
,
45
,
200
,
10
],
6
"new_Col2"
:
[
230
,
200
,
110
,
24
]}
7
8
let
df
=
new
dfd
.
DataFrame
(
data
)
9
let
df2
=
new
dfd
.
DataFrame
(
data2
)
10
11
let
df_rep
=
df
.
ne
(
df2
)
12
13
df_rep
.
print
()
Copied!
1
Copied!
Output
1
╔═══╤═══════════════════╤═══════════════════╗
2
║ │ Col1 │ Col2 ║
3
╟───┼───────────────────┼───────────────────╢
4
║ 0 │ false │ true ║
5
╟───┼───────────────────┼───────────────────╢
6
║ 1 │ false │ true ║
7
╟───┼───────────────────┼───────────────────╢
8
║ 2 │ true │ true ║
9
╟───┼───────────────────┼───────────────────╢
10
║ 3 │ false │ false ║
11
╚═══╧═══════════════════╧═══════════════════╝
Copied!
Comparing a DataFrame with a JavaScript Array
Node
Browser
1
const
dfd
=
require
(
"danfojs-node"
)
2
3
let
data
=
{
"Col1"
:
[
10
,
45
,
56
,
10
],
4
"Col2"
:
[
23
,
20
,
10
,
24
]}
5
let
df
=
new
dfd
.
DataFrame
(
data
)
6
let
val
=
[
10
,
40
,
30
,
20
]
7
8
let
df_rep
=
df
.
le
(
val
)
9
10
df_rep
.
print
()
Copied!
1
Copied!
Output
1
╔═══╤═══════════════════╤═══════════════════╤═══════════════════╤═══════════════════╗
2
║ │ 0 │ 1 │ 2 │ 3 ║
3
╟───┼───────────────────┼───────────────────┼───────────────────┼───────────────────╢
4
║ 0 │ true │ false │ false │ true ║
5
╟───┼───────────────────┼───────────────────┼───────────────────┼───────────────────╢
6
║ 1 │ false │ true │ true │ false ║
7
╚═══╧═══════════════════╧═══════════════════╧═══════════════════╧═══════════════════╝
Copied!
Previous
DataFrame.ge
Next
DataFrame.eq
Last modified
4mo ago
Copy link
Contents
Examples
Comparing a DataFrame with a scalar value:
Comparing a DataFrame with a Series along the column axis:
Comparing a DataFrame with a DataFrame
Comparing a DataFrame with a JavaScript Array