Skip to content

Commit

Permalink
Added Google Colab details
Browse files Browse the repository at this point in the history
  • Loading branch information
saeedamen committed Nov 17, 2020
1 parent 30f29d0 commit aa9c03d
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ You can also run some of the notebooks interactively with Binder too

* 17 Nov 2020
* Updated Anaconda installation notes
* Added Google Colab details
* 13 Nov 2020
* Adding Binder
* Fixed Linux conda environment file (and updated Windows)
Expand Down
32 changes: 29 additions & 3 deletions pythoncourse/installation/installing_anaconda_and_pycharm.html
Original file line number Diff line number Diff line change
Expand Up @@ -13192,7 +13192,7 @@ <h2 id="Installing-a-conda-environment-for-Windows-from-YML-file-(quickest-metho
<ul>
<li>Type in <code>conda activate</code> and press Enter to exit the current conda environment, then <code>conda remove -n py37class --all --yes</code> and press Enter to remove any existing environments called <code>py37class</code></li>
<li>If you haven't already downloaded the <code>environment_windows.yml</code> file you can do it from the command line using <code>curl</code>:<ul>
<li>Type <code>curl https://raw.githubusercontent.com/cuemacro/teaching/master/pythoncourse/installation/environment_windows.yml > environment_windows.yml</code> and press Enter</li>
<li>Type <code>curl https://raw.githubusercontent.com/cuemacro/teaching/master/pythoncourse/installation/environment_windows.yml &gt; environment_windows.yml</code> and press Enter</li>
</ul>
</li>
<li>Type in <code>conda env create -f environment_windows.yml</code> and press Enter</li>
Expand Down Expand Up @@ -13267,7 +13267,7 @@ <h2 id="Installing-a-conda-environment-for-Linux-or-Mac-from-YAML-file-(quickest
<ul>
<li>Type in <code>conda activate</code> to exit the current conda environment and press Enter, then <code>conda remove -n py37class --all --yes</code> and press Enter to remove any existing environments called <code>py37class</code></li>
<li>If you haven't already downloaded the <code>environment_linux.yml</code> or <code>environment_mac.yml</code> file you can do it from the command line using <code>curl</code>:<ul>
<li>Type <code>curl https://raw.githubusercontent.com/cuemacro/teaching/master/pythoncourse/installation/environment_linux.yml > environment_linux.yml</code> and press Enter (or <code>curl https://raw.githubusercontent.com/cuemacro/teaching/master/pythoncourse/installation/environment_mac.yml > environment_mac.yml</code> on Mac)</li>
<li>Type <code>curl https://raw.githubusercontent.com/cuemacro/teaching/master/pythoncourse/installation/environment_linux.yml &gt; environment_linux.yml</code> and press Enter (or <code>curl https://raw.githubusercontent.com/cuemacro/teaching/master/pythoncourse/installation/environment_mac.yml &gt; environment_mac.yml</code> on Mac)</li>
</ul>
</li>
<li>Type in <code>conda env create -f environment_linux.yml</code> and press Enter (or <code>conda env create -f environment_mac.yml</code> on Mac)</li>
Expand Down Expand Up @@ -13370,7 +13370,33 @@ <h2 id="Download-and-install-PyCharm">Download and install PyCharm<a class="anch
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Using-Microsoft-Azure-Notebooks-with-Jupyter">Using Microsoft Azure Notebooks with Jupyter<a class="anchor-link" href="#Using-Microsoft-Azure-Notebooks-with-Jupyter">&#182;</a></h2><p>If you do not want to install Anaconda on your own machine (or if you don't have the correct permissions to do so), you can instead use Microsoft Azure Notebooks, which gives you a Jupyter notebook in the cloud. This can be a good solution for those wanting to learn Python.</p>
<h2 id="Using-Google-Colab-with-Jupyter">Using Google Colab with Jupyter<a class="anchor-link" href="#Using-Google-Colab-with-Jupyter">&#182;</a></h2><p>If you do not want to install Anaconda on your own machine (or if you don't have the correct permissions to do so), you can instead use Google Colab, which gives you a Jupyter notebook in the cloud. This can be a good solution for those wanting to learn Python. You'll need a Google account, otherwise you can't save down your notebooks. You can access it at <a href="https://colab.research.google.com/">https://colab.research.google.com/</a></p>
<p>If you find there are libraries which aren't available, you can install these in Google Colab (as with any Jupyter notebook) using <code>!pip</code> inside the notebook. Below, we have a number of useful libraries to get you started. Note that you might need to re-run pip on Google Colab every so often, because the server gets restarted, and the library installations will be lost.</p>

</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In&nbsp;[&nbsp;]:</div>
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="o">!</span>pip install <span class="err">\</span>
<span class="n">redis</span> <span class="n">pathos</span> <span class="n">pyarrow</span><span class="o">==</span><span class="mf">1.0</span><span class="o">.</span><span class="mi">1</span> <span class="n">pandas</span><span class="o">==</span><span class="mf">1.0</span><span class="o">.</span><span class="mi">5</span> <span class="n">quandl</span> \
<span class="n">finmarketpy</span> <span class="n">chartpy</span> <span class="n">findatapy</span> \
<span class="n">cufflinks</span><span class="o">==</span><span class="mf">0.17</span><span class="o">.</span><span class="mi">3</span> <span class="n">kaleido</span> \
<span class="n">plotly</span><span class="o">==</span><span class="mf">4.9</span><span class="o">.</span><span class="mi">0</span>
</pre></div>

