示例一:
import pandas as pd x = pd.Dataframe({"序号":range(1,6), "水果":["A产品", "苹果", "B产品", "西瓜", "香蕉"], "蔬菜":["白菜", "C产品", "土豆", "D产品", "冬瓜"], "水产":["河虾", "E产品", "F产品", "草鱼", "鲜蚝"], "禽类":[ "鸡蛋", "鸭蛋", "G产品", "鹅蛋", "H广东产品"]}) x
解题:
y = x.replace(r"[A-Z]", "优秀的", regex = True) y
示例二:
import pandas as pd x1 = pd.Dataframe({"序号":range(1,6), "水果":["产品A", "苹果", "产品B", "西瓜", "香蕉"], "蔬菜":["白菜", "产品C", "土豆", "产品D", "冬瓜"], "水产":["河虾", "产品E", "产品F", "草鱼", "鲜蚝"], "禽类":[ "鸡蛋", "鸭蛋", "产品G", "鹅蛋", "广东产品H"]}) x1
解题:
y1 = x1.replace(r"[A-Z]", "好用", regex = True) y1
交互式可视化大屏的概念
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)