![]() We connect to the SQLite database using the line: ![]() Query = "SELECT country FROM Population WHERE population > 50000000 " SQLite dataset created from scriptĪn SQL query result can directly be stored in a panda dataframe: It creates the SQLite database containing one table with dummy data. We create a simple dataset using this code:Ĭur.execute( "CREATE TABLE Population(id INTEGER PRIMARY KEY, country TEXT, population INT)")Ĭur.execute( "INSERT INTO Population VALUES(NULL,'Germany',81197537)")Ĭur.execute( "INSERT INTO Population VALUES(NULL,'France', 66415161)")Ĭur.execute( "INSERT INTO Population VALUES(NULL,'Spain', 46439864)")Ĭur.execute( "INSERT INTO Population VALUES(NULL,'Italy', 60795612)") We’ll also briefly cover the creation of the sqlite database table using Python. ![]() In this article we’ll demonstrate loading data from an SQLite database table into a Python Pandas Data Frame. An SQLite database can be read directly into Python Pandas (a data analysis library). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |