MCPcopy Create free account
hub / github.com/datapane/datapane / str_to_arrow_str

Function str_to_arrow_str

python-client/src/datapane/common/df_processor.py:129–133  ·  view source on GitHub ↗

Use the memory-efficient pyarrow string dtype (pandas >= 1.3 only)

(df: pd.DataFrame)

Source from the content-addressed store, hash-verified

127
128
129def str_to_arrow_str(df: pd.DataFrame):
130 """Use the memory-efficient pyarrow string dtype (pandas >= 1.3 only)"""
131 # convert objects to str / NA
132 df_str = df.select_dtypes("string")
133 df[df_str.columns] = df_str.astype("string[pyarrow]")
134
135
136def process_df(df: pd.DataFrame, copy: bool = False) -> pd.DataFrame:

Callers 2

load_fileMethod · 0.85
process_dfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected