drop_private_columns

function of dascore.utils.tables source

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

Drop columns whose names begin with an underscore.

These columns hold private notes that stay in the file and are ignored by the format. Their names cannot collide with model fields because pydantic treats leading underscores as private attributes. Notes that should travel with the data belong in a model field such as description.

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']