Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting to JSON does not work #58

Open
geyang opened this issue Mar 3, 2019 · 0 comments
Open

Converting to JSON does not work #58

geyang opened this issue Mar 3, 2019 · 0 comments

Comments

@geyang
Copy link

geyang commented Mar 3, 2019

The example doesn't work. Is this library still maintained or used?

  ml-dash-client git:(master)  node
> const pd = require('pandas-js')
> const Immutable = require('immutable')
> df = new pd.DataFrame(Immutable.Map({x: new pd.Series([0, 1]), y: new pd.Series([2, 2.3])}))
DataFrame {
  _data: Map { "x": 0	0
1	1
Name: , dtype: dtype(int), "y": 0	2
1	2.3
Name: , dtype: dtype(float) },
  _axes: {},
  _AXIS_ORDERS: List [ 0, 1 ],
  _values: null,
  _AXIS_LEN: 2 }
> df
DataFrame {
  _data: Map { "x": 0	0
1	1
Name: , dtype: dtype(int), "y": 0	2
1	2.3
Name: , dtype: dtype(float) },
  _axes: {},
  _AXIS_ORDERS: List [ 0, 1 ],
  _values: null,
  _AXIS_LEN: 2 }
> df.columns
undefined
> df.to_json({orient: "records"})
TypeError: Cannot read property 'map' of undefined
    at DataFrame.get (/Users/ge/machine_learning/berkeley-playground/packages/ml_logger/ml-dash-client/node_modules/pandas-js/dist/core/frame.js:862:92)
    at DataFrame.get (/Users/ge/machine_learning/berkeley-playground/packages/ml_logger/ml-dash-client/node_modules/pandas-js/dist/core/frame.js:811:36)
    at DataFrame.to_json (/Users/ge/machine_learning/berkeley-playground/packages/ml_logger/ml-dash-client/node_modules/pandas-js/dist/core/frame.js:447:23)
> 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant