MySQL Forums
Forum List  »  Connector/Python

Python dataframe
Posted by: Алексей Брик
Date: June 04, 2020 03:22AM

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

Options: ReplyQuote


Subject
Written By
Posted
Python dataframe
June 04, 2020 03:22AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.