Skip to content

Commit e2ab4c9

Browse files
committed
Memoryview, Plotly
1 parent 1a02f13 commit e2ab4c9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,7 +2078,7 @@ Memory View
20782078
```
20792079

20802080
```python
2081-
<list> = list(<mview>) # Returns a list of ints, floats or bytes.
2081+
<list> = list(<mview>) # Returns a list of ints, floats, or bytes.
20822082
<str> = str(<mview>, 'utf-8') # Treats memoryview as a bytes object.
20832083
<str> = <mview>.hex() # Returns hex pairs. Accepts `sep=<str>`.
20842084
```
@@ -3482,7 +3482,7 @@ def scrape_data():
34823482

34833483
def wrangle_data(covid, bitcoin, gold, dow):
34843484
df = pd.concat([bitcoin, gold, dow], axis=1) # Creates table by joining columns on dates.
3485-
df = df.sort_index().interpolate() # Sorts table by date and interpolates NaN-s.
3485+
df = df.sort_index().interpolate() # Sorts rows by date and interpolates NaN-s.
34863486
df = df.loc['2020-02-23':] # Discards rows before '2020-02-23'.
34873487
df = (df / df.iloc[0]) * 100 # Calculates percentages relative to day 1.
34883488
df = df.join(covid) # Adds column with covid cases.

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
17101710
&lt;array&gt; = array(<span class="hljs-string">'&lt;typecode&gt;'</span>, &lt;mview&gt;) <span class="hljs-comment"># Treats memoryview as a sequence of numbers.</span>
17111711
&lt;file&gt;.write(&lt;mview&gt;) <span class="hljs-comment"># Writes `bytes(&lt;mview&gt;)` to the binary file.</span>
17121712
</code></pre>
1713-
<pre><code class="python language-python hljs">&lt;list&gt; = list(&lt;mview&gt;) <span class="hljs-comment"># Returns a list of ints, floats or bytes.</span>
1713+
<pre><code class="python language-python hljs">&lt;list&gt; = list(&lt;mview&gt;) <span class="hljs-comment"># Returns a list of ints, floats, or bytes.</span>
17141714
&lt;str&gt; = str(&lt;mview&gt;, <span class="hljs-string">'utf-8'</span>) <span class="hljs-comment"># Treats memoryview as a bytes object.</span>
17151715
&lt;str&gt; = &lt;mview&gt;.hex() <span class="hljs-comment"># Returns hex pairs. Accepts `sep=&lt;str&gt;`.</span>
17161716
</code></pre>
@@ -2829,7 +2829,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
28292829

28302830
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">wrangle_data</span><span class="hljs-params">(covid, bitcoin, gold, dow)</span>:</span>
28312831
df = pd.concat([bitcoin, gold, dow], axis=<span class="hljs-number">1</span>) <span class="hljs-comment"># Creates table by joining columns on dates.</span>
2832-
df = df.sort_index().interpolate() <span class="hljs-comment"># Sorts table by date and interpolates NaN-s.</span>
2832+
df = df.sort_index().interpolate() <span class="hljs-comment"># Sorts rows by date and interpolates NaN-s.</span>
28332833
df = df.loc[<span class="hljs-string">'2020-02-23'</span>:] <span class="hljs-comment"># Discards rows before '2020-02-23'.</span>
28342834
df = (df / df.iloc[<span class="hljs-number">0</span>]) * <span class="hljs-number">100</span> <span class="hljs-comment"># Calculates percentages relative to day 1.</span>
28352835
df = df.join(covid) <span class="hljs-comment"># Adds column with covid cases.</span>

0 commit comments

Comments
 (0)