Throughout this article, I will discuss a step-by-step guide for using some of the top Python Integrated Development Environments/Code Editors:I. Google Colaboratory | II. Jupyter Notebook | III. Spyder. With a noteworthy guide for the feature of uploading Python code files to your Github account.
在整篇文章中,我将讨论使用一些顶级Python集成开发环境/代码编辑器的分步指南: I. Google Colaboratory 二。 Jupyter笔记本| 三, Spyder 。 关于将Python代码文件上传到您的Github帐户的功能的值得注意的指南。
I. Google合作实验室 (I. Google Colaboratory)
Colaboratory, or “Colab” for short, is a product from Google Research. Colab allows anybody to write and execute arbitrary python code through the browser, and is especially well suited to machine learning, data analysis and education.
合作实验室,简称“合作实验室”,是Google Research的产品。 Colab允许任何人通过浏览器编写和执行任意python代码,特别适合于机器学习,数据分析和教育。
Getting Started:
入门:
•Go to Google Colab: https://colab.research.google.com/
•转到Google Colab: https ://colab.research.google.com/
•From here, we can create a New Notebook. In which I named:“GitColabHW 200916 ATM”
•从这里,我们可以创建一个新笔记本。 我在其中命名为: “ GitColabHW 200916 ATM”
•Hovering over the cell will show the 2 cell type options: Code or Text
•将鼠标悬停在单元格上将显示2个单元格类型选项:代码或文本
•Here, the title ‘Coding with Google Colab’ is formatted as Text, while the python codes were formatted as Code where:
•这里,标题“使用Google Colab编码”的格式设置为“文本”,而python代码的格式设置为“代码” ,其中:
A. I have imported Numpy and Pandas Library.B. Uploaded a file named ‘DataSeerGrabPrizeData’C. Checked the details of the dataframe using the function .head() (c.1) I have also checked other details using .describe() (c.2) Removed null values using .dropna() (c.2) Replaced null values using .fillna()
A.我已经导入了Numpy and Pandas Library.B。 上传了一个名为“ DataSeerGrabPrizeData”的文件。C .使用函数检查了数据框的详细信息。 头()(C.1)我还检查其他细节使用.describe()(C.2)使用替换使用.fillna空值.dropna()(C.2)除掉的空值()
•After coding , downloading the notebook can be either as a python file (.py) or as a Jupyter notebook (.ipynb).
•编码后,可以以python文件(.py)或Jupyter笔记本(.ipynb)的形式下载笔记本。
Here, I have downloaded the notebook in .ipynb format. For the next section, I will try this code using Jupyter Notebook. Also, I will upload this downloaded file from Colab to my Github account in last section of this page, so stay tuned!
在这里,我以.ipynb格式下载了笔记本。 在下一节中,我将使用Jupyter Notebook尝试此代码。 另外,我将在此页面的最后一部分中从Colab将此下载的文件上传到我的Github帐户,敬请期待!
二。 Jupyter笔记本 (II. Jupyter Notebook)
The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. Uses include: data cleaning and transformation, numerical simulation, statistical modeling, data visualization, machine learning, and much more
Jupyter Notebook是一个开源Web应用程序,允许您创建和共享包含实时代码,方程式,可视化效果和叙述文本的文档。 用途包括:数据清理和转换,数值模拟,统计建模,数据可视化,机器学习等
Getting Started:
入门:
Open Anaconda Navigator, then Launch Jupyter Notebook
打开Anaconda Navigator,然后启动Jupyter Notebook
With Jupyter Notebook, I can open the same notebook file from Google Colab.
使用Jupyter Notebook,我可以从Google Colab打开相同的笔记本文件。
Also, I can create a New Notebook to code:
另外,我可以创建一个New Notebook进行编码:
Here I will run the same set of functions I used in Google Colab, then save it to a new csv file:
在这里,我将运行在Google Colab中使用的相同功能集,然后将其保存到新的csv文件中:
Using the function .dropna(), I removed the null values in the dataframe then saved it to a csv file.
使用.dropna()函数,我删除了数据框中的空值,然后将其保存到一个csv文件中。
For the next section, I will also try the same set of functions above using the Spyder IDE!
在下一节中,我还将使用Spyder IDE尝试上述相同的功能!
三, Spyder IDE (III. Spyder IDE)
Spyder is an open source cross-platform integrated development environment (IDE) for scientific programming in the Python language.
Spyder是一个开放源代码的跨平台集成开发环境(IDE),用于使用Python语言进行科学编程。
For your additional info’s— I have also tackled the basics of Spyder IDE here: https://medium.com/@angel.mariano/spyder-ide-and-command-line-the-basics-b66aa8277ff8
有关您的其他信息,我还在这里介绍了Spyder IDE的基础知识: https ://medium.com/@angel.mariano/spyder-ide-and-command-line-the-basics-b66aa8277ff8
Getting Started:
入门:
Open Anaconda Navigator, then Launch Spyder
打开Anaconda Navigator,然后启动Spyder
Here I will run the same set of functions I used in Google Colab and Jupyter Notebook, then also save it to a new csv file:
在这里,我将运行在Google Colab和Jupyter Notebook中使用的相同功能集,然后还将其保存到新的csv文件中:
From the Variable explorer, the contents of the dataframe can be displayed:
在变量浏览器中,可以显示数据框的内容:
After running the code, the new file generated using Spyder can now be seen in my local folder:
运行代码后,现在可以在本地文件夹中看到使用Spyder生成的新文件:
GitHub集成: (GitHub Integration:)
GitHub is a code hosting platform for version control and collaboration. It is a website and cloud-based service that helps developers store and manage their code, which lets you and others work together on projects from anywhere.
GitHub是用于版本控制和协作的代码托管平台。 这是一项基于网站和基于云的服务,可帮助开发人员存储和管理其代码,使您和其他人可以在任何地方共同处理项目。
In this section, we will cover:
. Uploading /Downloading files using cmd
. Git x Google Colab: Shortcuts to connect Colab and Github
在本节中,我们将介绍: 。 使用cmd上传/下载文件。 Git x Google Colab :连接Colab和Github的快捷方式
>在命令提示符下上传文件。(> Uploading files with the help of command prompt.)
For the basics of Command Prompt (Windows Command Line), check this out: https://medium.com/@angel.mariano/spyder-ide-and-command-line-the-basics-b66aa8277ff8
有关命令提示符(Windows命令行)的基础知识,请查看以下内容: https : //medium.com/@angel.mariano/spyder-ide-and-command-line-the-basics-b66aa8277ff8
Here, I have created a new repository called “git-and-colab-basics”
在这里,我创建了一个名为“ git-and-colab-basics”的新存储库
Using the command prompt, I have cloned this new repository.
使用命令提示符,我已经克隆了这个新存储库。
With this, I will try to upload the notebook I have downloaded from Colab to my Github account:
这样,我将尝试将从Colab下载的笔记本上传到我的Github帐户:
Using the functions: git add, git commit -m “rush commit” , and git push -u origin master, I was able to successfully upload the notebook to my github account:
使用以下功能: git add , git commit -m“ rush commit”和git push -u origin master,我能够成功地将笔记本上传到我的github帐户:
>使用cmd从存储库下载文件。 (> Downloading files from a repository using cmd.)
With GitHub, we can also download/save files from other repositories.
使用GitHub,我们还可以从其他存储库下载/保存文件。
Here, I have forked a repository made by other users, it allows me to have my own copy of the repository online. Moreover, I have also cloned this repository to save the files directly in my local drive:
在这里,我分叉了其他用户创建的存储库,它使我可以在线拥有自己的存储库副本。 此外,我还克隆了此存储库以将文件直接保存在本地驱动器中:
I have cloned the repository successfully using cmd, and we can verify this using File Explorer with the same file directory:
我已经使用cmd成功克隆了存储库,我们可以使用具有相同文件目录的File Explorer对此进行验证:
> Git x Google合作捷径 (> Git x Google Colaboratory Shortcuts)
Without the use of command prompt, we also the option to save our notebooks directly from Google Colab to our Github account.
在不使用命令提示符的情况下,我们还可以选择将笔记本直接从Google Colab保存到我们的Github帐户。
Python is such a powerful programming language, and learning this helps us to be versatile in doing even the most complex algorithms. So, maximize your skills in Python Programming with the help of some of these Python IDEs/Code Editors!
Python是一种功能强大的编程语言,学习它可以帮助我们在执行最复杂的算法时变得多才多艺。 因此,借助其中一些Python IDE /代码编辑器,可以最大限度地提高Python编程的技能!
翻译自: https://medium.com/swlh/working-with-the-best-python-ides-d71f43f4c5d4