(ndframe: DataFrame | Series, cols: string[])
| 17 | import DataFrame from "../../core/frame"; |
| 18 | |
| 19 | export 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 | |
| 28 | export const throwErrorOnWrongColName = (ndframe: DataFrame, colName: string): void => { |
| 29 | if (!ndframe.columns.includes(colName)) { |
no test coverage detected