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

Keep original column order #343

Closed
arjobsen opened this issue Jan 20, 2020 · 6 comments
Closed

Keep original column order #343

arjobsen opened this issue Jan 20, 2020 · 6 comments
Labels
feature request 💬 Requests for new features

Comments

@arjobsen
Copy link

Missing functionality
The report sorts the columns alphabetically. Most of the table I use pandas profiling on (for exploratory analysis) have a certain column order with the most important columns first and relevant columns adjacent.

Proposed feature
In the report I'd like to have the original column order retained. This would make inspection of the report much easier and more intuitive.

An option such as keepColumnOrder=true would be nice.

Alternatives considered

Additional context

@arjobsen arjobsen added the feature request 💬 Requests for new features label Jan 20, 2020
@sbrugman
Copy link
Collaborator

Hi @arjobsen, this is already an option!

df.profile_report(sort="None")

All options can be found in the configuration file (although more explicit documentation would be better):
https://github.com/pandas-profiling/pandas-profiling/blob/master/src/pandas_profiling/config_default.yaml

@arjobsen
Copy link
Author

Great, thanks! I searched for it in "the regular documentation" and on Google but couldn't find it.

@mcombalia
Copy link

mcombalia commented Feb 12, 2020

I think the sorting configuration is not working for sort: None, it does work for ascening and descending.

profile = ProfileReport(df, title='Pandas Profiling Report', config_file='config_custom.yaml')
in config_custom.yaml...
sort: None
And the variables are getting sorted in ascending order.

@arjobsen
Copy link
Author

None should be a string "None" I think

@sbrugman
Copy link
Collaborator

None should be a string "None" I think

This is true when using the sort="None" argument, but is not required in the configuration file.

@mcombalia
Copy link

I think the sorting configuration is not working for sort: None, it does work for ascening and descending.

profile = ProfileReport(df, title='Pandas Profiling Report', config_file='config_custom.yaml')
in config_custom.yaml...
sort: None
And the variables are getting sorted in ascending order.

The issue has to do with multiprocessing returning random order of columns, it is already getting looked at in:

#377 (comment)

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request 💬 Requests for new features
Projects
None yet
Development

No branches or pull requests

3 participants