简体   繁体   English

Pandas 返回错误:“系列”对象是可变的,因此它们不能被散列

[英]Pandas returns error: 'Series' objects are mutable, thus they cannot be hashed

I have a problem here, I was trying to find a specific value in my data frame.我有一个问题,我试图在我的数据框中找到一个特定的值。 However I have received this error:但是我收到了这个错误:

TypeError                                 Traceback (most recent call last)
<ipython-input-245-ded282cec75c> in <module>
----> 1 data.iloc(data['Amount'] == '11,99')

~\Anaconda3\lib\site-packages\pandas\core\indexing.py in __call__(self, axis)
    576 
    577         if axis is not None:
--> 578             axis = self.obj._get_axis_number(axis)
    579         new_self.axis = axis
    580         return new_self

~\Anaconda3\lib\site-packages\pandas\core\generic.py in _get_axis_number(cls, axis)
    396     @classmethod
    397     def _get_axis_number(cls, axis):
--> 398         axis = cls._AXIS_ALIASES.get(axis, axis)
    399         if is_integer(axis):
    400             if axis in cls._AXIS_NAMES:

~\Anaconda3\lib\site-packages\pandas\core\generic.py in __hash__(self)
   1796 
   1797     def __hash__(self):
-> 1798         raise TypeError(
   1799             f"{repr(type(self).__name__)} objects are mutable, "
   1800             f"thus they cannot be hashed"

TypeError: 'Series' objects are mutable, thus they cannot be hashed

How can I proceed?我该如何进行?

import pandas as pd 
import matplotlib.pyplot as plt
import numpy as np

data = pd.read_csv('Data.csv', sep = ';')

data.iloc(data['Amount'] == '11,99')

Use data[data['Amount'] == '11,99'] It should work just fine..!使用data[data['Amount'] == '11,99']它应该可以正常工作..!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Pandas loc 错误:“系列”对象是可变的,因此它们不能被散列 - Pandas loc error: 'Series' objects are mutable, thus they cannot be hashed 系列对象是可变的,因此它们不能在 Python pandas 数据帧上散列 - Series objects are mutable, thus they cannot be hashed on Python pandas dataframe Python 和 Pandas:“系列”对象是可变的,因此它们不能被散列 - Python & Pandas: 'Series' objects are mutable, thus they cannot be hashed pandas Python Series对象是可变的,因此它们不能在查询方法中进行散列 - pandas Python Series objects are mutable, thus they cannot be hashed in query method &#39;Series&#39;对象是可变的,因此它们不能在调用to_csv时出现散列错误 - 'Series' objects are mutable, thus they cannot be hashed error calling to_csv 键控错误:“系列”对象是可变的,因此它们不能被散列 - Keying Error: 'Series' objects are mutable, thus they cannot be hashed 在 dataframe 类型错误中出现错误:“系列”对象是可变的,因此无法对其进行哈希处理 - Getting error in dataframe typeError: 'Series' objects are mutable, thus they cannot be hashed 类型错误:“系列”对象是可变的,因此它们不能被散列 - TypeError: 'Series' objects are mutable, thus they cannot be hashed Python:“系列”对象是可变的,因此它们不能被散列 - Python : 'Series' objects are mutable, thus they cannot be hashed “系列”对象是可变的,因此它们不能被散列 - 'Series' objects are mutable, thus they cannot be hashed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM