Quantcast
Channel: MySQL Forums - Connector/Python
Viewing all articles
Browse latest Browse all 384

Python dataframe (no replies)

$
0
0
Hello. Can you help me?
How insert into dataframe column which contains sequence number order for each client: first order =1 second=2.
I have table orders: columns orderid clientid orderinfo date.

frame=pd.read_sql
frame=pd.read_sql("select * from orders where orderinfo not like '%[T%]%' ",
connection);
df = pd.DataFrame(frame);
df.to_csv('D:/database/test1.csv', sep=';', index=0, line_terminator='\n',
quotechar='"');

data example

orderid orderinfo clientid date
4250037527046 458708113298 2020-05-01 00:00:00
4250037527047 458705145222 2020-05-01 00:00:00
4250037527048 458708113329 2020-05-01 00:00:00
4250037527049 [SO] 458707075471 2020-05-01 00:00:00
4250037527051 458700617579 2020-05-01 00:00:00

Viewing all articles
Browse latest Browse all 384

Trending Articles