Online Python environment (Azure Notebooks)

Online Python environment (Azure Notebooks)

Preface

The installation and use of anaconda is mentioned above. For those with poor hands-on ability, the installation is still too troublesome. Once there is a problem, they don't know how to check the error, and then choose to give up from the beginning.

Speaking of two obstacles to programming, one is environment configuration, and the other is programming error. This time, we first propose a feasible and easy-to-use method for environment configuration. This solution is Microsoft Azure Notebooks ( https://notebooks.azure.com/ ), you can use the Python environment by entering the URL, which is really out of the box. In this way, Ma Ma no longer has to worry that I can't learn Python anymore~

The outline shared today is:

Small scale chopper

1. we enter the URL to open Azure Notebooks, the interface is as follows:

Then click My Projects in the upper left corner (you will need to log in if you are not logged in, Microsoft account), and then you can see the following interface. Then click on New Project in the upper right corner to create our first file (this is equivalent to a folder on the computer side, where multiple notebook files can be placed).

Here we choose a name, the following two tick means:

  • Is it public
  • Whether to create a readme file

After creating a new file, we can create our first notebook in the following way. As you can see, there are not only multiple python environments, but also other languages ​​(R, F#).

In this way, we can write our Python code. As you can see here, Azure Notebooks has built-in a large number of third-party libraries, which are enough for our daily use.

Install the library

Of course, some libraries are not available, so we need to install them manually. The installation here is actually very simple. There are two methods below. Taking into account the storage cost of cloud space, libraries installed shortly after closing will be automatically deleted.

!pip install <pkg name>
!conda install <pkg name> -y
upload data

When doing data analysis, of course, we need data, and we need to upload the local data. In the File menu, select Upload, and then select the project (that is, the same path of the code), so that our data is uploaded.

save document

If you want to download the written code to the local, it is actually very simple. In the picture below, we can choose to download the entire file or download the notebook.

At last

This is still a bit stuck, sometimes you need to refresh the web page.

Reference: https://cloud.tencent.com/developer/article/1414929 Online Python Environment (Azure Notebooks)-Cloud + Community-Tencent Cloud