</div>
</div>
</div>

</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Using-Microsoft-Azure-Notebooks-with-Jupyter">Using Microsoft Azure Notebooks with Jupyter<a class="anchor-link" href="#Using-Microsoft-Azure-Notebooks-with-Jupyter">&#182;</a></h2><p>If you do not want to install Anaconda on your own machine (or if you don't have the correct permissions to do so), you can instead use Microsoft Azure Notebooks, which gives you a Jupyter notebook in the cloud. This can be a good solution for those wanting to learn Python. Note that Microsoft are phasing this out so I'd recommend Google Colab notebooks at present.</p>
<h3 id="Creating-your-first-Jupyter-notebook-in-Microsoft-Azure-Notebooks">Creating your first Jupyter notebook in Microsoft Azure Notebooks<a class="anchor-link" href="#Creating-your-first-Jupyter-notebook-in-Microsoft-Azure-Notebooks">&#182;</a></h3><p>Below we outline the steps to creating your first Jupyter notebook in Microsoft Azure Notebooks.</p>
<ul>
<li>Go to <a href="https://notebooks.azure.com/">https://notebooks.azure.com/</a> and sign in with your Microsoft account<ul>
Expand Down
41 changes: 37 additions & 4 deletions pythoncourse/installation/installing_anaconda_and_pycharm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@
"* In this prompt, your Anaconda folder will be on the path (ie. it will recognise where `conda` is installed etc.)\n",
" * Type in `conda activate` to exit the current conda environment and press Enter, then `conda remove -n py37class --all --yes` and press Enter to remove any existing environments called `py37class`\n",
" * If you haven't already downloaded the `environment_linux.yml` or `environment_mac.yml` file you can do it from the command line using `curl`:\n",
" * Type `curl https://raw.githubusercontent.com/cuemacro/teaching/master/pythoncourse/installation/environment_linux.yml > environment_linux.yml` and press Enter (or `curl https://raw.githubusercontent.com/cuemacro/teaching/master/pythoncourse/installation/environment_mac.yml` on Mac)\n",
" * Type in `conda env create -f environment_linux.yml` and press Enter (or `conda env create -f environment_mac.yml > environment_mac.yml` on Mac)\n",
" * Type `curl https://raw.githubusercontent.com/cuemacro/teaching/master/pythoncourse/installation/environment_linux.yml > environment_linux.yml` and press Enter (or `curl https://raw.githubusercontent.com/cuemacro/teaching/master/pythoncourse/installation/environment_mac.yml > environment_mac.yml` on Mac)\n",
" * Type in `conda env create -f environment_linux.yml` and press Enter (or `conda env create -f environment_mac.yml` on Mac)\n",
" * Anaconda will then run all the necessary command to download the various packages above using conda and pip\n",
" * At the end of the process you'll have a Python 3.6 conda environment with the name 'py37class' which you can use, with all the packages you'll need for this course, such as pandas, numpy etc.\n",
" * Note that you may need to put in the full path for wherever you downloaded the `environment_linux.yml` (or `environment_mac.yml`) file or you can simply `cd` to that folder and then run the above conda command\n",
Expand Down Expand Up @@ -315,13 +315,37 @@
"* PyCharm will create a workspace for you, where you can place your code"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Using Google Colab with Jupyter\n",
"\n",
"If you do not want to install Anaconda on your own machine (or if you don't have the correct permissions to do so), you can instead use Google Colab, which gives you a Jupyter notebook in the cloud. This can be a good solution for those wanting to learn Python. You'll need a Google account, otherwise you can't save down your notebooks. You can access it at https://colab.research.google.com/\n",
"\n",
"If you find there are libraries which aren't available, you can install these in Google Colab (as with any Jupyter notebook) using `!pip` inside the notebook. Below, we have a number of useful libraries to get you started. Note that you might need to re-run pip on Google Colab every so often, because the server gets restarted, and the library installations will be lost."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!pip install \\\n",
" redis pathos pyarrow==1.0.1 pandas==1.0.5 quandl \\\n",
" finmarketpy chartpy findatapy \\\n",
" cufflinks==0.17.3 kaleido \\\n",
" plotly==4.9.0"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Using Microsoft Azure Notebooks with Jupyter\n",
"\n",
"If you do not want to install Anaconda on your own machine (or if you don't have the correct permissions to do so), you can instead use Microsoft Azure Notebooks, which gives you a Jupyter notebook in the cloud. This can be a good solution for those wanting to learn Python. \n",
"If you do not want to install Anaconda on your own machine (or if you don't have the correct permissions to do so), you can instead use Microsoft Azure Notebooks, which gives you a Jupyter notebook in the cloud. This can be a good solution for those wanting to learn Python. Note that Microsoft are phasing this out so I'd recommend Google Colab notebooks at present.\n",
"\n",
"### Creating your first Jupyter notebook in Microsoft Azure Notebooks\n",
"\n",
Expand Down Expand Up @@ -522,6 +546,15 @@
"report_style_numbering": false,
"user_envs_cfg": false
},
"pycharm": {
"stem_cell": {
"cell_type": "raw",
"metadata": {
"collapsed": false
},
"source": []
}
},
"toc": {
"base_numbering": 1,
"nav_menu": {},
Expand All @@ -538,4 +571,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}

0 comments on commit aa9c03d

Please sign in to comment.