1 of 28

CEIS110

Programming with Data��� Final Project

2 of 28

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.

3 of 28

Software Inventory

  • Software needed included Excel, Python, and Spyder IDE.

  • Before developing this programing with data project, all software must be downloaded and installed.

4 of 28

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.

5 of 28

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.

6 of 28

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.

7 of 28

Flowchart

Include the following processes:

    • Run a basic python program
    • Download weather data to a database.
    • Query the weather data
    • Extract weather data from database into a comma separated file with python
    • Cleanse weather data
    • Use python data analytics modules to develop graphical models

Start

Stop

8 of 28

Gathering Temperature �and �Humidity data

  • After planning and designing, the code is developed to download a set of weather observations which was then stored on a local database in a table for later analysis.

9 of 28

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.

10 of 28

Python Console�of BuildWeatherDB.py

Screenshot of program output in Python console showing program executed successfully

11 of 28

Weather.db File

Screenshot of Windows Explorer showing database file Weather.db was created

12 of 28

Querying the database �with SQL

  • Structed Query Language (SQL) is a programming language used for working with relational databases.
  • SQL was used to query the database and view the results

13 of 28

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.

14 of 28

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.

15 of 28

Query to retrieve all clear days

Screenshot of SQL query command and results. This retrieves all the clear days within the observation table.

16 of 28

17 of 28

CEIS110�Module 5

Querying and manipulating data with SQL and Python

18 of 28

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.

19 of 28

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.

20 of 28

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.

21 of 28

Developing Graphical Models and Interpreting Results.

  • Python Data analytics modules allows users to make charts and create graphs that depict the data given.
  • Several plots were generated looking at the humidity and temperature over the period of two weeks.
  • A prediction was then made about the following week based off the data given in both the graphs and numeric values given.

22 of 28

Plot #1

This plot shows the humidity of both weeks on a single line chart.

23 of 28

Plot #2

These two plots show the humidity throughout the two weeks on sperate scatter plots.

24 of 28

Analysis�

How does the weather change from week 1 to week 2? Will the temperature continue to drop?

  • Answer supported by Chart:

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

25 of 28

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.

26 of 28

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.

27 of 28

Career Skills

  • Several career skills gained during in this project
    • Communication – Using a flowchart to show and plan out my idea for my project.
    • Database development
    • Troubleshooting with python
    • Analysis – Reviewing charts, graphs, and data to make future predictions.

28 of 28

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.