我有一个这种格式的字符串:"A1","B1","C1","D1","E1","F1","G1","H1"\n"A2","B2","C2","D2","E2","F2" 等等其中 A 到 H 是列,数字是指行。我正在寻找创建熊猫数据框的最快方法。我尝试过的一个很长的(及时完成)方法是使用:df = pd.DataFrame()for row in data: reader = csv.reader(row) mylist = [] for element in reader: if element!=['','']: mylist.append(element[0]) df2 = pd.DataFrame([mylist]) df = df.append(df2)我正在寻找更快的方法。
添加回答
举报
0/150
提交
取消