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

order of dataframe columns #22

Closed
mdashkezari opened this issue Jul 11, 2019 · 1 comment
Closed

order of dataframe columns #22

mdashkezari opened this issue Jul 11, 2019 · 1 comment

Comments

@mdashkezari
Copy link

mdashkezari commented Jul 11, 2019

trying to convert json to pandas dataframe. what does set the order of columns?

json_list = [orjson.loads(line) for line in resp.text.splitlines()]
df = pd.DataFrame(json_list)

where resp is a generic response from an API call.

@ijl
Copy link
Owner

ijl commented Jul 12, 2019

loads() deserializes while preserving order. For how that interacts with pandas, it's a question for pandas.

@ijl ijl closed this as completed Jul 12, 2019
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

2 participants