diff --git a/src/danfojs-base/core/indexing.ts b/src/danfojs-base/core/indexing.ts index 5c2b668b..c22c6797 100644 --- a/src/danfojs-base/core/indexing.ts +++ b/src/danfojs-base/core/indexing.ts @@ -243,7 +243,10 @@ export function _loc({ ndFrame, rows, columns }: { if (rows[0].startsWith(`"`) || rows[0].startsWith(`'`) || rows[0].startsWith("`")) { temp = _index.indexOf(rows[0].replace(/['"`]/g, '')) } else { - temp = _index.indexOf(Number(rows[0])) + temp = _index.indexOf(rows[0]); + if (temp === -1 && !isNaN(Number(rows[0]))) { + temp = _index.indexOf(Number(rows[0])); + } } if (temp === -1) { @@ -417,4 +420,4 @@ export function _loc({ ndFrame, rows, columns }: { } -} \ No newline at end of file +}