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
Exclude columns by index in io.ascii.read() #7451
Comments
Just to understand the use case, why is excluding by name not useful for you? |
I have a code that processes data files in batch mode. Many of these files have either incomplete headers, or no header at all. But most (or all) of them share the column positioning. I understand the importance of a proper header, and I plan to enforce this in future versions of my code. But in the meantime, accessing columns by index is almost the only way. |
I thought |
It assigns names as I already do something like that by creating the column names manually:
|
Glad to know you have a workaround. You are always welcome to contribute if you want to see this feature implemented sooner than later. 😄 |
I'd love to but I think my Python skills are nowhere near the level of the guys developing this (great) package. |
@Gabriel-p Thanks for the suggestion, however, I don't see much benefit given that it only saves you one line of code (the |
I think this could be done in a relatively clean way (from the API perspective) by allowing for From a quick glance at the pure-Python and fast-C reader code this would not be too messy, but that is just a quick glance. To do this in a consistent way will require making the interface uniform for all those exclude/include options for read and write. So with all the implementation, testing, and docs this would be a moderate effort patch. I would propose to leave this open if someone wants to tackle it. |
BTW @Gabriel-p, there is no better way to improve your Python skills than trying to make a patch to astropy. You will learn a lot and get plenty of free feedback on writing better code! |
And you just start by grepping for |
Currently the read() module allows to exclude columns from the output table via the
exclude_names
parameter.I'd like to be able to exclude columns by index number also. Can this be done at all? If not, could it be added?
The text was updated successfully, but these errors were encountered: