- 先贴代码
- 遇到的困难
import pandas as pd
df=pd.read_table('/Users/Downloads/no2.txt')
df1=df.drop_duplicates() #清除重复卡号
df1.columns = ['no'] #自定义列名
df1=df1.head(1001)
def mtype(x): #转str
t=str(x)
return t
df1['no']=df1['no'].apply(mtype)
df2=df1['no'].to_list()#转数组
str(df2).replace(''', '"')#单引号改双引号
遇到的困难
已经很久没有写python了
测试需要一次上传1000个卡号,如果靠复制粘贴手不用要了。。。
努力下发现,其实靠百度和dir()还有help()已经能解决了,问题不大



