Skip to content

Commit b400d44

Browse files
committed
NumPy
1 parent c1e3e19 commit b400d44

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
@@ -2587,7 +2587,7 @@ with PyCallGraph(drawer):
25872587

25882588
NumPy
25892589
-----
2590-
**Array manipulation mini-language. It can run up to one hundred times faster than the equivalent Python code.**
2590+
**Array manipulation mini-language. It can run up to one hundred times faster than the equivalent Python code. An even faster alternative that runs on a GPU is called CuPy.**
25912591

25922592
```python
25932593
# $ pip3 install numpy
@@ -3404,7 +3404,7 @@ def wrangle_data(covid, dow, gold, bitcoin):
34043404
df = df.sort_index().interpolate()
34053405
df = df.rolling(10, min_periods=1, center=True).mean()
34063406
df = df.loc['2020-02-23':].iloc[:-2]
3407-
df = df / df.iloc[0] * 100
3407+
df = (df / df.iloc[0]) * 100
34083408
return pd.concat([covid, df], axis=1, join='inner')
34093409

34103410
def display_data(df):

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,7 +2235,7 @@
22352235
</code></pre></div></div>
22362236

22372237

2238-
<div><h2 id="numpy"><a href="#numpy" name="numpy">#</a>NumPy</h2><p><strong>Array manipulation mini-language. It can run up to one hundred times faster than the equivalent Python code.</strong></p><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install numpy</span>
2238+
<div><h2 id="numpy"><a href="#numpy" name="numpy">#</a>NumPy</h2><p><strong>Array manipulation mini-language. It can run up to one hundred times faster than the equivalent Python code. An even faster alternative that runs on a GPU is called CuPy.</strong></p><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install numpy</span>
22392239
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
22402240
</code></pre></div>
22412241

@@ -2888,7 +2888,7 @@
28882888
df = df.sort_index().interpolate()
28892889
df = df.rolling(<span class="hljs-number">10</span>, min_periods=<span class="hljs-number">1</span>, center=<span class="hljs-keyword">True</span>).mean()
28902890
df = df.loc[<span class="hljs-string">'2020-02-23'</span>:].iloc[:<span class="hljs-number">-2</span>]
2891-
df = df / df.iloc[<span class="hljs-number">0</span>] * <span class="hljs-number">100</span>
2891+
df = (df / df.iloc[<span class="hljs-number">0</span>]) * <span class="hljs-number">100</span>
28922892
<span class="hljs-keyword">return</span> pd.concat([covid, df], axis=<span class="hljs-number">1</span>, join=<span class="hljs-string">'inner'</span>)
28932893

28942894
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">display_data</span><span class="hljs-params">(df)</span>:</span>

0 commit comments

Comments
 (0)