标签:interface 根据 包含 sel pandas 接口 and type l数据库
根据列title的是否包含特定词,来赋值给新的列1或0的值
bugInfo[‘IntegrationTest‘] = bugInfo.apply(lambda x: self.bug_rule(x, "IntegrationTest"), axis = 1) def bug_rule(self, frame, type): # 处理列表中的数据,更新到sql数据库中 result = "0" if type == "SmokeTest": # 冒烟测试 if re.search("^\[冒烟\]|\[冒烟测试\]|【冒烟】|【冒烟测试】", frame["title"]): result = "1" elif type == "InterfaceTest": # 接口测试 if re.search("^\[接口\]|\[接口测试\]|【接口】|【接口测试】", frame["title"]): result = "1" elif type == "IntegrationTest": # 集成测试 if self.IntegrationTime != "" and self.IntegrationTime == frame["created_time"]: result = "1" return result
标签:interface 根据 包含 sel pandas 接口 and type l数据库
原文地址:https://www.cnblogs.com/insane-Mr-Li/p/13231805.html