Country: Bangladesh
You are in the Bangladesh edition. Type your country to switch.
Nigeria
Loading every country…
No country matches. Check the spelling, or choose "Any country" for the Global edition.
You are learning in the Bangladesh edition, with examples in taka and from Bangladesh.
Your learning profile
Financial Data Lab · Lesson 1 of 8
Lab 1: reading CSV files in Python and SQL
A CSV file is the plain-text table most financial data arrives in. This lab shows how to load one into Python with pandas and into a SQLite database, check that it loaded correctly, and catch the usual problems: dates read as text, thousands separators, missing values and duplicated rows.
This lesson is complete in writing. A video for it is on its way.
What you will learn
- By the end you can load a CSV file of prices into Python with pandas and into a SQLite database.
- You can check a loaded table: count its rows, list its columns and their data types, and look at its first and last rows.
- You can find and fix the common silent errors: dates read as text, thousands separators, blank cells and duplicate rows.
- You can verify a loaded figure, such as an average close, against a hand calculation.
Key terms in this lesson
- CSV file
- Comma-separated values: a plain-text file in which each line is a row and commas separate the columns. The most common format for exchanging tables of data.
- DataFrame
- A table of data in Python's pandas library, with named columns that can each hold a different type, such as dates, text or numbers.
- Step 1: Before you start: tools, data and the rules of the lab, not started
- Step 2: The sample file, not started
- Step 3: Loading the file in Python, not started
- Step 4: Loading the same file into SQLite, not started
- Step 5: The usual traps and how to catch them, not started
About 9 min of reading
Step 1 of 5
Before you start: tools, data and the rules of the lab
Opening this step…
Step 2 of 5
The sample file
This step opens when you finish the one above.
Step 3 of 5
Loading the file in Python
This step opens when you finish the one above.
Step 4 of 5
Loading the same file into SQLite
This step opens when you finish the one above.
Step 5 of 5
The usual traps and how to catch them
This step opens when you finish the one above.
Key takeaways
The key takeaways open when you finish every step.
Lesson quiz
6 questions. You need 85% to pass.
The quiz opens when you finish every step.
Read first
Stockertim Learn is education. It explains how investing works and never recommends buying or selling anything.
Popular this week: Basics: BeginnerBangladeshi markets: Beginner