from pandas import DataFrame

df = DataFrame([[11,13,12], [20,22,23]])
df = df.astype(str)
select = df.applymap(lambda x: "3" in x)  # 字符串内识别
select = df.apply(lambda row: row.str.contains("3"), axis=1)  # 也是字符串内识别
select = df.apply(lambda row: any(row == "13"), axis=1)  # 单元格识别
# str.contains, ==
# replace, str.replace
print(select)
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.