Python数据分析(中英对照)·Python Basics Python 基础

作者 : jamin 本文共4240个字,预计阅读时间需要11分钟 发布时间: 2020-10-18 共1479人阅读

1.1.1: Python Basics Python 基础

Python是一种解释语言。
Python is an interpreted language.
这意味着您可以运行Python程序,而无需首先链接或编译它们。
That means you can run your Python programs without the need to first link or compile them.
Python有两种不同的模式。
Python has two different modes.
这些模式称为交互模式和标准模式。
These modes are called the interactive mode and the standard mode.
交互模式用于一次试验一行代码或一个表达式。
The interactive mode is meant for experimenting your code one line or one expression at a time.
相比之下,标准模式非常适合从头到尾运行程序。
In contrast, the standard mode is ideal for running your programs from start to finish.
我自己经常在这两种Python模式之间切换。
Myself, I often alternate between these two Python modes.
如果手头的任务相对简单,我倾向于直接以标准模式编写代码。
If the task at hand is relatively easy, I tend to write the code directly in the standard mode.
但是,如果代码对我来说更具挑战性,我倾向于在交互模式下花费更多的时间。
However, if the code is more challenging to me,I tend to spend more time in the interactive mode.
这样,我可以在将每一行导入标准模式之前完善每一行。
That way I can perfect every line before I import that to the standard mode.
Python程序往往比C或C++或java中的等效程序短得多。
Python programs tend to be much shorter than equivalent programs in C or C++ or Java.
这是因为Python是一种高级语言。
This is because Python is a high-level language.
它的数据类型允许您以非常简洁的方式表达复杂的操作。
It has data types that allow you to express complex operations in a very concise manner.
最后,您应该知道Python是如何命名的。
Finally, you should know how Python gets its name.
Python并不像你想象的那样以蛇命名。
Python is not named after the snake, as you might have imagined.
事实上,Python的名字来源于《英国广播公司》MythyPython的飞行马戏团,这是我极力推荐的一个节目。
In fact, Python is named after the inimitable BBC show Monty Python’s Flying Circus, a show that I highly recommend.
除了使用核心Python之外,我们还将使用几个Python包来执行科学计算。
In addition to using just core Python, we’ll be using several Python packages to perform scientific computations.
但是,我们将使用Python发行版,而不是一次手动安装200多个包。
But instead of installing more than 200 packages manually one at a time, we will be using a Python distribution.
发行版由核心Python包和数百个模块组成,所有模块都可以无缝地协同工作。
A distribution consists of the core Python package and several hundred modules, all working seamlessly together.
所有这些都可以通过一次下载获得。
All of this is available through a single download.
目前有几种Python发行版可用。
There are currently several Python distributions available.
我们将在本课程中使用的是Anaconda Python发行版。
The one we will be using in this course is called the Anaconda Python distribution.
在录制时,此重新分发支持近300个包,并且几乎每天都会添加新包。
At the time of recording, this redistribution supports almost 300 packages and new packages are added almost daily.
此外,Anaconda还包括两个非常有用的开发环境,分别称为Jupyter和Spyder。
In addition, Anaconda also includes two very useful development environments,which are called Jupyter and Spyder.
本课程将广泛使用这两种环境。
This course will be making extensive use of both of these environments.
经常会出现以下问题:
Questions often come up:
我应该学习Python 2还是Python 3?
Should I learn Python 2 or Python 3?
事实是,有些人更喜欢Python 2,有些人更喜欢Python 3。
And the truth of the matter is, some people like Python 2 better, some people like Python 3 better.
了解更多关于Python 2和Python 3问题的有用地方是Python.org。
A useful place for learning more about the Python 2 versus Python 3 issue is python.org.
该网站提供了一份特别简明的情况摘要。
That website provides an especially concise summary of the situation.
根据该网站,Python2是传统的,而Python3是该语言的现在和未来。
According to the website, Python 2 is legacy,whereas Python 3 is the present and future of the language.
事实上,Python3已经存在好几年了。
Python 3 has, in fact, been around for already several years.
Python 3.0于2008年发布。
Python 3.0 was released in 2008.
那么Python3有什么缺点吗?
So are there any downsides to Python 3?
实际上,只有一个主要的缺点,那就是Python3与Python2不向后兼容。
Well, there is really only one principal downside which is that Python 3 is not backwards compatible with Python 2.
这意味着,如果您用Python3编写代码,运行Python2的人将无法运行该代码。
What that means, if you write your code in Python 3, somebody running Python 2 will not be able to run that code.
这就是我们在本课程中使用Python 3的原因。
Here is why we will be using Python 3 in this course.
所有新的标准库改进只在Python3中默认可用。
All new standard library improvements will only be available by default in Python 3.
Python3对于新手来说也更容易学习,核心语言的几个方面是
Python 3 is also easier for newcomers to learn,and several aspects of the core language are
比Python2中的更加一致。
more consistent than those in Python 2.
Python3还消除了许多容易让刚开始学习Python的程序员绊倒的怪癖。
Python 3 also eliminates many of the quirks that can easily trip up beginning programmers learning Python.
因此,现在是学习Python 3的好时机。
So this is a good time to be learning Python 3.
许多核心Python开发人员认为,Python 3显然是新项目学习的首选,
Many of the core Python developers believe that Python 3 became the obvious choice to learn for new projects,
从2015年9月开始。
starting in September 2015.
建议人们学习Python 3,除非他们有很好的理由学习Python 2。
The recommendation is that people learn Python 3 unless they have a very good reason to be learning Python 2.
所以,除非你有非常特殊的理由学习Python 2,否则我想邀请你和我一起学习Python 3。
So unless you have a very special reason to learn Python 2,I would like to invite you to learn Python 3 with me.

本站所提供的部分资源来自于网络,版权争议与本站无关,版权归原创者所有!仅限用于学习和研究目的,不得将上述内容资源用于商业或者非法用途,否则,一切后果请用户自负。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容资源。如果上述内容资对您的版权或者利益造成损害,请提供相应的资质证明,我们将于3个工作日内予以删除。本站不保证所提供下载的资源的准确性、安全性和完整性,源码仅供下载学习之用!如用于商业或者非法用途,与本站无关,一切后果请用户自负!本站也不承担用户因使用这些下载资源对自己和他人造成任何形式的损失或伤害。如有侵权、不妥之处,请联系站长以便删除!
金点网络 » Python数据分析(中英对照)·Python Basics Python 基础

常见问题FAQ

免费下载或者VIP会员专享资源能否直接商用?
本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。
是否提供免费更新服务?
持续更新,永久免费
是否经过安全检测?
安全无毒,放心食用

提供最优质的资源集合

立即加入 友好社区
×