8000 read_html: Handle colspan and rowspan by adamhooper · Pull Request #21487 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

read_html: Handle colspan and rowspan #21487

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

Merged
merged 14 commits into from
Jul 5, 2018
Merged
Prev Previous commit
Next Next commit
Comments: Notes after Returns
  • Loading branch information
adamhooper committed Jul 3, 2018
commit d4f4bb1ade73278d97daf1fee08575227dbd8fb1
26 changes: 13 additions & 13 deletions pandas/io/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,14 @@ def _parse_thead_tbody_tfoot(self, table_html):
"""
Given a table, return parsed header, body, and foot.

Parameters
----------
table_html : node-like

Returns
-------
tuple of (header, body, footer), each a list of list-of-text rows.

Notes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put Notes at the end (after Parameters / Returns)

-----
Header and body are lists-of-lists. Top level list is a list of
Expand All @@ -391,14 +399,6 @@ def _parse_thead_tbody_tfoot(self, table_html):
all elements inside row are <th>
- Move rows from bottom of body to footer only if
all elements inside row are <th>

Parameters
----------
table_html : node-like

Returns
-------
tuple of (header, body, footer), each a list of list-of-text rows.
"""

header_rows = self._parse_thead_tr(table_html)
Expand Down Expand Up @@ -426,11 +426,6 @@ def _expand_colspan_rowspan(self, rows):
"""
Given a list of <tr>s, return a list of text rows.

Notes
-----
Any cell with ``rowspan`` or ``colspan`` will have its contents copied
to subsequent cells.

Parameters
----------
rows : list of node-like
Expand All @@ -440,6 +435,11 @@ def _expand_colspan_rowspan(self, rows):
-------
list of list
Each returned row is a list of str text.

Notes
-----
Any cell with ``rowspan`` or ``colspan`` will have its contents copied
to subsequent cells.
"""

all_texts = [] # list of rows, each a list of str
Expand Down
0