admin管理员组

文章数量:1403436

I've been going through the pandera docs and I cannot find a way to change the title of an existing pandera.DataFrameSchema. Currently I do the following, which seems to work but feels weird because usually APIs define methods that cleanly change the properties (for instance, I have no way of knowing if changing the title like this causes some unforeseen side effects):

import pandera as pa

dfs1 = pa.DataFrameSchema(
    columns={
        "a": pa.Column(int)
    },
    title="DFS 1 with col 'a'"
)

dfs2 = dfs1.add_columns(
    {"b": pa.Column(int)}
)
dfs2.title = "DFS 2 with cols 'a' & 'b'"

Is it how we're supposed to do or is there some utility somewhere in pandera that I missed?

本文标签: pythonHow to change the title of a DataFrameSchema in panderaStack Overflow