drop_private_columns

function of dascore.utils.tables source

drop_private_columns(
    frame: DataFrame ,
)-> ‘pd.DataFrame’

Return a table without the columns which say they are not its own.

A header beginning with an underscore declines to take part in the format reading it: the column is the crew’s own record keeping – who backfilled a trench, which drawing a run came from – and no reader looks for meaning in it. The name can never collide with a field a model might later add, since pydantic makes a leading underscore a private attribute rather than a field.

The values live in the file alone. A note which should travel with the data belongs in a field the model has, description among them.

Parameters

Parameter Description
frame The table to read the private columns out of.

Examples

import pandas as pd
from dascore.utils.tables import drop_private_columns
frame = pd.DataFrame({"group": ["rail"], "_crew": ["mapped by JD"]})
list(drop_private_columns(frame).columns)
['group']