Here's the sqlite query which i need to execute to store the output into a csv file using pandas.io.sql:
sql2 = "select raw_contact_id as ID, group_concat(data1) as DETAILS from data group by raw_contact_id"
table2 = sql.read_frame(sql2, conn2)
table2.to_csv(cont_output, headers=True, index=False, encoding="utf8")
But I get the output as this:
ID | DETAILS |
1346 | A | P
1347 | B | Q
1349 | C | R
1350 | D | S
The DETAILS column is getting split into two columns in the csv file. When I execute this query in terminal I get the proper output with all the details under the DETAILS column. What is wrong with this query execution?
Aucun commentaire:
Enregistrer un commentaire