effective_pandas_book
effective_pandas_book copied to clipboard
query engine fails p182
The code at the top of p182:
(jb2
.query("team_size.isna()")
.employment_status
.value_counts(dropna=False)
)
Can fail with:"TypeError: unhashable type: 'Series'"
Running Python v3.9.7 and Pandas 1.3.4 with latest Anaconda install.
Cause: 'numexpr' is default query engine if installed which appears so with Anaconda.
See (ref).
Solution: add engine='python' to query arguments.