Skip to content

Commit

Permalink
Merge 22adc64 into d819ceb
Browse files Browse the repository at this point in the history
  • Loading branch information
alimanfoo committed Aug 6, 2019
2 parents d819ceb + 22adc64 commit 9910709
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
3 changes: 3 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Version 1.3.0
in a similar way to :func:`petl.util.timing.progress` but writes to a Python logger.
By :user:`dusktreader`, :issue:`408`, :issue:`407`.

* Added new function :func:`petl.transform.regex.splitdown` for splitting a value into
multiple rows. By :user:`John-Dennert`, :issue:`430`, :issue:`386`.

* Pass through keyword arguments to :func:`xlrd.open_workbook`. By :user:`gjunqueira`,
:issue:`470`, :issue:`473`.

Expand Down
2 changes: 1 addition & 1 deletion petl/transform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from petl.transform.fills import filldown, fillright, fillleft

from petl.transform.regex import capture, split, search, searchcomplement, \
sub
sub, splitdown

from petl.transform.reshape import melt, recast, transpose, pivot, flatten, \
unflatten
Expand Down
20 changes: 10 additions & 10 deletions petl/transform/regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,28 +391,28 @@ def splitdown(table, field, pattern, maxsplit=0, flags=0):
... ['Jane Doe', 'president,engineer,tailor,lawyer'],
... ['John Doe', 'rocket scientist,optometrist,chef,knight,sailor']]
>>> table2 = etl.splitdown(table1, 'roles', ',')
>>> table2
>>> table2.lookall()
+------------+--------------------+
| name | roles |
+============+====================+
| 'Jane Doe' | 'president' |
+------------+-----+--------------+
+------------+--------------------+
| 'Jane Doe' | 'engineer' |
+------------+-----+--------------+
+------------+--------------------+
| 'Jane Doe' | 'tailor' |
+------------+-----+--------------+
+------------+--------------------+
| 'Jane Doe' | 'lawyer' |
+------------+-----+--------------+
+------------+--------------------+
| 'John Doe' | 'rocket scientist' |
+------------+-----+--------------+
+------------+--------------------+
| 'John Doe' | 'optometrist' |
+------------+-----+--------------+
+------------+--------------------+
| 'John Doe' | 'chef' |
+------------+-----+--------------+
+------------+--------------------+
| 'John Doe' | 'knight' |
+------------+-----+--------------+
+------------+--------------------+
| 'John Doe' | 'sailor' |
+------------+-----+--------------+
+------------+--------------------+
"""

Expand Down

0 comments on commit 9910709

Please sign in to comment.