Uploaded November 2020 | Updated September 2026, 3 days ago
Solving real world data science tasks by automating this common data science task will save you hours of work. I'll cover how to write a python script to import a CSV or Excel file to a database. In this video Iβll specifically be showing you how to import a CSV file to a postgres database on AWS. Importing CSV files to a database is a common task needed for data science and analytics and it can be done completely with python using pandas dataframes, numpy, os library, and the posgres database wrapper psycopg2.
Here's the github repo: github.com/Strata-Scratch/csv_to_db_automation
This python script is completely manual. Part 2 where I completely refactor the python script so that our code can handle multiple files without changing a line of python code can be found here (youtu.be/TDwy1lSjEZo).
This is also my first python video so please leave a comment and let me know what you think. Did I cover the concepts in detail? Do you want more detail? Less? Was the code too small to read? Any feedback would be appreciated!
Topics Covered:
- How to read your CSV file into a pandas dataframe
- How to clean the table name and column headers using methods like replace() and lower()
- How to convert your pandas dataframe to a CSV file
- How to create a database table and import your CSV file to a postgres database on Amazon Web Services (AWS) in python
______________________________________________________________________
Resources:
- How to setup Anaconda: docs.anaconda.com/anaconda/install
- How to install psygopg2: anaconda.org/anaconda/psycopg2
π Subscribe to my channel: bit.ly/2GsFxmA
π Practice real data science interview questions: platform.stratascratch.com/coding?utm_source=youtube&utm_medium=click&utm_campaign=YT+description+link
______________________________________________________________________
Timestamps:
Intro: (0:00)
Outlining steps & import python libraries: (2:23)
Reading your CSV file as a pandas dataframe: (4:31)
Cleaning your table name: (6:03)
Cleaning your column names: (10:25)
Generating SQL query to create database table: (12:40)
Connecting to your database: (19:04)
Generating SQL queries to import CSV file to database: (21:53)
Double checking file was imported correctly: (30:50)
Conclusion: (31:47)
______________________________________________________________________
Contact:
If you have any questions, comments, or feedback, please leave them here!
Feel free to also email me at nathan@stratascratch.com
______________________________________________________________________
Solving real world data science tasks by automating this common data science task will save you hours of work. I'll cover how to write a python script to import a CSV or Excel file to a database. In this video Iβll specifically be showing you how to import a CSV file to a postgres database on AWS. Importing CSV files to a database is a common task needed for data science and analytics and it can be done completely with python using pandas dataframes, numpy, os library, and the posgres database wrapper psycopg2.
Here's the github repo: github.com/Strata-Scratch/csv_to_db_automation
This python script is completely manual. Part 2 where I completely refactor the python script so that our code can handle multiple files without changing a line of python code can be found here (youtu.be/TDwy1lSjEZo).
This is also my first python video so please leave a comment and let me know what you think. Did I cover the concepts in detail? Do you want more detail? Less? Was the code too small to read? Any feedback would be appreciated!
Topics Covered:
- How to read your CSV file into a pandas dataframe
- How to clean the table name and column headers using methods like replace() and lower()
- How to convert your pandas dataframe to a CSV file
- How to create a database table and import your CSV file to a postgres database on Amazon Web Services (AWS) in python
______________________________________________________________________
Resources:
- How to setup Anaconda: docs.anaconda.com/anaconda/install
- How to install psygopg2: anaconda.org/anaconda/psycopg2
π Subscribe to my channel: bit.ly/2GsFxmA
π Practice real data science interview questions: platform.stratascratch.com/coding?utm_source=youtube&utm_medium=click&utm_campaign=YT+description+link
______________________________________________________________________
Timestamps:
Intro: (0:00)
Outlining steps & import python libraries: (2:23)
Reading your CSV file as a pandas dataframe: (4:31)
Cleaning your table name: (6:03)
Cleaning your column names: (10:25)
Generating SQL query to create database table: (12:40)
Connecting to your database: (19:04)
Generating SQL queries to import CSV file to database: (21:53)
Double checking file was imported correctly: (30:50)
Conclusion: (31:47)
______________________________________________________________________
Contact:
If you have any questions, comments, or feedback, please leave them here!
Feel free to also email me at nathan@stratascratch.com
______________________________________________________________________

