In [1]:
from markdown_it import MarkdownIt
md = MarkdownIt().enable('table')
text = ("""
| Primer1 | Primer2 | Target | Template |
|---------|---------|--------|--------------|
| 1113 | 987 | ampR | pBR322.gb |
| 1196 | 1195 | pBR | pBR322.gb |
| 984 | 983 | 2µ | YEplac112.gb |
| 980 | 979 | LEU2 | YEplac181.gb |
| 978 | 977 | CRP∆ | pYPKpw.gb |
""")
In [2]:
from pandas import read_html
In [3]:
md.parse(text)
html_table = md.render(text)
dfrm, *rest = read_html(html_table)
In [4]:
dfrm
Out[4]:
Primer1 | Primer2 | Target | Template | |
---|---|---|---|---|
0 | 1113 | 987 | ampR | pBR322.gb |
1 | 1196 | 1195 | pBR | pBR322.gb |
2 | 984 | 983 | 2µ | YEplac112.gb |
3 | 980 | 979 | LEU2 | YEplac181.gb |
4 | 978 | 977 | CRP∆ | pYPKpw.gb |
No comments:
Post a Comment