StratoDem / pandas-js

Pandas in JavaScript for data analysis and visualization
https://stratodem.github.io/pandas.js-docs
MIT License
458 stars 36 forks source link

Following the initial steps, get "already declared" error #65

Open MegMM opened 11 months ago

MegMM commented 11 months ago

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.