-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
New orientation for to_json method #5729
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
Labels
Duplicate Report
Duplicate issue or pull request
Enhancement
IO JSON
read_json, to_json, json_normalize
Comments
way to do this currently? |
@zsljulius you could do something like this curently In [26]: f['date'] = f.index
In [27]: f.loc[:, ['date', 'Adj Close']].to_json(date_format='iso', orient='records')
Out[27]: '[{"date":"2013-01-02T00:00:00.000Z","Adj Close":535.58},{"date":"2013-01-03T00:00:00.000Z","Adj Close":528.82},{"date":"2013-01-04T00:00:00.000Z","Adj Close":514.09},{"date":"2013-01-07T00:00:00.000Z","Adj Close":511.06},{"date":"2013-01-08T00:00:00.000Z","Adj Close":512.44},{"date":"2013-01-09T00:00:00.000Z","Adj Close":504.43},{"date":"2013-01-10T00:00:00.000Z","Adj Close":510.68},{"date":"2013-01-11T00:00:00.000Z","Adj Close":507.55},{"date":"2013-01-14T00:00:00.000Z","Adj Close":489.45},{"date":"2013-01-15T00:00:00.000Z","Adj Close":474.01},{"date":"2013-01-16T00:00:00.000Z","Adj Close":493.69},{"date":"2013-01-17T00:00:00.000Z","Adj Close":490.36},{"date":"2013-01-18T00:00:00.000Z","Adj Close":487.75},{"date":"2013-01-22T00:00:00.000Z","Adj Close":492.4},{"date":"2013-01-23T00:00:00.000Z","Adj Close":501.41},{"date":"2013-01-24T00:00:00.000Z","Adj Close":439.46},{"date":"2013-01-25T00:00:00.000Z","Adj Close":429.1}]' It would probably be nice to either include the index in the |
Closed
closing as dupe of #17394 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Duplicate Report
Duplicate issue or pull request
Enhancement
IO JSON
read_json, to_json, json_normalize
The above code gives the following result:
What I want is:
This is useful when using D3JS, and potentially many more places.
The text was updated successfully, but these errors were encountered: