Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Split cell into new rows, not just new columns. #386
I propose a feature that would allow the use of regex to split a fields into new rows. Currently, it's only possible to create new columns afaik, which causes a potential problem when the split yields different numbers of new data elements for every case. Simple Example:
I'd be happy to give it a try if it doesn't already exist. Looking for suggestion on how to implement, but I imagine it as some type of parameter you could pass to the split method.
Apologies for the slow reply, just back from conferences.
I think this is a nice idea, very happy to review a PR.
I'd suggest a new function called something like "splitdown" or "splitmany"
Function signature something like:
def splitdown(table, field, pattern, maxsplit=0, flags=0)
If you look at the source of the petl.transform.regex module you'll see the
In this case you want a row iterator function something like (untested):
def itersplitdown(source, field, pattern, maxsplit, flags):
Hope that's comprehensible! Obviously a unit test would be very nice too.
On Thursday, September 8, 2016, Hexatonic firstname.lastname@example.org wrote: