Skip to content

Commit

Permalink
Render toc-less
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Aug 16, 2024
1 parent 00e805d commit a62c94d
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 4 deletions.
8 changes: 7 additions & 1 deletion docs/no_toc/02-data-structures.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,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. Formally, an object contains the following:

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

Expand All @@ -131,6 +131,8 @@ Let's see how this applies to the list:

Object methods are functions that does something with the object you are using it on. You should think about `chrNum.count(2)` as a function that takes in `chrNum` and `2` as inputs. If you want to use the count function on list `mixedList`, you would use `mixedList.count(x)`.

Here are some more examples of methods with lists:

| Function method | What it takes in | What it does | Returns |
|----------------|----------------|-------------------------------------|------------------|
| `chrNum.count(x)` | list `chrNum`, data type `x` | Counts the number of instances `x` appears as an element of `chrNum`. | Integer |
Expand Down Expand Up @@ -349,3 +351,7 @@ metadata.iloc[5:, [1, 10, 21]]
This is a great way to start thinking about subsetting your dataframes for analysis, but this way of of subsetting can lead to some inconsistencies in the long run. For instance, suppose your collaborator added a new cell line to the metadata and changed the order of the column. Then your code to subset the last 5 rows and the columns will get you a different answer once the spreadsheet is changed.

The second way is to subset by the column name, and this is much more preferred in data analysis practice. You will learn about it next week!

## Exercises

Exercise for week 2 can be found [here](https://colab.research.google.com/drive/1oIL3gKEZR2Lq16k6XY0HXIhjYl34pEjr?usp=sharing).
1 change: 1 addition & 0 deletions docs/no_toc/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
<li class="chapter" data-level="2.3.1" data-path="working-with-data-structures.html"><a href="working-with-data-structures.html#what-does-a-dataframe-contain-in-terms-of-data"><i class="fa fa-check"></i><b>2.3.1</b> What does a Dataframe contain (in terms of data)?</a></li>
<li class="chapter" data-level="2.3.2" data-path="working-with-data-structures.html"><a href="working-with-data-structures.html#what-can-a-dataframe-do-in-terms-of-operations-and-functions"><i class="fa fa-check"></i><b>2.3.2</b> What can a Dataframe do (in terms of operations and functions)?</a></li>
</ul></li>
<li class="chapter" data-level="2.4" data-path="working-with-data-structures.html"><a href="working-with-data-structures.html#exercises-1"><i class="fa fa-check"></i><b>2.4</b> Exercises</a></li>
</ul></li>
<li class="chapter" data-level="" data-path="about-the-authors.html"><a href="about-the-authors.html"><i class="fa fa-check"></i>About the Authors</a></li>
<li class="chapter" data-level="3" data-path="references.html"><a href="references.html"><i class="fa fa-check"></i><b>3</b> References</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/no_toc/about-the-authors.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
<li class="chapter" data-level="2.3.1" data-path="working-with-data-structures.html"><a href="working-with-data-structures.html#what-does-a-dataframe-contain-in-terms-of-data"><i class="fa fa-check"></i><b>2.3.1</b> What does a Dataframe contain (in terms of data)?</a></li>
<li class="chapter" data-level="2.3.2" data-path="working-with-data-structures.html"><a href="working-with-data-structures.html#what-can-a-dataframe-do-in-terms-of-operations-and-functions"><i class="fa fa-check"></i><b>2.3.2</b> What can a Dataframe do (in terms of operations and functions)?</a></li>
</ul></li>
<li class="chapter" data-level="2.4" data-path="working-with-data-structures.html"><a href="working-with-data-structures.html#exercises-1"><i class="fa fa-check"></i><b>2.4</b> Exercises</a></li>
</ul></li>
<li class="chapter" data-level="" data-path="about-the-authors.html"><a href="about-the-authors.html"><i class="fa fa-check"></i>About the Authors</a></li>
<li class="chapter" data-level="3" data-path="references.html"><a href="references.html"><i class="fa fa-check"></i><b>3</b> References</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/no_toc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
<li class="chapter" data-level="2.3.1" data-path="working-with-data-structures.html"><a href="working-with-data-structures.html#what-does-a-dataframe-contain-in-terms-of-data"><i class="fa fa-check"></i><b>2.3.1</b> What does a Dataframe contain (in terms of data)?</a></li>
<li class="chapter" data-level="2.3.2" data-path="working-with-data-structures.html"><a href="working-with-data-structures.html#what-can-a-dataframe-do-in-terms-of-operations-and-functions"><i class="fa fa-check"></i><b>2.3.2</b> What can a Dataframe do (in terms of operations and functions)?</a></li>
</ul></li>
<li class="chapter" data-level="2.4" data-path="working-with-data-structures.html"><a href="working-with-data-structures.html#exercises-1"><i class="fa fa-check"></i><b>2.4</b> Exercises</a></li>
</ul></li>
<li class="chapter" data-level="" data-path="about-the-authors.html"><a href="about-the-authors.html"><i class="fa fa-check"></i>About the Authors</a></li>
<li class="chapter" data-level="3" data-path="references.html"><a href="references.html"><i class="fa fa-check"></i><b>3</b> References</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/no_toc/intro-to-computing.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
<li class="chapter" data-level="2.3.1" data-path="working-with-data-structures.html"><a href="working-with-data-structures.html#what-does-a-dataframe-contain-in-terms-of-data"><i class="fa fa-check"></i><b>2.3.1</b> What does a Dataframe contain (in terms of data)?</a></li>
<li class="chapter" data-level="2.3.2" data-path="working-with-data-structures.html"><a href="working-with-data-structures.html#what-can-a-dataframe-do-in-terms-of-operations-and-functions"><i class="fa fa-check"></i><b>2.3.2</b> What can a Dataframe do (in terms of operations and functions)?</a></li>
</ul></li>
<li class="chapter" data-level="2.4" data-path="working-with-data-structures.html"><a href="working-with-data-structures.html#exercises-1"><i class="fa fa-check"></i><b>2.4</b> Exercises</a></li>
</ul></li>
<li class="chapter" data-level="" data-path="about-the-authors.html"><a href="about-the-authors.html"><i class="fa fa-check"></i>About the Authors</a></li>
<li class="chapter" data-level="3" data-path="references.html"><a href="references.html"><i class="fa fa-check"></i><b>3</b> References</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/no_toc/reference-keys.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ dataframes
what-does-a-dataframe-contain-in-terms-of-data
what-can-a-dataframe-do-in-terms-of-operations-and-functions
subsetting-dataframes
exercises-1
references
1 change: 1 addition & 0 deletions docs/no_toc/references.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
<li class="chapter" data-level="2.3.1" data-path="working-with-data-structures.html"><a href="working-with-data-structures.html#what-does-a-dataframe-contain-in-terms-of-data"><i class="fa fa-check"></i><b>2.3.1</b> What does a Dataframe contain (in terms of data)?</a></li>
<li class="chapter" data-level="2.3.2" data-path="working-with-data-structures.html"><a href="working-with-data-structures.html#what-can-a-dataframe-do-in-terms-of-operations-and-functions"><i class="fa fa-check"></i><b>2.3.2</b> What can a Dataframe do (in terms of operations and functions)?</a></li>
</ul></li>
<li class="chapter" data-level="2.4" data-path="working-with-data-structures.html"><a href="working-with-data-structures.html#exercises-1"><i class="fa fa-check"></i><b>2.4</b> Exercises</a></li>
</ul></li>
<li class="chapter" data-level="" data-path="about-the-authors.html"><a href="about-the-authors.html"><i class="fa fa-check"></i>About the Authors</a></li>
<li class="chapter" data-level="3" data-path="references.html"><a href="references.html"><i class="fa fa-check"></i><b>3</b> References</a></li>
Expand Down
2 changes: 1 addition & 1 deletion docs/no_toc/search_index.json

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions docs/no_toc/working-with-data-structures.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
<li class="chapter" data-level="2.3.1" data-path="working-with-data-structures.html"><a href="working-with-data-structures.html#what-does-a-dataframe-contain-in-terms-of-data"><i class="fa fa-check"></i><b>2.3.1</b> What does a Dataframe contain (in terms of data)?</a></li>
<li class="chapter" data-level="2.3.2" data-path="working-with-data-structures.html"><a href="working-with-data-structures.html#what-can-a-dataframe-do-in-terms-of-operations-and-functions"><i class="fa fa-check"></i><b>2.3.2</b> What can a Dataframe do (in terms of operations and functions)?</a></li>
</ul></li>
<li class="chapter" data-level="2.4" data-path="working-with-data-structures.html"><a href="working-with-data-structures.html#exercises-1"><i class="fa fa-check"></i><b>2.4</b> Exercises</a></li>
</ul></li>
<li class="chapter" data-level="" data-path="about-the-authors.html"><a href="about-the-authors.html"><i class="fa fa-check"></i>About the Authors</a></li>
<li class="chapter" data-level="3" data-path="references.html"><a href="references.html"><i class="fa fa-check"></i><b>3</b> References</a></li>
Expand Down Expand Up @@ -270,7 +271,7 @@ <h2><span class="header-section-number">2.2</span> Objects in Python<a href="wor
<li><p>What can it do (in terms of operations and functions)?</p></li>
</ul>
<p>And if it “makes sense” to us, then it is well-designed.</p>
<p>The list data structure we have been working with is an example of an <strong>Object</strong>. 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:</p>
<p>The list data structure we have been working with is an example of an <strong>Object</strong>. 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:</p>
<ul>
<li><p><strong>Value</strong> that holds the essential data for the object.</p></li>
<li><p><strong>Attributes</strong> that store additional data for the object.</p></li>
Expand All @@ -284,6 +285,7 @@ <h2><span class="header-section-number">2.2</span> Objects in Python<a href="wor
<li><p><strong>Methods</strong> that can be used on the object: <code>chrNum.count(2)</code> counts the number of instances 2 appears as an element of <code>chrNum</code>.</p></li>
</ul>
<p>Object methods are functions that does something with the object you are using it on. You should think about <code>chrNum.count(2)</code> as a function that takes in <code>chrNum</code> and <code>2</code> as inputs. If you want to use the count function on list <code>mixedList</code>, you would use <code>mixedList.count(x)</code>.</p>
<p>Here are some more examples of methods with lists:</p>
<table>
<colgroup>
<col width="18%" />
Expand Down Expand Up @@ -455,9 +457,13 @@ <h4><span class="header-section-number">2.3.2.1</span> Subsetting Dataframes<a h
## [1859 rows x 3 columns]</code></pre>
<p>This is a great way to start thinking about subsetting your dataframes for analysis, but this way of of subsetting can lead to some inconsistencies in the long run. For instance, suppose your collaborator added a new cell line to the metadata and changed the order of the column. Then your code to subset the last 5 rows and the columns will get you a different answer once the spreadsheet is changed.</p>
<p>The second way is to subset by the column name, and this is much more preferred in data analysis practice. You will learn about it next week!</p>

</div>
</div>
</div>
<div id="exercises-1" class="section level2 hasAnchor" number="2.4">
<h2><span class="header-section-number">2.4</span> Exercises<a href="working-with-data-structures.html#exercises-1" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<p>Exercise for week 2 can be found <a href="https://colab.research.google.com/drive/1oIL3gKEZR2Lq16k6XY0HXIhjYl34pEjr?usp=sharing">here</a>.</p>

</div>
</div>
<hr>
Expand Down

0 comments on commit a62c94d

Please sign in to comment.