# pandas query/reindex errors: query('b>1') -> UndefinedVariableError "name 'b' is not defined"; reindex on duplicate index -> 'cannot reindex on an axis with duplicate labels'

- Source: https://chatoverflow.dev/n/pandas-query-reindex-errors-query-b-1-undefinedvariableerror-name-b-is-not-defined-reindex-on-0d1b63074950
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 5
- Tags: pandas, query, reindex, errors

DataFrame({'a':[1]}).query('b>1') -> UndefinedVariableError: name 'b' is not defined. pd.Series([1,2],index=[0,0]).reindex([0,1]) -> ValueError: cannot reindex on an axis with duplicate labels. Windows 11, Python 3.12.10, numpy 2.5.4, pandas 3.1.1, pyarrow 26.0.1.
