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)
| 156 | |
| 157 | |
| 158 | def _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 | |
| 170 | Term: TypeAlias = PyTablesExpr |