pandas-js icon indicating copy to clipboard operation
pandas-js copied to clipboard

Following the initial steps, get "already declared" error

Open MegMM opened this issue 2 years ago • 0 comments

Hello, First, I'm a javascript newbie. I've used Pandas in python many times. I'm just following the first couple of steps with the following code:

import { Series, DataFrame } from 'pandas-js';
var Series = require('pandas-js').Series;
const ds = new Series([1, 2, 3, 4], {name: 'My test name', index: [2, 3, 4, 5]});
ds.toString();
console.log(ds);

When I run it I get the following error:

var Series = require('pandas-js').Series;
    ^
SyntaxError: Identifier 'Series' has already been declared

I'm assuming .Series and var Series are probably in conflict, but I'm not sure what the solution should be. Anyway, this code is directly from the pandas-js usage example.

MegMM avatar Nov 26 '23 00:11 MegMM