Browse Source

Plotly

pull/144/head
Jure Šorn 2 years ago
parent
commit
de29ddfbc2
3 changed files with 9 additions and 9 deletions
  1. 4
      README.md
  2. 4
      index.html
  3. 10
      pdf/index_for_pdf.html

4
README.md

@ -3410,7 +3410,7 @@ from plotly.express import line
<Figure>.write_html/json/image('<path>') # Also: <Figure>.show()
```
#### Covid deaths by continent:
#### Displays a line chart of total coronavirus deaths per million grouped by continent:
![Covid Deaths](web/covid_deaths.png)
<div id="2a950764-39fc-416d-97fe-0a6226a3095f" class="plotly-graph-div" style="height:340px; width:100%;"></div>
@ -3429,7 +3429,7 @@ df = df.rename({'date': 'Date', 'Continent_Name': 'Continent'}, axis='columns')
line(df, x='Date', y='Total Deaths per Million', color='Continent').show()
```
#### Confirmed covid cases, Dow Jones, Gold, and Bitcoin price:
#### Displays a multi-axis line chart of total coronavirus cases and changes in prices of Bitcoin, Dow Jones and gold:
![Covid Cases](web/covid_cases.png)
<div id="e23ccacc-a456-478b-b467-7282a2165921" class="plotly-graph-div" style="height:315px; width:100%;"></div>

4
index.html

