MCPcopy Index your code
hub / github.com/javascriptdata/danfojs / checkIfColsExist

Function checkIfColsExist

src/danfojs-base/plotting/plotly/utils.ts:19–26  ·  view source on GitHub ↗
(ndframe: DataFrame | Series, cols: string[])

Source from the content-addressed store, hash-verified

17import DataFrame from "../../core/frame";
18
19export const checkIfColsExist = (ndframe: DataFrame | Series, cols: string[]) => {
20 cols.forEach((col) => {
21 if (!ndframe.columns.includes(col)) {
22 throw Error(`Column Error: ${col} not found in columns. Columns should be one of [ ${ndframe.columns} ]`);
23 }
24 });
25 return cols;
26}
27
28export const throwErrorOnWrongColName = (ndframe: DataFrame, colName: string): void => {
29 if (!ndframe.columns.includes(colName)) {

Callers 7

scatterPlotFunction · 0.90
violinPlotFunction · 0.90
linePlotFunction · 0.90
histPlotFunction · 0.90
piePlotFunction · 0.90
boxPlotFunction · 0.90
barPlotFunction · 0.90

Calls 1

includesMethod · 0.80

Tested by

no test coverage detected