read_table

function of dascore.utils.tables source

read_table(
    path: Path ,
    what: str = nothing,
    skip: int = 0,
)-> ‘pd.DataFrame’

Read one strict CSV table.

Return cells as text for the caller to convert. Only empty cells are null; NA remains a string.

Parameters

Parameter Description
path The CSV file to read.
what What a table with no columns fails to state, for that error message.
skip Number of lines to skip before parsing the header. Error row numbers still count
from the top of the file.

Examples

import tempfile
from pathlib import Path
from dascore.utils.tables import read_table
with tempfile.TemporaryDirectory() as folder:
    path = Path(folder) / "coupling.csv"
    _ = path.write_text("group,value\nrail,true\n")
    frame = read_table(path)
list(frame.columns), frame["value"][0]
(['group', 'value'], 'true')