Skip to content

A place to keep track of the data that we will be using in our intro to coding workshop.

License

Notifications You must be signed in to change notification settings

dclinkenbeard/summer-intro-to-coding-2022

Repository files navigation

Introduction to Coding Workshop

This workshop is intended to serve as an example of why and how code is used in the sciences. Much of modern science, regardless of the field, uses some form of code. Code is used to simulate/predict the natural world, gather information from the natural world, and to analyze the copious amounts of data that is generated from both.

Who Is This For

This workshop is really for anyone that is curious about writing code, data, science, data science, statistics, or learning in general. There is no expectation of previous knowledge. There IS an expectation of an open mind and, most importantly, respect for your fellow students.

We will start by discussing the absolute basics and getting familiar with some terminology.

Where to Start

Please use your CSUMB email address to log in to the the following three services (if you don't have a CSUMB email address any [ Gmail }(http://www.gmail.com) address will do):

The Difference Between Data and Information

Data are facts * .

  • Blue
  • Four
  • Fish

These are all data. We must process our data to gain context and turn our data into information. Context would be something like:

  • The sky is blue
  • Cats have four legs
  • Fish live in water

Given a context we can then use our information to make an inference and gain knowledge: "That thing in sky is neither a cat nor a fish. It does NOT have four legs and so, I can infer, it must be... a dog. Be careful of making inferences with incomplete data. We can really only determine that it is neither a cat (doesn't have for legs) nor a fish (not in the water).

We use code to gather, interpret, and make inferences with data. Learning how to accurately interpret data takes a lot of time and practice and is largely what it means to be a scientist.

What does it mean to "code"

Coding, or programming as I will generally call it, is using symbols to communicate with a computer and command it to do what we want. In other words: magic. However just because it is magic doesn't mean it is difficult or inexplicable .

Each programming language uses a different set of symbols to tell a computer what to do. The way we use and group those symbols is called the syntax of the language.

Each language has it's own syntax and learning to code means learning the syntax of the language in question and how to apply that syntax to solve problems. Though each language is unique there are also a lot of similarities.

Variables

All of the programming languages I know of have some form of variable. A variable, just like in math, is simply a symbol that we use to represent some value. With programming, unlike math, we generally control the values that are referenced by the variable.

In most programming languages what a variable actually does is reference a location in the computer's memory. This is getting beyond the scope of this workshop though and if you would like to learn more you may be interested in a Data Science or Computer Science minor (or major...)

Variables in Python

Variables in python are declared as follows:

foo = 42

Variables in Matlab

Variables in Matlab are declared as follows:

foo = 42;

Variables in R

Variables in R are declared as follows:

foo = 42

Note that the ONLY difference is that Matlab requires a semicolon (;) after the declaration. It is also worth noting that R also allows an arrow notation as shown below.

Alternative Variable Declaration in R

foo <- 42
42 -> foo

Control Structures

Once we have variable we need some method to manipulate those variables and make decisions based on those variables. For this we need to introduce things like if statments, loops, and maybe even functions. This is all well beyond the scope of this readme however so to learn more you will simply need to attend the workshop.

Footnotes 🐢

* 'Data' is plural. A single fact is a datum.

The entire focus of Hogwarts, Unseen University, Tar Valon, The College of Winterhold, Morgrave, Sorcere, and many others is to teach magic, don't tell me magic is inexplicable. Just because it can be explained doesn't mean it isn't magic. We are using specific words and symbols to create effects and changes on the physical world. If that isn't magic then I don't know what is.

🐢 I am a big fan of Sir Terry Pratchett who was a big fan of footnotes.

About

A place to keep track of the data that we will be using in our intro to coding workshop.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published