Programming With Data
Loading NOAA weather observations into SQLite with Python, then querying and charting them.
- Course
- CEIS110, DeVry University
- Tools
- Python (noaa_sdk, sqlite3, pandas, matplotlib), SQL, Excel, VS Code, Replit
- Timeframe
- Mar – Apr 2023
Overview
I built a small data pipeline in Python. One script downloaded two weeks of weather observations from NOAA into a SQLite database. I queried the data with SQL, exported temperature and humidity to a CSV file with a Celsius-to-Fahrenheit conversion, and charted the results in Excel and matplotlib to see how the two weeks compared.
How I built it
Planned the pipeline.
I drew a flowchart of the steps: run the program, download the weather data to a database, query it, and turn it into charts.
Photos (1)
Warmed up with a simple program.
A short Python script asks for the temperature where you are and replies based on your answer.
Photos (1)
Downloaded the data.
BuildWeatherDb.pyuses the NOAA SDK to fetch the last 14 days of observations and store them inweather.dbwith sqlite3. The run inserted 266 rows.Photos (2)
Queried it with SQL.
I pulled every row, found the lowest and highest temperatures (−3.9 °C and 8.3 °C), and listed the temperature, wind speed and conditions for every clear observation.
Exported it with Python.
ExtractTempHumidity.pyreads temperature and humidity in time order, converts Celsius to Fahrenheit, and writes the result to a CSV file. I opened the file in Excel and charted temperature and humidity.Photos (2)
Charted it with pandas and matplotlib.
I made a box plot of the second week, a line plot comparing week 1 and week 2 temperatures, and a histogram comparing humidity and heat.
Read the results.
I asked whether hotter readings go with higher humidity. In this data, temperature spikes lined up with humidity spikes, though how humid weather feels varies from region to region. Across the two weeks, the temperature was slowly rising.
Code: the export query
The export query from ExtractTempHumidity.py:
SELECT temperature, relativeHumidity FROM observations ORDER BY timestamp;
BuildWeatherDb.py and the convertCtoF function appear only in screenshots.
Three plots

Box plot
# Purpose: create a box plot for week 2 data
import pandas as pd
import matplotlib.pyplot as plt
df2 = pd.read_csv("formatdata2.csv")
df2.boxplot()
plt.suptitle("Week 2 box plot")
plt.show()
Week 1 vs week 2
# Purpose: compare Celsius readings for week 1 and week 2
import pandas as pd
import matplotlib.pyplot as plt
df1 = pd.read_csv("formatdata1.csv") # week 1 (older)
df2 = pd.read_csv("formatdata2.csv") # week 2 (more recent)
plt.figure()
df1.Celsius.plot(label="Week 1")
df2.Celsius.plot(label="Week 2")
plt.legend(loc="best")
plt.suptitle("Temperature in Celsius")
plt.show()
Humidity and heat
Blue is temperature and orange is humidity.
Challenges and what I learned
Challenges
- Getting
weather.dbto download took a long time,because the IDE I was using didn't have everything installed correctly. - The graphs were harder than I expected.They didn't show up the way I thought they would, and sometimes they didn't show up at all.
- One of my files corrupted right before I submitted it,and I had to redo it.
What I learned
I learned Python's basic syntax and data types, how to write functions and use modules, and how to handle exceptions and catch errors. I also learned how to analyze data and graph it with Python. Building a weather database and turning it into charts gave me a better understanding of how data works and how it can be useful in everyday life, and a lot of practice finding and fixing errors.








