MCPcopy
hub / github.com/pandas-dev/pandas / _ensure_str

Function _ensure_str

pandas/io/pytables.py:158–167  ·  view source on GitHub ↗

Ensure that an index / column name is a str (python 3); otherwise they may be np.string dtype. Non-string dtypes are passed through unchanged. https://github.com/pandas-dev/pandas/issues/13492

(name)

Source from the content-addressed store, hash-verified

156
157
158def _ensure_str(name):
159 """
160 Ensure that an index / column name is a str (python 3); otherwise they
161 may be np.string dtype. Non-string dtypes are passed through unchanged.
162
163 https://github.com/pandas-dev/pandas/issues/13492
164 """
165 if isinstance(name, str):
166 name = str(name)
167 return name
168
169
170Term: TypeAlias = PyTablesExpr

Callers 1

read_index_nodeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected