In this video, we'll show you how to level up your data storage skills with Python. We'll use SQLite3 to store data in a single file, making it easy to access and manage.
Data storage is important for any digital project, and it's a skill that can be developed with a little bit of effort. In this video, we'll show you how to use Python and SQLite3 to store data in a single file, making it easy to access and manage. If you're looking to level up your data storage skills, be sure to check out this video!
Full code used in the video is:
import pandas as pd
import sqlite3
# Step 1: Read the data to a dataframe
path = r"yourfilepath/here/.xlsx"
df = pd.read_excel(path)
# # WRITING DATA TO SQLITE3
step 2: create or connect to a database
conn = sqlite3.connect('test.db')
step 3: read the data to the database
df.to_sql("Average_grades", conn, if_exists='replace', index=False)
#conn.commit()
conn.close()
#Step 4: Read the databack from the database to python
conn = sqlite3.connect('test.db')
df_fromdb = pd.read_sql_query('SELECT * FROM Average_grades', conn)
conn.close()
print(df_fromdb)
On this page of the site you can watch the video online Level Up Your Data Storage Skills with Python with a duration of hours minute second in good quality, which was uploaded by the user FinTech Analyst Academy 28 August 2023, share the link with friends and acquaintances, this video has already been watched 135 times on youtube and it was liked by 6 viewers. Enjoy your viewing!