Test whether a key is a column label reference To be considered a column label reference, `key` must match the name of at least one column.
(df, key)
| 656 | |
| 657 | |
| 658 | def _is_column_label_reference(df, key): |
| 659 | """ |
| 660 | Test whether a key is a column label reference |
| 661 | |
| 662 | To be considered a column label reference, `key` must match the name of at |
| 663 | least one column. |
| 664 | """ |
| 665 | return ( |
| 666 | not isinstance(key, Expr) |
| 667 | and (np.isscalar(key) or pd.api.types.is_scalar(key) or isinstance(key, tuple)) |
| 668 | and key in df.columns |
| 669 | ) |
| 670 | |
| 671 | |
| 672 | def _contains_index_name(df, columns_or_index): |
no outgoing calls
no test coverage detected