CEIS110
Programming with Data��� Final Project
Introduction
Data is growing massively; this project uses a cloud-based system to gather temperature and humidity. The data is then analyzed using programming and data analytics within python.
Software Inventory
Software
Spyder IDE – Used to code Python and run
Run code required for course project.
Microsoft Excel – Used to create graphs
And create spreadsheets with data
Replit – Used to quickly test python code.
Basic python program
Some simple code showing how to run Python
Python is one of the most popular programming
languages used today, It is mainly used for data analytics, Ai, and scientific analysis. It is known for its easy readability, which makes it a great choice for beginners.
What is a flowchart?
A flow chart is a graphical representation of a workflow and illustrates how a software should run, It acts as a guideline on how the program should work.
Flowchart
Include the following processes:
Start
Stop
Gathering Temperature �and �Humidity data
BuildWeatherDb.py Code
The code will create a table named Observations with the fields: timestamp, windspeed, temperature, relativeHumidity, windDirection, barometricPressure, visibility, and textDescription.
The database will be named weather.db and stored in the same directory as the python code.
Python Console�of BuildWeatherDB.py
Screenshot of program output in Python console showing program executed successfully
Weather.db File
Screenshot of Windows Explorer showing database file Weather.db was created
Querying the database �with SQL
Query to retrieve all columns and all rows
Screenshot of SQL query command and results. This retrieves all rows and columns from the observation table.
Query to retrieve lowest and highest temperatures
Screenshot of SQL query command and results. This retrieves the highest and lowest temperatures from the observations table.
Query to retrieve all clear days
Screenshot of SQL query command and results. This retrieves all the clear days within the observation table.
CEIS110�Module 5
Querying and manipulating data with SQL and Python
Extracting Temperature and Humidity using python.
ExtractTempHumidity.py Python code. It will output the data to “formatdata1.csv” and “formatdata2.csv”. The weather.db database may be missing values or contain null code. This retrieves only the temperature and humidity values and writes it to a CSV(comma separated values) file. Missing or null values will not be written to these files.
Retrieve and Convert Data to CSV Format
Formatdata file opened in Excel showing 3 columns of data. This is the data extracted from the ExtractTempHumidity.py.
Temperature and Humidity Chart�
Excel chart based on temperature and humidity data from database. This shows the Humidity, and temperature in Celsius and Fahrenheit over a one Period 1.
Developing Graphical Models and Interpreting Results.
Plot #1
This plot shows the humidity of both weeks on a single line chart.
Plot #2
These two plots show the humidity throughout the two weeks on sperate scatter plots.
Analysis�
How does the weather change from week 1 to week 2? Will the temperature continue to drop?
The median temperature gets about 10 degree Fahrenheit lower and the humidity gets higher.
Based on this trend if the temperature continues to drop the humidity will get higher.
Celsius Fahrenheit Humidity
count 91.00000 91.000000 91.000000
mean 9.038462 48.269231 48.111768
std 4.556382 8.201487 20.221429
min 2.800000 37.040000 16.979152
25% 5.000000 41.000000 31.425669
50% 8.300000 46.940000 47.704272
75% 11.70000 53.060000 59.534077
max 20.00000 68.000000 92.782036
the median is
Celsius 8.300000
Fahrenheit 46.940000
Humidity 47.704272
Celsius Fahrenheit Humidity
count 90.000000 90.000000 89.000000
mean 13.871111 56.968000 54.161698
std 4.290629 7.723131 15.326299
min 6.700000 44.060000 28.163115
25% 10.600000 51.080000 39.158254
50% 13.300000 55.940000 54.980263
75% 16.100000 60.980000 65.447631
max 23.300000 73.940000 83.104540
the median is
Celsius 13.300000
Fahrenheit 55.940000
Humidity 54.980263
Prediction�
Over the next few days or even weeks I expect the temperature to down as the humidity heightens. In week 1 the humidity's median is 47 and the median temperature is 46. In week 2 the humidity’s median is 54 and the temperatures median is 55 degrees Fahrenheit. As the temperature drops the humidity will get higher.
Challenges:
When creating the charts inputting the correct names for each data set such as the differentiation between the variables df1 and df2. This primarily occurred during things such as df1.boxplot() and df2.boxplot(). Although a smaller error, overlooking it can cause a lot of issues. Its always important to read over your code and debug it until it is fixed.
When making this mistake I accidentally created the same plots multiple times with the same data for both week 1 and week 2. I only realized my mistake looking at the data while reviewing over my project before my final submission.
Career Skills
Conclusion
This project helped to further develop my understanding of programming with data using python. I had used data from the cloud in order to perform data analysis. I had used python to gather my data, put it into a CSV, and then put it into graphs which I could then analyze further and make conclusions based on this data.
Creating this project further helped me understand programming and other topics in this course with a hands-on learning opportunity.