我通过两个值分组创建了一个pandas数据帧,并收到一个类似于下面的表:
接下来,我按A列分组,计算出每个数字列表中有多少个唯一的名字,并收到以下错误:
Exception ignored in: 'pandas._libs.index.IndexEngine._call_map_locations' Traceback (most recent call last): File "pandas\_libs\hashtable_class_helper.pxi", line 4588, in > pandas._libs.hashtable.PyObjectHashTable.map_locations TypeError: unhashable type: 'numpy.ndarray'
当我被返回一个索引为numpy数组类型的pandas系列时,我感到困惑。为什么在本例中忽略了异常
尝试通过
df['Column A'].map(tuple)
或df['Column A'].map(str)
将列表转换为元组相关问题 更多 >
编程相关推荐