MySQL Forums
Forum List  »  Connector/Python

accessing data in python application
Posted by: victoria mawson
Date: July 10, 2018 05:48AM

Ive successfully connected mysql to Visual studio with the 'MySQL for visual studio' and 'Connector/Python' add ons. I am able to see my database connection in the server explorer and open tables within the database. However i am struggling to be able to make the connection within my written code (i need to run algorithms on the data). My inital idea was to create a dataframe with all the data and run algorthims on that. I ran the following code:


and received an sqlalchemy interface error- data source name not found and no default driver specified.

I also tried:

the_frame=pd.read_sql_query("SELECT * FROM %s;" %new_event_data, engine)
the_frame=pd.read_sql_table(new_event_data, engine)

which resulted in an error of 'new_event_data' is not specified.

There seems to be an issue making the connection between my code and the data. The full path for the data from the mysql database which was imported into visual studio is : DataExplorer://Localhost(databasename)/Table/new_event_data

Any tips on getting the data into a suitable format to access in ML algorthims? eg dataframe etc. Many thanks.

Options: ReplyQuote

Written By
accessing data in python application
July 10, 2018 05:48AM

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.