|
楼主 |
发表于 2024-5-13 21:19:38
|
显示全部楼层
报错:
Traceback (most recent call last):
File "D:\PycharmProjects\.venv\Lib\site-packages\pandas\core\ops\array_ops.py", line 362, in na_logical_op
result = op(x, y)
^^^^^^^^
File "D:\PycharmProjects\.venv\Lib\site-packages\pandas\core\roperator.py", line 54, in rand_
return operator.and_(right, left)
^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: unsupported operand type(s) for &: 'int' and 'str'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\PycharmProjects\.venv\Lib\site-packages\pandas\core\ops\array_ops.py", line 376, in na_logical_op
result = libops.scalar_binop(x, y, op)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "ops.pyx", line 210, in pandas._libs.ops.scalar_binop
File "D:\PycharmProjects\.venv\Lib\site-packages\pandas\core\roperator.py", line 54, in rand_
return operator.and_(right, left)
^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: unsupported operand type(s) for &: 'bool' and 'str'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\PycharmProjects\Ylqx20240509\Ylqx2024050903.py", line 1199, in on_combobox_selection
filtered_data = df[df['级别'] == level &
^^^^^^^
File "D:\PycharmProjects\.venv\Lib\site-packages\pandas\core\ops\common.py", line 76, in new_method
return method(self, other)
^^^^^^^^^^^^^^^^^^^
File "D:\PycharmProjects\.venv\Lib\site-packages\pandas\core\arraylike.py", line 74, in __rand__
return self._logical_method(other, roperator.rand_)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\PycharmProjects\.venv\Lib\site-packages\pandas\core\series.py", line 6121, in _logical_method
res_values = ops.logical_op(lvalues, rvalues, op)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\PycharmProjects\.venv\Lib\site-packages\pandas\core\ops\array_ops.py", line 454, in logical_op
res_values = na_logical_op(lvalues, rvalues, op)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\PycharmProjects\.venv\Lib\site-packages\pandas\core\ops\array_ops.py", line 385, in na_logical_op
raise TypeError(
TypeError: Cannot perform 'rand_' with a dtyped [object] array and scalar of type [bool] |
|