ENH: Add commented_names parameter to genfromtxt #31984
ENH: Add commented_names parameter to genfromtxt #31984Aniketsy wants to merge 4 commits into
commented_names parameter to genfromtxt #31984Conversation
|
ahh, i think this needs stub update as well, (moving in draft for now) , needs to update docstring too |
|
Note that new features and expanding the NumPy API surface requires checking in with the numpy-discussion mailing list: |
|
You also need to add docs and a release note for this to be mergeable. |
ah yes, i had in mind for release note, but i was aiming to add in last after review 😀 I'll update with the docs and release note . Thanks :) |
sorry i didn't get this you mean discussing the new feature in the mailing list. Reason, i avoided mentioning anywhere, i thought you're busy with conferences i guess, and also there are lot PRs , so it may take sometime to get review. so its better to wait 😊 . |
| Reading names from a comment line | ||
|
|
||
| >>> s = StringIO('''# a b c | ||
| ... 1 2 3 | ||
| ... 4 5 6''') | ||
| >>> np.genfromtxt(s, names=True, commented_names=True, | ||
| ... dtype=None, encoding=None).dtype.names | ||
| ('a', 'b', 'c') | ||
|
|
There was a problem hiding this comment.
Don't have strong thoughts on this if we need.
Either way is fine i think, we can keep or remove, happy to know thoughts
|
@ngoldbaum gentle ping, i've updated with release note and with some improvement. please review these when you get chance . Thanks ;) |
Fixes #389
PR summary
i followed @WarrenWeckesser suggestion
added a new
commented_namesoption togenfromtxtso we can control exactly where it look for column names, instead of guessing based on comments.set
commented_names=Trueto grab the names from the last comment line before the data starts orcommented_names=Falseto skip all commentsleft the default behaviour
commented_names=NoneunchangedAs its quite old issue (2012) , excited to move forward with this 😀
First time committer introduction
AI Disclosure
So lets call this work done by Semi-human