import pandas as pd
import numpy as np
df = pd.DataFrame({'Li':[[1,2],[5,6],[8,9]],'Tu':[(1,2),(5,6),(8,9)]}
df
Li Tu
0 [1, 2] (1, 2)
1 [5, 6] (5, 6)
2 [8, 9] (8, 9)
工作正常Tuple
df.Tu == (1,2)
0 True
1 False
2 False
Name: Tu, dtype: bool
当List它给出值错误时
df.Li == [1,2]
ValueError:长度必须匹配才能进行比较
蝴蝶不菲
PIPIONE
一只斗牛犬
相关分类