You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think Grid Tables would be best for pandas (or Simple Tables)
I did not use sudo-code in the examples due to complexity and that examples of how to do this can be seen in the above packages. See RST docs for what they look like.
The text was updated successfully, but these errors were encountered:
import pandas as pd
from tabulate import tabulate
from docutils.parsers.rst import tableparser
from docutils.statemachine import StringList
def read_rst(rst_string):
parser = tableparser.GridTableParser()
table_data = parser.parse(StringList(rst_string.splitlines()))
header = ["".join(cell) for cell in table_data[0]]
rows = [[cell[0] for cell in row] for row in table_data[1]]
return pd.DataFrame(rows, columns=header)
Feature Type
Adding new functionality to pandas
Changing existing functionality in pandas
Removing existing functionality in pandas
Problem Description
I wish I could use ReStructured Text with pandas
Feature Description
The end users code:
I believe tabulate has a way to do this.
Alternative Solutions
I also built a way to make rst tables.
Additional Context
I think
Grid Tables
would be best for pandas (orSimple Tables
)I did not use sudo-code in the examples due to complexity and that examples of how to do this can be seen in the above packages. See RST docs for what they look like.
The text was updated successfully, but these errors were encountered: