微软出品的Python写码利器——Azure Notebooks

版权声明:禁止转载至其它平台,转载至博客需带上此文链接。 https://blog.csdn.net/qq_41841569/article/details/86570998

我们看看如何在Azure Notebooks安装你想要的包:

可以参考说明文档:

学习Python中有不明白推荐加入交流群

            号:960410445
            群里有志同道合的小伙伴,互帮互助,
            群里有不错的视频学习教程和PDF!

https://notebooks.azure.com/help/jupyter-notebooks/package-installation/python

可以在notebook中使用如下命令:

!pip install *<pkg name>*

或者

!conda install *<pkg name>* -y

我们发现numpy库已经安装,尝试安装了一个newspaper3k库:

image

image

我们从官方文档可以看到:

image

image

你自己新安装的包会在关闭服务后一小时后变得不可用, 下次使用时你可能需要重新快速运行安装使用。可能是考虑云空间的存储成本吧。

上传本地文件:

image

image

点击upload,选择本地文件,再选择上传的位置即可:

image

image

image

image

上传时选择上传位置为library可以持久性保持文件

此时我的library里就有刚才上传的文件了:

image

image

使用****curl 从 GitHub 获取数据:

例如这个 oil_price.csv 数据:

https://raw.githubusercontent.com/petroleum101/figures/db46e7f48b8aab67a0dfe31696f6071fb7a84f1e/oil_price/oil_price.csv

我们使用运行如下代码即可:

<pre style="margin: 1.64em 0px; padding: 7px 10px; max-width: 100%; box-sizing: border-box; word-wrap: break-word !important; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: 0.544px; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; overflow: auto; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 0.9em; line-height: 1.5; color: rgb(76, 76, 76); word-break: break-all; overflow-wrap: break-word; background-color: rgb(249, 249, 249); border-top: none; border-right: none; border-bottom: none; border-left: 4px solid rgb(218, 218, 218); border-radius: 0px; white-space: pre-wrap; text-align: start;">

!curl -L https://raw.githubusercontent.com/petroleum101/figures/db46e7f48b8aab67a0dfe31696f6071fb7a84f1e/oil_price/oil_price.csv -o oil_price.csv

</pre>

image

image

image

image

将library的文件代码下载到本地:

点击download即可

image

image

如果你要换运行环境,也是很方便的:

image

猜你喜欢

转载自blog.csdn.net/qq_41841569/article/details/86570998