![Using Python Pandas for Building Ubers Business Models [Part 3]
Welcome to the final episode in our Uber Data Science Project Series! In this video, we dive into solving Ubers Partner Business Modeling data project using Python to filter data and find the answers. Specifically, we tackle scenario two, where we calculate the net earnings per year of a taxi driver who generates $200 per day before expenses. We also calculate how much the drivers gross fares need to increase per week to fully pay for a $40,000 car and maintain the same yearly profit as before, assuming the driver partners with Uber. Join us as we walk you through the process and share the exciting final results of this data project. Dont forget to subscribe and hit the notification bell to stay updated on our latest content.
Watch our previous video:
π Part 1: Exploratory Data Analysis For An Uber Python Data Science Project: https://youtu.be/ZOthTms86Bw
π Part 2: Using Python Pandas To Answer Business Questions For An Uber Data Science Project: https://www.youtube.com/watch?v Lzi4Qoy2v4
π§βπ» Go to the question through the link below and follow along with us: https://platform.stratascratch.com/data-projects/partner-business-modeling?utm_source=youtube&utm_medium=click&utm_campaign=YT+partner+business+modeling+uber+project+3
π Subscribe to my channel: https://bit.ly/2GsFxmA
π Playlist for more data science interview questions and answers: https://bit.ly/3jifw81
π Playlist for data science interview tips: https://bit.ly/2G5hNoJ
π Practice more real data science interview questions: https://platform.stratascratch.com/coding?utm_source=youtube&utm_medium=click&utm_campaign=YT+partner+business+modeling+uber+project+3
Timeline:
Intro: (0:00βββ)
Exploring and understanding the data: (0:15)
Coding the solution: (1:26ββ)
Conclusion: (β8:46)
About The Platform:
Im using StrataScratch (https://platform.stratascratch.com/coding?utm_source=youtube&utm_medium=click&utm_campaign=YT+partner+business+modeling+uber+project+3), a platform that allows you to practice real data science interview questions. There are over 1000+ interview questions that cover coding (SQL and python), statistics, probability, product sense, and business cases.
So, if you want more interview practice with real data science interview questions, visit https://platform.stratascratch.com/coding?utm_source=youtube&utm_medium=click&utm_campaign=YT+partner+business+modeling+uber+project+3. All questions are free and you can even execute SQL and python code in the IDE, but if you want to check out the solutions from me or from other users, you can use ss15 for a 15% discount on the premium plans.
Contact:
If you have any questions, comments, or feedback, please leave them here!
Feel free to also email me at nathan@stratascratch.com
#PythonDataProject #DataScienceProject #UberDataScienceProject Using Python Pandas for Building Ubers Business Models [Part 3]](https://i.ytimg.com/vi/xlppLbv7nb0/mqdefault.jpg)



![Data Science SQL Scenario Based Interview Question [Facebook] - Date Manipulation
This Data Science SQL interview question is from Facebook, and tests your ability to filter out data based on date conditionals. Iβll walk you through solving the question like weβre in an interview and give you some tips on how to approach the solution as well as how to efficiently and effectively communicate with your interviewer.
Go to the question through the link below and follow along with me.
Link to the question: https://platform.stratascratch.com/coding/2004-number-of-comments-per-user-in-past-30-days?python=&utm_source=youtube&utm_medium=click&utm_campaign=YT+description+link
π Subscribe to my channel: https://bit.ly/2GsFxmA
π Playlist for more data science interview questions and answers: https://bit.ly/3jifw81
π Playlist for data science interview tips: https://bit.ly/2G5hNoJ
π Practice more real data science interview questions: https://platform.stratascratch.com/coding?utm_source=youtube&utm_medium=click&utm_campaign=YT+description+link
Timeline:
Intro: (0:00βββ)
Interview Question: (0:33ββ)
Framework to solve the problem: (1:08βββ)
Understand your data: (2:25βββ)
Formulate your approach: (4:16βββ)
Code Execution: (6:15βββ)
Additional Technical Concepts: (11:56βββ)
Conclusion: (14:40βββ)
About The Platform:
Im using StrataScratch (https://platform.stratascratch.com/coding?utm_source=youtube&utm_medium=click&utm_campaign=YT+description+link), a platform that allows you to practice real data science interview questions. There are over 1000+ interview questions that cover coding (SQL and python), statistics, probability, product sense, and business cases.
So, if you want more interview practice with real data science interview questions, visit https://platform.stratascratch.com/coding?utm_source=youtube&utm_medium=click&utm_campaign=YT+description+link. All questions are free and you can even execute SQL and python code in the IDE, but if you want to check out the solutions from me or from other users, you can use ss15 for a 15% discount on the premium plans.
Contact:
If you have any questions, comments, or feedback, please leave them here!
Feel free to also email me at nathan@stratascratch.com
#FacebookDataScienceInterview Data Science SQL Scenario Based Interview Question [Facebook] - Date Manipulation](https://i.ytimg.com/vi/yY7yau9j3xk/mqdefault.jpg)

![Edge Case Alert in Python Interview Question Solving [Part 2]
In this video, well discuss how to solve a Meta interview question that involves filling the null values with zeros. By learning this technique, youll be able to identify and solve problems by using the fillna() function. So be sure to subscribe to our channel and stay up to date on the effective approach for solving Python interview questions.
Part 1: https://www.youtube.com/shorts/9quwCoQ6CoU
Go to the question through the link below and follow along with meπ
Link to the question: https://platform.stratascratch.com/coding/2123-product-families?code_type=1&utm_source=youtube&utm_medium=click&utm_campaign=YT+description+link
π Watch the full video: https://youtu.be/RmMuS5iiviI
π Subscribe to my channel: https://bit.ly/2GsFxmA
π Playlist for more data science interview questions and answers: https://bit.ly/3jifw81
π Playlist for data science interview tips: https://bit.ly/2G5hNoJ
π Practice more real data science interview questions: https://platform.stratascratch.com/coding?utm_source=youtube&utm_medium=click&utm_campaign=YT+description+link
About The Platform:
Im using StrataScratch (https://platform.stratascratch.com/coding?utm_source=youtube&utm_medium=click&utm_campaign=YT+description+link), a platform that allows you to practice real data science interview questions. There are over 1000+ interview questions that cover coding (SQL and python), statistics, probability, product sense, and business cases.
So, if you want more interview practice with real data science interview questions, visit https://platform.stratascratch.com/coding?utm_source=youtube&utm_medium=click&utm_campaign=YT+description+link. All questions are free and you can even execute SQL and python code in the IDE, but if you want to check out the solutions from me or from other users, you can use ss15 for a 15% discount on the premium plans.
Contact:
If you have any questions, comments, or feedback, please leave them here!
Feel free to also email me at nathan@stratascratch.com
#DataAnalytics #PythonInterviewQuestions #Stratascratch Edge Case Alert in Python Interview Question Solving [Part 2]](https://i.ytimg.com/vi/yoUO84tOH3c/mqdefault.jpg)
