Skip to content

Commit

Permalink
Merge pull request #13 from fhdsl/S4
Browse files Browse the repository at this point in the history
clarity
  • Loading branch information
caalo authored Aug 19, 2024
2 parents a33e1d3 + 9109b02 commit 40713fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions 01-intro-to-computing.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ Here are some common data types we will be using in this course.
| String | str | "hello", "234-234-8594" |
| Boolean | bool | True, False |

### Function machine schema

A nice way to summarize this first grammar structure is using the function machine schema, way back from algebra class:

![Function machine from algebra class.](images/function_machine.png)
Expand Down
8 changes: 5 additions & 3 deletions 02-data-structures.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ chrNum[3:len(chrNum)]

where `len(chrNum)` is the length of the list.

When the start or stop index is specified, it implies that you are subsetting starting the from the beginning of the list or subsetting to the end of the list, respectively:
When the start or stop index is *not* specified, it implies that you are subsetting starting the from the beginning of the list or subsetting to the end of the list, respectively:

```{python}
chrNum[:3]
Expand All @@ -85,7 +85,7 @@ The list data structure has an organization and functionality that metaphoricall

And if it "makes sense" to us, then it is well-designed.

The list data structure we have been working with is an example of an **Object**. The definition of an object allows us to ask the questions above: what does it contain, and what can it do? It is an organizational tool for a collection of data and functions that we can relate to. Formally, an object contains the following:
The list data structure we have been working with is an example of an **Object**. The definition of an object allows us to ask the questions above: what does it contain, and what can it do? It is an organizational tool for a collection of data and functions that we can relate to, like a physical object. Formally, an object contains the following:

- **Value** that holds the essential data for the object.

Expand Down Expand Up @@ -179,7 +179,9 @@ Both of these functions (without input arguments) are considered as **methods**:

#### Subsetting Dataframes

Perhaps the most important operation you will can do with Dataframes is subsetting them. There are two ways to do it. The first way is to subset by numerical indicies, exactly like how we did for lists. You will use the `iloc` and bracket operations, and you give two slices: one for the row, and one for the column.
Perhaps the most important operation you will can do with Dataframes is subsetting them. There are two ways to do it. The first way is to subset by numerical indicies, exactly like how we did for lists.

You will use the `iloc` and bracket operations, and you give two slices: one for the row, and one for the column.

Subset the first 5 rows, and first two columns:

Expand Down

0 comments on commit 40713fd

Please sign in to comment.