13.如何拆分含有多种分隔符的字符串 import re s = "23:41:2314\1234#sdf\23;" print(re.split(r'[#:\;]+',s)) 14.如何判断字符串a是否以字符串b开头或结尾 import os,stat #找到当前目录下的文件名称,返回list ret = os.listdir('.') print(ret) for x in ret: #endswith传参类型是tuple if x.endswith(('.py','.html'
逗号分隔的字符串转换为行数据(collection) CREATE OR REPLACE FUNCTION "GET_STR_TAB" (v_str in varchar2) return table_str pipelined as v_new_str ); begin if v_str is null then ); else v_new_str:),),''); loop then pipe row(to_number(v_new_str)); exit; else ,instr
删除df中任意字段等于'null'字符串的行: df=df.astype(str)#把df所有元素转为str类型 df=df[df['A'].isin(['null','NULL'])] #找出df的'A'列值为'null'或'NULL'(注意此处的null是字符串,不是空值) df=df[~df['A'].isin(['null','NULL'])] #过滤掉A列为'null'或'NULL'的行,~表示取反 去掉任意一列为'null'值的行,目前只能想到用循环: for col in list