@ -2779,7 +2779,7 @@ c <span class="hljs-number">7</span> <span class="hljs-number">8</span>
&lt;Figure&gt;.write_html/json/image(<span class="hljs-string">'&lt;path&gt;'</span>) <span class="hljs-comment"># Also: &lt;Figure&gt;.show()</span>
</code></pre></div>
<div><h4 id="coviddeathsbycontinent">Covid deaths by continent:</h4><p></p><div id="2a950764-39fc-416d-97fe-0a6226a3095f" class="plotly-graph-div" style="height:340px; width:100%;"></div><pre><code class="python language-python hljs">covid = pd.read_csv(<span class="hljs-string">'https://covid.ourworldindata.org/data/owid-covid-data.csv'</span>,
<div><h4 id="displaysalinechartoftotalcoronavirusdeathspermilliongroupedbycontinent">Displays a line chart of total coronavirus deaths per million grouped by continent:</h4><p></p><div id="2a950764-39fc-416d-97fe-0a6226a3095f" class="plotly-graph-div" style="height:340px; width:100%;"></div><pre><code class="python language-python hljs">covid = pd.read_csv(<span class="hljs-string">'https://covid.ourworldindata.org/data/owid-covid-data.csv'</span>,
usecols=[<span class="hljs-string">'iso_code'</span>, <span class="hljs-string">'date'</span>, <span class="hljs-string">'total_deaths'</span>, <span class="hljs-string">'population'</span>])
continents = pd.read_csv(<span class="hljs-string">'https://gist.githubusercontent.com/stevewithington/20a69c0b6d2ff'</span>
<span class="hljs-string">'846ea5d35e5fc47f26c/raw/country-and-continent-codes-list-csv.csv'</span>,
@ -2794,7 +2794,7 @@ line(df, x=<span class="hljs-string">'Date'</span>, y=<span class="hljs-string">
<div><h4 id="confirmedcovidcasesdowjonesgoldandbitcoinprice">Confirmed covid cases, Dow Jones, Gold, and Bitcoin price:</h4><p></p><div id="e23ccacc-a456-478b-b467-7282a2165921" class="plotly-graph-div" style="height:315px; width:100%;"></div><pre><code class="python language-python hljs"><span class="hljs-keyword">import</span> pandas <span class="hljs-keyword">as</span> pd
<div><h4 id="displaysamultiaxislinechartoftotalcoronaviruscasesandchangesinpricesofbitcoindowjonesandgold">Displays a multi-axis line chart of total coronavirus cases and changes in prices of Bitcoin, Dow Jones and gold:</h4><p></p><div id="e23ccacc-a456-478b-b467-7282a2165921" class="plotly-graph-div" style="height:315px; width:100%;"></div><pre><code class="python language-python hljs"><span class="hljs-keyword">import</span> pandas <span class="hljs-keyword">as</span> pd
<span class="hljs-keyword">import</span> plotly.graph_objects <span class="hljs-keyword">as</span> go
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">main</span><span class="hljs-params">()</span>:</span>

10
pdf/index_for_pdf.html

@ -32,7 +32,7 @@
<strong>copy function, <a href="#copy">15</a></strong><br>
<strong>coroutine, <a href="#coroutines">33</a></strong><br>
<strong>counter, <a href="#counter">2</a>, <a href="#generator">4</a>, <a href="#nonlocal">12</a>, <a href="#iterator-1">17</a></strong><br>
<strong>csv, <a href="#csv">26</a>, <a href="#printsacsvfileasanasciitable">34</a>, <a href="#dataframeencodedecodeplot">46</a>, <a href="#coviddeathsbycontinent">47</a></strong><br>
<strong>csv, <a href="#csv">26</a>, <a href="#printsacsvfileasanasciitable">34</a>, <a href="#dataframeencodedecodeplot">46</a>, <a href="#displaysalinechartoftotalcoronavirusdeathspermilliongroupedbycontinent">47</a></strong><br>
<strong>curses module, <a href="#runsaterminalgamewhereyoucontrolanasteriskthatmustavoidnumbers">33</a>, <a href="#curses">34</a></strong><br>
<strong>cython, <a href="#cython">49</a></strong> </p>
<h3 id="d">D</h3>
@ -96,12 +96,12 @@
<strong>operator module, <a href="#operator">31</a></strong><br>
<strong>os commands, <a href="#paths">23</a>-<a href="#shellcommands">25</a>, <a href="#runsabasicfileexplorerintheterminal">34</a></strong> </p>
<h3 id="p">P</h3>
<p><strong>pandas library, <a href="#pandas">44</a>-<a href="#confirmedcovidcasesdowjonesgoldandbitcoinprice">48</a></strong><br>
<p><strong>pandas library, <a href="#pandas">44</a>-<a href="#displaysamultiaxislinechartoftotalcoronaviruscasesandchangesinpricesofbitcoindowjonesandgold">48</a></strong><br>
<strong>partial function, <a href="#partial">12</a>, <a href="#userdefinedfunctionscannotbevaluessotheymustbewrapped">20</a></strong><br>
<strong>paths, <a href="#paths">23</a>-<a href="#direntry">24</a>, <a href="#runsabasicfileexplorerintheterminal">34</a></strong><br>
<strong>pickle module, <a href="#pickle">25</a></strong><br>
<strong>pillow library, <a href="#image">39</a>-<a href="#animation">40</a></strong><br>
<strong>plotting, <a href="#plot">34</a>, <a href="#dataframeencodedecodeplot">46</a>, <a href="#plotly">47</a>-<a href="#confirmedcovidcasesdowjonesgoldandbitcoinprice">48</a></strong><br>
<strong>plotting, <a href="#plot">34</a>, <a href="#dataframeencodedecodeplot">46</a>, <a href="#plotly">47</a>-<a href="#displaysamultiaxislinechartoftotalcoronaviruscasesandchangesinpricesofbitcoindowjonesandgold">48</a></strong><br>
<strong>print function, <a href="#print">22</a></strong><br>
<strong>profiling, <a href="#profiling">36</a>-<a href="#timingasnippet">37</a></strong><br>
<strong>progress bar, <a href="#progressbar">34</a></strong><br>
@ -117,7 +117,7 @@
<strong>regular expressions, <a href="#regex">5</a>-<a href="#specialsequences">6</a></strong><br>
<strong>requests library, <a href="#scrapespythonsurlversionnumberandlogofromitswikipediapage">35</a>, <a href="#test">36</a></strong> </p>
<h3 id="s">S</h3>
<p><strong>scraping, <a href="#scraping">35</a>, <a href="#basicmariobrothersexample">43</a>, <a href="#dataframeencodedecodeplot">46</a>, <a href="#coviddeathsbycontinent">47</a>-<a href="#confirmedcovidcasesdowjonesgoldandbitcoinprice">48</a></strong><br>
<p><strong>scraping, <a href="#scraping">35</a>, <a href="#basicmariobrothersexample">43</a>, <a href="#dataframeencodedecodeplot">46</a>, <a href="#displaysalinechartoftotalcoronavirusdeathspermilliongroupedbycontinent">47</a>-<a href="#displaysamultiaxislinechartoftotalcoronaviruscasesandchangesinpricesofbitcoindowjonesandgold">48</a></strong><br>
<strong>sequence, <a href="#abstractbaseclasses">4</a>, <a href="#sequence">18</a>-<a href="#abcsequence">19</a></strong><br>
<strong>sets, <a href="#set">2</a>, <a href="#abstractbaseclasses">4</a>, <a href="#otheruses">11</a>, <a href="#tableofrequiredandautomaticallyavailablespecialmethods">19</a>, <a href="#collectionsandtheirexceptions">21</a>, <a href="#operator">31</a></strong><br>
<strong>shell commands, <a href="#shellcommands">25</a></strong><br>
@ -126,7 +126,7 @@
<strong>sortable, <a href="#list">1</a>, <a href="#sortable">16</a></strong><br>
<strong>splat operator, <a href="#splatoperator">10</a>-<a href="#otheruses">11</a></strong><br>
<strong>sql, <a href="#sqlite">27</a>, <a href="#dataframeencodedecodeplot">46</a></strong><br>
<strong>statistics, <a href="#statistics">7</a>, <a href="#numpy">37</a>-<a href="#indexing">38</a>, <a href="#pandas">44</a>-<a href="#confirmedcovidcasesdowjonesgoldandbitcoinprice">48</a></strong><br>
<strong>statistics, <a href="#statistics">7</a>, <a href="#numpy">37</a>-<a href="#indexing">38</a>, <a href="#pandas">44</a>-<a href="#displaysamultiaxislinechartoftotalcoronaviruscasesandchangesinpricesofbitcoindowjonesandgold">48</a></strong><br>
<strong>strings, <a href="#abstractbaseclasses">4</a>-<a href="#comparisonofpresentationtypes">7</a>, <a href="#class">14</a></strong><br>
<strong>struct module, <a href="#struct">28</a>-<a href="#integertypesuseacapitalletterforunsignedtypeminimumandstandardsizesareinbrackets">29</a></strong><br>
<strong>subprocess module, <a href="#sends11tothebasiccalculatorandcapturesitsoutput">25</a></strong><br>

Loading…
Cancel
Save