1 of 28

GOAL

Draw meaningful conclusions from data using Python programming and Scientific Computing principles

2025-08-18_v1.0

Scientific Computing &

Data Visualization with Python

2 of 28

2

2

Objectives

Learn what code is

Learn about libraries

Download a dataset

Code with Python in Google Colaboratory

Write a program to explore and visualize your data

3 of 28

3

PART 1

Scientific Computing and Code

4 of 28

4

Examples of Scientific Computing !

USING HIVE DATA TO SAVE THE BEES

IMPROVING ATHLETE PERFORMANCE THROUGH BIOMETRIC DATA

BUILDING MODELS TO PROMOTE WILDLIFE CONSERVATION

MAPPING OUR FUTURE IN SPACE EXPLORATION

5 of 28

5

5

ANSWER ME!

So let’s think… what are some topics you are interested in?

6 of 28

6

6

Getting Things Done

So how do we actually get these things done?? Coding!

…But what do computer programs look like???

And what actually is code?

6

7 of 28

7

7

What is coding?

Coding is simply telling a computer what to do by giving it instructions!

We write these instructions in programming languages.

We write programs in a development environment.

8 of 28

8

Understanding Code

Even though code is written in a different language, you might be able to interpret and understand it better than you think!

Watch this video to learn more about what code is, what it looks like, and how we can read and understand it!

9 of 28

9

PART 2

Diving Into Python

10 of 28

Python Code

10

Each line of code usually does something!

print("Hello, World!")

Comments are special lines of Python code that don’t do anything

# This is a comment

11 of 28

11

11

11

Let’s Try Google Colab!

Step 1) Open this Colab Notebook.

Step 2) Click the button located in the top left corner.

Step 3) From the dropdown menu, select

Step 4) A new tab should appear with a copy of the Colab Notebook. This is now your personal copy to edit and learn with!

Step 5) Feel free to rename your file in the top left corner next to the

Step 6) Read through all the contents of the Colab Notebook, run the cells, and do the activities to learn more about coding and try it out yourself!

Open the dropdown menu to copy the file here

Save a copy in your Drive here

Name your file here

12 of 28

12

12

Python Libraries

What about when we need to do something more complicated?

We can always write more complicated code, or we can call upon pre-written instructions from libraries!

  • A library is essentially a collection of code that has already been written and is now shared for everyone to use!

13 of 28

13

Using Libraries

import library_name as alias

alias.function_name(parameters)

Pandas

Pandas is a library that helps you load in and work with data.

Example Usage:

import pandas as pd

df = pd.read_csv("my_data.csv")

Plotly Express

Plotly is a library that helps create graphs and make interactive visualizations. Plotly express is a simplified version that helps streamline code even more.

Example Usage:

import plotly.express as px

fig = px.scatter(df, x="age", y="income")

fig.show()

14 of 28

14

15 of 28

15

15

Pandas DataFrames

A DataFrame is simply a 2 dimensional table of data in Python.

They’re used to organize and store data, label rows and columns, and easily work with and manipulate different types of data all in one place.

DataFrames also have built in capabilities to help you load in, clean, explore, and analyze your data!

16 of 28

16

PART 3

Dealing With Data

17 of 28

17

17

Data

We code to understand data and the world around us!

Data is everywhere!!

With scientific computing, we can turn this data from just a bunch of numbers into real, valuable insights that can improve our lives!

18 of 28

18

18

CSV Files

In this lab, we will use CSV files, which stands for comma-separated values. CSV files are one of the simplest and most commonly used ways to store and organize data, where each row represents a new record and each column represents a different variable!

Watch this video to learn more about CSV files.

18

19 of 28

19

PART 4

Your Turn! Creating A Data Visualization

20 of 28

20

Your Task: Using Sci Comp to Visualize Your Own Data

  1. Select a data file of your choosing – pick something fun!
  2. Load the data into a Colab Notebook
  3. Work with a Python code skeleton to explore the data
  4. Create multiple visualizations to help us understand what the data tells us!

WHAT YOU’LL DO:

20

21 of 28

21

Your Turn! Find a Dataset

Now, it’s your turn to find a dataset! Think about what interests you, and search for data on a topic you enjoy. As long as it’s a CSV file, you can use any dataset you want, so make it fun!! We recommend starting your search at one of the following websites:

This website contains lots of information from the U.S. government!

From the link above, scroll down to the sidebar section titled “Format” and select “CSV.” From there, type any topic in the search bar to see all CSV files about it!

Once you’ve found a file, download the CSV version!

Kaggle has all kinds of datasets about unique and fun topics, but you will have to log in to access them.

Navigate to “Datasets” in the sidebar, select “CSV” from the filters located in the search bar, and search away!

Once you’ve found a file, scroll down to where you see the table, and download from there!

22 of 28

22

22

22

Back to Google Colab!

Now, we’re going to work with a new Colab Notebook to take a look at this data! Following the same initial process as last time, do the following:

Step 1) Open this Colab Notebook.

Step 2) Click the button located in the top left corner.

Step 3) From the dropdown menu, select

Step 4) Work through your copy of the Colab Notebook up until the cell that tells you to return to the slides! Make sure you read through the code and try to understand what is happening!

23 of 28

23

23

Thinking About Your Data

Now that everyone has loaded their data and started to explore it, let’s come back together and think about the next step.

Ask good data questions help us uncover patterns, trends, or relationships�

24 of 28

Types of Graphs in Plotly

24

Chart Type

Code Example

When to Use

Scatter

px.scatter(df, x=..., y=...)

To compare two numeric columns

Bar

px.bar(df, x=..., y=...)

To compare quantities across categories

Line

px.line(df, x=..., y=...)

To show changes or trends over time

Histogram

px.histogram(df, x=...)

To show the distribution of a single numeric column

Box plot

px.box(df, x=..., y=...)

To compare distributions & spot outliers across groups

25 of 28

Customizations in Plotly

25

Parameter to Add

Purpose

title="Your Chart Title"

Adds a title to your chart

color="another_column"

Adds color groups

labels={"column_x": "X Label", "column_y": "Y Label"}

Renames axes

template="plotly_dark"

Recolors the chart (you can google other templates for different color schemes)

26 of 28

26

26

26

Your Task: Creating Your Own Visualization!

Work through all of these steps with your own dataset that you have selected!

Follow along with the code given to you, and then make your own chart from scratch!

Make sure your chart includes the following:

  1. A different chart type than a scatter plot
  2. A title that explains what your chart shows
  3. At least 1 more element of your choosing from the table on the previous slide!

27 of 28

27

Continue to Explore

If you liked today’s activity, you may be interested in these topics:

  • Scientific Computing
  • Data Science
  • Computer Algorithms

Types of engineering relevant to Scientific Computing:

  • Computer Scientist
  • Mechanical Engineer
  • Essentially any STEM discipline!

If you want to dive deeper into this topic, Engineering Tomorrow offers a full Scientific Computing course which can be completed independently of this lab. We will teach you to code from scratch and help you work on an awesome project to learn more about sci comp and boost your resume!

If you’re interested, ask your teacher to talk to our ET staff!

28 of 28

Thank you!