DataFrame.loc
Access a group of rows and columns by label(s)
Parameters
Type
Description
Default
Examples
Index by specific rows and return all columns
const dfd = require("danfojs-node")
let data = { "Name": ["Apples", "Mango", "Banana", "Pear"],
"Count": [21, 5, 30, 10],
"Price": [200, 300, 40, 250] }
let df = new dfd.DataFrame(data, {index: ["a", "b", "c", "d"]})
df.print()
let sub_df = df.loc({rows: ["a", "c"]})
sub_df.print()Index by a list of column names and return all rows
Index both axes by the specified labels
Index by a slice of row
Slice DataFrame rows by boolean condition
Slice DataFrame rows by multiple boolean conditions
Slice DataFrame with boolean mask
Last updated