I'm going to talk about the focus of our course mastering Python for beginners in data science. 我将讨论我们为数据科学初学者 掌握 Python 的课程的重点。
So let me explain what kind of areas in this particular course we are focusing the most. 因此，让我解释一下我们在这门 特定课程中最关注的领域。
In fact, because this is a course, for beginners, that's a beginner level course, we are not 事实上，因为这是一门课程，对于初学者来说 ，那是一门初级课程，我们不是
assuming the the course taker to have any experience whatsoever about any computer programming 假设课程学习者对任何 计算机编程有任何经验
language before, not even not even the problem, problem solving paradigm that lies in computer 之前的语言，甚至不是问题， 问题解决范式在于计算机
science. So, we will, we will focus on problem solving for a bit. And we will actually start 科学。所以，我们会，我们将专注 于解决问题。我们将真正开始
from the very beginning what problem solving is, particularly in computer science. The 从一开始什么是解决问题，特别是 在计算机科学中。这
second focus of this particular course, is mainly telling you why we are choosing Python, 这门课程的第二个重点，主要是 告诉你我们为什么选择 Python，
why Python is so important, particularly for data science problems. The third focus and 为什么 Python 如此重要，尤其是对于 数据科学问题。第三个重点和
the main core focus is to learn Python, obviously, once we know what is what what are the techniques 主要的核心重点是学习Python，显然，一旦 我们知道什么是什么技术是什么
to solve a problem. And once we know that Python might be a very good language to go 解决一个问题。一旦我们知道 Python 可能是一种非常好的语言
with, then what is Python, how to learn it? Well, the Python is the main core and main 有了，那么Python是什么，怎么学呢？ 嗯，Python 是主要的核心和主要的
focus of this course, obviously, we will start from the very beginning, very, very beginning, 这门课程的重点，显然，我们将 从一开始，非常，非常开始，
which means we will start from how to install Python for example, we will start from there, 这意味着我们将从如何安装 Python 开始，我们将从那里开始，
and then we will see what are variables, I mean, very, very beginning, and then progressively 然后我们将看到什么是变量，我 的意思是，非常非常开始，然后逐步
we will be moving on and on and on to data structures to complex structures, but that 我们将不断地从数据结构 到复杂的结构，但是
transition from 02 onwards, that transition will be very, very smooth. I mean, whatever 从 02 年开始过渡，过渡将非常 非常顺利。我的意思是，无论
you know, so far, in the course, that will be helping you to gain more complex structures 你知道，到目前为止，在课程中 ，这将帮助你获得更复杂的结构
very, very easily getting the understanding of a lot of structures very, very easily. 非常非常容易地理解 很多结构。
So in this Python, we will include all concepts of Python in general. And, and one more thing, 所以在这个 Python 中，我们将概括地包含 Python 的所有概念。而且，还有一件事，
after I mean learning, despite on the way we the way we organize this course of learning 在我的意思是学习之后，尽管 在我们组织这门课程的方式上
this Python, you will be having an understanding of other languages as well. I mean, the contents 这个 Python，你也会理解其他 语言。我的意思是内容
here are explained in so general way all over the Python syntax, but the general but but 这里以如此一般的方式解释了 整个 Python 语法，但一般但
but the concepts are expressed in so general way, the problems that we picked to solve 但是这些概念以非常笼统的方式 表达，我们选择解决的问题
for practice are so generic that you will after this particular Python course, you will 因为练习是如此通用，以至于你会 在这门特定的 Python 课程之后，你会
be having understanding of programming languages in general. So data science is one other focus 对编程语言有一般的了解。所以 数据科学是另一个重点
of this course, actually, the whole course is organized in a way that it teaches you 在这门课程中，实际上，整个 课程的组织方式是教给你的
about Python, it teaches you problem solving, it teaches you something about overall programming 关于 Python，它教你解决问题， 它教你一些关于整体编程的知识
languages and how computer can be used to achieve the solution of different problems. 语言以及如何使用计算机 来解决不同的问题。
And and using Python, of course, and then we will be introducing the data science packages 并且使用 Python，当然， 然后我们将介绍数据科学包
that are available in Python, because they are really, really fast, really fundamental, 在 Python 中可用，因为它们 非常非常快，非常基础，
very easy to use, and very, very powerful to handle large amount of data very quickly 非常易于使用，并且非常非常强大 ，可以非常快速地处理大量数据
for data understanding for visualization, for cleaning, processing, and a lot of stuff, 用于数据理解、可视化、 清理、处理和很多东西，
what we are not focusing at because that's important. Knowing that what kind of things 我们没有关注什么，因为那 很重要。知道什么样的事情
are are are the things that we are not covering, for example, we are not covering object oriented 是我们没有覆盖的东西，例如 ，我们没有覆盖面向对象
programming, we are not covering exception handling, we are not doing web development, 编程，我们不涉及异常处理 ，我们不做网络开发，
or any general kind of tasks that are doable in Python, we are not focusing on those things. 或者任何可以在 Python 中完成的一般 任务，我们不关注这些事情。
Everybody solves different problems every day. Some problems are easy to solve, and 每个人每天都在解决不同的问题 。有些问题很容易解决，而且
some are difficult. And yet some are impossible to solve. They are called unsolvable problems. 有些是困难的。然而有些是不可能解决 的。它们被称为无法解决的问题。
But think about different instances of the same problem one needs to solve again and 但是想想需要再次解决的 同一问题的不同实例
again. For example, sorting the sale records. And let's say we are sorting the sale records 再次。例如，对销售记录进行排序 。假设我们正在整理销售记录
with respect to the sale value. And we have to do it after every eight hours. If the number 关于销售价值。我们必须 每八小时后做一次。如果数
of instances if that number is huge, the optimal choice is to automate the solution if the 如果这个数字很大，最佳选择 是自动化解决方案，如果
automation is possible, but how how to come up with the automated solution to come up 自动化是可能的，但是如何 想出自动化的解决方案来
with a general solution that works for every instance of some problem. That is one thing. 具有适用于某些问题的每个实例 的通用解决方案。那是一回事。
But to get that solution running on a computer is yet another thing 但是让该解决方案在计算机上运行 又是另一回事
Problem Solving deals with formalizing a general solution for that works for every instance. 问题解决涉及形式化适用于每 个实例的通用解决方案。
And programming languages, like Python deals with the running of that solution on a computer. 和编程语言，比如 Python 处理 在计算机上运行该解决方案。
Python, as, as we will see, makes the transition from problem solving to the running solution 正如我们将看到的，Python 实现了从 解决问题到运行解决方案的转变
much easier and quicker. And that's one big plus of Python. A lot of words, I know a lot 更容易和更快。这是 Python 的一 大优势。很多话，我知道很多
of words. Let me take an example to clarify what I said, Hold on till the end of this 的话。让我举个例子来澄清 我所说的，坚持到这结束
video. And I will make everything what I said so far, crystal clear. So let's take an example. 视频。我会把到目前为止我所说的一切 都说得一清二楚。所以让我们举个例子。
Let's dive into an example to see what I just said. Let's say your a, and your friend is 让我们深入一个例子，看看我刚才说了 什么。假设您是 a，而您的朋友是
B. And your friend B is always willing to help you. Let's say you found such a friend. B. 你的朋友 B 总是愿意帮助你 。假设您找到了这样的朋友。
And then a just said, I want off just for some days. But be said, but what ghobadi enjoy. 然后一个刚刚说，我想休息几天。 但不得不说，不过什么ghobadi享受。
He said, someone have to do my job in my absence. And then be said, That's it? Is that your 他说，在我不在的情况下，必须有人来做我的 工作。然后被说，就这样？是你的
problem? I'm available? As always go buddy, enjoy. Man. He said, great. You're a true 问题？我有空？和往常一样，伙计，享受。 男人。他说，太好了。你是一个真实的
friend. Okay, I'm leaving, wow. And be just said, Hey, wait, what do I have to do? What's 朋友。好的，我要走了，哇。只是说 ，嘿，等等，我该怎么办？什么是
your job? At the end of the day, I'm going to do your job. What's your job? What do you 你的工作？归根结底，我会做你的工作 。你的工作是什么？你是什​​么
do? And then he said, after every eight hours, pick the email of the customer when the maximum 做？然后他说，每八小时后，在 最大的时候选择客户的电子邮件
sales. So that's what you have to do. He said, Okay. But from there, I mean, I have to pick 销售量。所以这就是你必须做的。他说，好 。但从那里，我的意思是，我必须选择
that email of the customer from where, where are the records? He said, Well, there are 那个客户的电子邮件来自哪里， 记录在哪里？他说，嗯，有
sales records. I mean, at the job place, there are sales records. And you have to pick the 销售记录。我的意思是，在工作场所 ，有销售记录。你必须选择
email of the customer with maximum sales. We said, Oh, okay. But wait, what, what should 销售额最高的客户的电子邮件。我们说 ，哦，好吧。但是等等，什么，应该怎么做
I do with the email that I just picked? Then he said, oh, there is an other record called 我如何处理我刚刚选择的电子邮件 ？然后他说，哦，还有一个记录叫
priority records, just write that email after eight hours, just write that email in purity 优先记录，八小时后写那封 邮件，纯粹地写那封邮件
records. And then be said, that's it. That's all your job. And he said, after so relaxed, 记录。然后说，就是这样。这就是你的 全部工作。他说，在如此放松之后，
he said, Yes, that's my job. That's all. No, think he leaves and later that day receives 他说，是的，那是我的工作。就这样。不 ，认为他离开了，那天晚些时候会收到
a call from B. And B said, I don't really know what to do. Can you tell me step by step? B 打来的电话。 B 说，我真的不知道 该怎么办。你能一步一步告诉我吗？
What to do? Focus on again, I'm reading this particular sentence again. Can you tell me 该怎么办？再次关注，我正在再次阅读 这个特定的句子。你能告诉我吗
step by step what to do? I have sales records with me having all the records for the last 一步一步做什么？我有销售记录 ，我有上次的所有记录
eight hours, what to do, I just messed everything up. I don't know what to do. And then at the 八个小时，怎么办，我只是把一切都搞 砸了。我不知道该怎么办。然后在
call, he just described a procedure to be for his job. That procedure or a general solution, 打电话，他只是描述了一个适合他工作 的程序。那个程序或者一个通用的解决方案，
let's see the solution. He said number one, start from the first record, there may be 让我们看看解决方案。他说第一， 从第一条记录开始，可能会有
several columns of the record, the customer name, the customer phone number, the customer 几列记录，客户姓名 ，客户电话，客户
email, the customer products that he buys and the total sales. And in the point one 电子邮件、他购买的客户产品 和总销售额。在第一点
said, he said, start from the first record, and focus just on the sales column. Okay, 说，他说，从第一条记录开始 ，只关注销售栏。好的，
then, then after that, go to each next record one by one, and find the record with a maximum 然后，再之后，逐条查找下 一条记录，找到最大的记录
sales. Obviously, once you have focused on the sales column, you're just comparing sales 销售量。显然，一旦你关注了销售 栏，你就只是在比较销售额
of different records with each other and will eventually come up with a record that have 不同的记录相互之间，并 最终会拿出一个记录
maximum sales. Number three. 最大销售额。第三。
If there are more than one records with maximum sales, it is possible that the maximum sales 如果有多个记录的最大销售额 ，则可能是最大销售额
value let's say is 100, whatever the units are, and there may be two or three or maybe 价值让我们说是 100，无论单位是什么 ，可能有两个或三个，或者可能
five records with the maximum sales 100. Then which one to pick, as described here in Step 5 个最大销售额为 100 的记录。然后 选择哪一个，如步骤中所述
three, that if there are more than one records with maximum sales, then pick the first one 三、如果销量最大的记录不止 一条，则选择第一条
from top to bottom and ignore the rest I mean, whichever is the sole. So let's say you have 从上到下，忽略其余部分，以唯一 为准。所以让我们说你有
five records with maximum sale value, which record appears first from top to down, just 销售价值最大的五个记录，从上 到下哪个记录最先出现，只是
pick that one and ignore the rest. That might be a policy that might might be a tie breaking 选择那个并忽略其余的。这可能 是一项可能打破平局的政策
policy, but just do that. And then the fourth step is focus on the email column of the record 政策，但只是这样做。然后 第四步关注记录的email栏
you found in step three. In Step three, you found a column with maximum sales. Step five, 你在第三步中找到了。在第三步中， 您找到了销售额最大的列。第五步，
see the email address and write that address in the priority records. So that's for the 查看电子邮件地址并将该地址写在 优先级记录中。所以这是为了
eight hours, then repeat this process, see the step six, then repeat this procedure, 八小时，然后重复这个过程，看 第六步，然后重复这个过程，
after every eight hours, I'm gonna repeat this procedure, I mean, you'll see the the 每八小时后，我会重复这个过程 ，我的意思是，你会看到
solution a is communicating to be in in this in these kind of steps. It it gives me It 解决方案a在这种步骤中正 在沟通中。它给了我它
gives a precise idea of what to do. Still, there may be some, there may be some questions 给出了一个准确的想法。不过 ，可能有一些，可能有一些问题
to be is maybe asking, for example, B may ask how to find out a maximum, B might be 成为可能是问，例如，B 可能会 问如何找出最大值，B 可能是
that person who don't know how to find out the maximum. And third, for example, another 那个不知道如何找出最大值的 人。第三，例如，​​另一个
question we might may ask is that when when I'm going to write the email address in the 我们可能会问的问题 是，当我打算在
priority rock records, where should I write at the very top or at the end or somewhere 优先摇滚唱片，我应该在哪里写 在最顶部或最后或某个地方
or, but at the end of the day, a solution a step by step solution is required for communication, 或者，但归根结底，一个解决方案 需要一个循序渐进的解决方案来进行沟通，
this kind of if you see the solution, although it has some it may be explained in there may 这种如果你看到解决方案，虽然 它有一些它可能会在那里解释
be more steps that should be added, but if you see the solution, the step by step solution, 应该添加更多步骤，但是如果您 看到解决方案，逐步解决方案，
this is a general solution. This is a general solution, much more general solution for every 这是一个通用的解决方案。这是一个通用的 解决方案，对于每一个更通用的解决方案
instance, but every instance I mean, after every eight hours, you will be having some 例如，但我的意思是，每 八小时后，你都会有一些
records, and you have to do this procedure on the records for that eight hours. And then 记录，并且您必须对那八个小时 的记录执行此程序。进而
after that, that after that eight hours, you will be having more records to work on. So 在那之后，在那八个小时之后，你 将有更多的记录需要处理。所以
after every eight hours, you have the same, the problem is the same, but the instance 每八小时后，你有相同的， 问题是相同的，但实例
is different, because the records after eight hours are different. But but the but the solution 不同，因为八小时后的记录不同 。但是，但是，但是解决方案
says whatever the instance you are right, right now, whatever the instance is that you're 说无论你是对的什么情况 ，现在，无论你是什么情况
in, just perform these, these steps, a step by step solution, coming up with a step by 在，只需执行这些，这些步骤 ，逐步解决方案，逐步提出
step solution is is one module of the one module of the problem solving. And there's 步骤解决方案是解决问题的一 个模块中的一个模块。还有
step by step solution is called algorithm. 逐步解决方案称为算法。
algorithm. Obviously, the step by step solution is not always required to be communicated 算法。显然，并不总是需要 传达逐步解决方案
in plain English or in natural language, you may come up with shorthands or shortcuts to 用简单的英语或自然语言，您 可能会想出速记或快捷方式
explain these step by step solution. So, the the more shortcuts the more precise and unique 解释这些逐步解决方案。所以 ，捷径越多越精确和独特
meaning keywords you use in your step by step solution, the more better communication of 意思是您在逐步解决方案中使用 的关键字，更好的沟通
your solution takes place. And going from this step by step solution, which is just 你的解决方案发生了。从这个一 步一步的解决方案开始，这只是
in plain English, going from this to a more concise and unique kind of procedure, that 用简单的英语，从这个到一个 更简洁和独特的程序，那个
that can that kind of work that one step that will take us from there to there, that we 那种工作可以让我们从那里 到那里的一步，我们
will see in the next video will be called a pseudocode. And from that pseudocode there 将在下一个视频中看到将被称为 伪代码。从那里的伪代码
will be few steps that will take us to the second major problem that the problem problem 将采取几个步骤，将带我们到 第二个主要问题，即问题问题
languages will solve the get the solution running on a computer. So I'm just just in 语言将解决在计算机上运行 的解决方案。所以我只是在
this video i i wanted to explain you that solving a problem may not be that hard, I 这个视频我想向你解释解决 一个问题可能并不难，我
mean, coming up with a coming with coming up with a solution of a problem may not be 意思是，想出一个问题 的解决方案可能不是
that hard, but communicating that solution or, or writing that solution in a form of 很难，但要传达该解决方案，或 以某种形式编写该解决方案
procedure that can solve every instance of that problem that that requires a step by 可以解决需要逐步解决该 问题的每个实例的程序
step treatment of the procedure. And those those steps they should be linked in a sequence 程序的步骤处理。那些 应该按顺序链接的步骤
and they should be unambiguous. And if a particular step requires more elaboration, that step 他们应该是明确的。如果一个特定的步骤 需要更多的细化，那一步
might be broken down to further steps. But that step by step solution at the end of the 可能会分解为进一步的步骤。但是 在最后一步一步的解决方案
day is called algorithm. Now that algorithm might be in English, but we will see in the 一天被称为算法。现在该算法 可能是英文的，但我们将在
later video that there are better ways of expressing algorithms better than English 后来的视频说有比英语 更好的表达算法的方法
or better than natural languages. So, so, if you have another problem come up with a 或优于自然语言。所以，所以， 如果你有另一个问题，想出一个
step by step solution of that, though, every instance of that problem should be solved 逐步解决这个问题，但是，应该 解决该问题的每个实例
by that step by step solution, which is called algorithm. And in the next video, we will 通过逐步解决方案，这称为算法 。在下一个视频中，我们将
see how to actually how to actually eliminate the need of having English with us and how 看看如何实际上如何消除与我们 一起使用英语的需要以及如何
to incorporate the uniqueness of understanding of these steps or algorithm using using the 结合使用这些步骤或算法 的理解的独特性
concepts of pseudocode. And after the pseudocode, we will see it will be very quick to jump 伪代码的概念。在伪代码之后， 我们会看到它会很快跳转
to any programming language and we will see that the Python is very close to what humans 任何编程语言，我们将看到 Python 非常接近人类
generally think, I mean, it's very easy, the transition will be very, very easy. So, hope 一般认为，我的意思是，这很容易， 过渡会非常非常容易。所以，希望
to see you in the next video and I'll be explaining algorithms in in, in a in a more kind of keyword 在下一个视频中见到你，我将解释算法 in a in a in a in a more kind of关键字
way. And, and in the same video we'll be focusing on pseudo codes which are basically pre step 道路。并且，在同一个视频中，我们将重点介绍 伪代码，这些伪代码基本上是前步骤
off of the actual core of any programming language. So, hope to see you in the next 脱离任何编程语言的实际核心 。所以，希望下次再见
video. Okay, in in the last video, we were talking about the algorithm what an algorithm 视频。好的，在上一个视频中 ，我们讨论了算法是什么算法
is and how to express that any any algorithm and we saw that algorithm is just a step by 是以及如何表达任何算法，我们 看到该算法只是一步一步
step procedure. But, but how to express an algorithm may vary, I mean, you need not always 步骤程序。但是，但是如何表达算法可能 会有所不同，我的意思是，您不必总是
to have plain English to or any natural language to express algorithm. The reason is that the 用简单的英语或任何自然语言 来表达算法。原因是
natural languages are normally so expressive, and each and every sentence they may have 自然语言通常如此富有表现力， 他们可能拥有的每一个句子
multiple meaning. So, it is it is a good idea to come up with a structured way to express 多重含义。因此，提出一种结构化 的表达方式是个好主意
an algorithm such that each and every statement is completely unambiguous. And one such way 一种算法，使得每个语句都完全 明确。还有这样一种方式
is is to express algorithms using flowcharts flowcharts are our graphical ways of expressing 是使用流程图来表达算法流程图 是我们表达的图形方式
algorithms. Here we are taking. The problem here we are discussing is is computing PE 算法。在这里，我们正在采取。 我们这里讨论的问题是计算PE
of different employees of some company. And the procedure of I mean, if there are several 一些公司的不同员工。我 的意思是，如果有几个
employees, let's employ one employee to employ three and so on. Let's say there are several 员工，让我们雇用一名员工雇用三 名员工，依此类推。假设有几个
employees in a company and having each employee has name, phone number, email and all the 一家公司的员工，让每个员工都有姓名 、电话号码、电子邮件和所有
credentials. And then let's say the pay is computed on hourly basis, and each employee 证书。然后假设工资是按 小时计算的，每个员工
has worked certain hours for example, eight hours and each employee has an hourly rate 已经工作了一定的时间，例如八小时 ，每个员工都有一个小时费率
might be let's say 100 units, whatever the units are 可能比方说 100 个单位，无论单位 是什么
employed to might have worked for example, seven hours, but the hourly rate of this employee 例如，受雇于可能工作了 7 小时，但该员工的小时费率
might be 200 different employees, they might have worked for different number of hours, 可能是 200 名不同的员工，他们 可能工作了不同的小时数，
and each employee can have a different hourly rate depending upon the capacity of the employee 每个员工可以有不同的小时费率 ，具体取决于员工的能力
or the or the job nature the employee is doing and so on. So, so, so, if we want to compute 或员工从事的工作性质等。所以， 所以，所以，如果我们想计算
pay of all employees, one by one, the procedure of computing pay is stays the same, the instances 所有员工的工资，一一计算 工资的程序保持不变，实例
they differ for employee one, the value of our is eight the value of Raiders 100 for 他们对员工一不同，我们的 价值是八，攻略100的价值
employee to the procedure will stay the same the values of our end rate they will differ 程序的员工将保持不变我们的最终 费率的值他们会有所不同
so what should be the procedure, the procedure might be that you take the take the input 那么程序应该是什么，程序 可能是你接受输入
of let's say employ one or whatever employee you are going to compute salary for take the 假设雇用一名或任何 您要计算薪水的员工
hours hours value in a in a placeholder call that place or call that placeholder as ours 占位符中 a 中的小时小时值调用该 位置或将该占位符称为我们的
placeholder or a variable y this is called a variable because for different employers 占位符或变量 y 这被称为变量 ，因为对于不同的雇主
this value will different will be different, ours will take value eight for each one employee 这个值会有所不同，我们 会为每个员工取八
one this this variable, this placeholder will take value seven for employee two and so on. 一个这个这个变量，这个占位符将为 第二个员工取值七，依此类推。
Similarly, once whatever employ whatever employ for which you are going to compute the pay, 类似地，一旦雇佣了任何 你要计算工资的雇员，
if you have taken the hours from some records from some working records, then take the rate 如果您从某些工作记录中提取了 某些记录的小时数，则取费率
for the same employer as well. So input this that step one in Purdue that is step two, 也适用于同一个雇主。所以输入普渡 大学的第一步，也就是第二步，
the steps the sequence of these two steps may change for example, you take the you take 这两个步骤的顺序可能会发生变化 ，例如，您采取您采取的步骤
the rate value first and ours value later than that, but either way, that's one way 首先是比率值，然后是我们的值， 但无论哪种方式，这是一种方式
of that's one way of expressing this this procedure. And then you compute the pay by 这是表达这个过程的一种 方式。然后你计算工资
this formula. So hours multiplied by rate. So maybe this is confusing writing a star. 这个公式。所以小时数乘以费率。 所以也许这会让写明星感到困惑。
Maybe maybe We should write this cross symbol because that is more common in mathematics. 也许也许我们应该写这个十字符号 ，因为这在数学中更常见。
Or maybe this whole line can be replaced by, by this particular line, maybe. So pay is 或者，也许整条线可以由这条特定线 替换，也许。所以工资是
equal to multiply hours. And rate. Maybe this is more expressive, but it completely depends, 等于乘以小时。和率。也许这更 具表现力，但这完全取决于，
I mean, when you start writing pseudocode, or whatever pseudo codes you're writing, what 我的意思是，当您开始编写伪代码 或正在编写的任何伪代码时，
kind of keywords begin is a keyword and is a key word, what kind of keywords you're using, 类型的关键字开始是一个关键字并且是一 个关键字，您使用的是什么类型的关键字，
and stay with those keywords for example, if the keyword input is to use to take to 并保留这些关键字，例如，如果 要使用关键字输入来获取
get the values to to process on then the input should stay everywhere wherever we want to 获取要处理的值，然后输入应该 留在我们想要的任何地方
do such kind of operation. If you if you're using for example, the value get rather than 做这样的操作。例如，如果您正在 使用，则该值是 get 而不是
input then use get always but come up with some set of keywords that are expressive, input 然后使用 get always 但提出一些 富有表现力的关键字集，
as well as concise and then take the sequence of those statements, each and every statement 以及简洁，然后取这些语句 的顺序，每一个语句
should be should have a unique meaning, it should not be ambiguous, and the sequence 应该有唯一的意义，不应该 有歧义，并且顺序
should be in the sequence describe the flow of what is happening, what is going on. So, 应该在序列中描述正在发生的事情 的流程，正在发生的事情。所以，
first we take hours, then we take rate these two values for for for any kind of employee, 首先我们需要几个小时，然后我们为任何 类型的员工对这两个值进行评分，
and then we will just multiply them and after multiplication, whatever the scene we want 然后我们将它们相乘，相乘后 ，无论我们想要什么场景
to make, based on this pay, we will do that, we may we may record this value, display value 制作，基于这个支付，我们会这样做 ，我们可能会记录这个值，显示值
at at some other records register, we may we may print that value on a print slip, we 在其他一些记录登记处，我们可能 会在打印单上打印该值，我们
may have emailed this value to some other department or whatever to see and we want 可能已将此值通过电子邮件发送给其他 某个部门或任何我们想要查看的内容
to make, but the procedure really is still here, then based on pay whatever action we 制作，但程序真的还在这里， 然后根据支付我们的任何行动
are going to do that that may differ. Similarly if we go this is this is I mean, some kind 将要这样做可能会有所不同。同样，如果 我们去，这是我的意思，某种
of structured example of, of the, of the expressiveness of an algorithm which is called pseudocode. 被称为伪代码的算法的表达 能力的结构化示例。
And what kind of keywords you're going to use, there are no general keywords, I mean, 你要使用什么样的关键字，没有 一般的关键字，我的意思是，
some people may use get some people may use different kinds of keywords for it, but it 有些人可能会使用 get 有些人可能 会使用不同种类的关键字，但它
is good to come up with a set of keywords to to describe the describe the solution of 最好提出一组关键字 来描述描述解决方案
the solution of the problem in flowchart for example, everything every every statement 例如流程图中问题的解决方案 ，每一个语句的所有内容
here, that is here in in pseudocode every statement is described as a shape different 在这里，在伪代码中，每个 语句都被描述为不同的形状
shapes for different kinds of statements. If you want to take input, then you have to 不同类型语句的形状。如果 你想接受输入，那么你必须
describe that action using a parallelogram. If you're going to do some computation, you 用平行四边形描述那个动作 。如果你要做一些计算，你
have to express that using a rectangle the start symbol and end symbol the start and 必须使用矩形表示开始符号 和结束符号表示开始和
end of any procedure in flowcharts they are described by the ovals For example, this oval 流程图中任何程序的结尾，它们 由椭圆形描述 例如，这个椭圆形
in that oval normally the flowchart sequences from top to down, but it is always good to 在那个椭圆形中，流程图通常 是从上到下的，但总是好的
just print the arrows to describe the flow, because in complicated flowcharts there are 只需打印箭头来描述流程， 因为在复杂的流程图中有
there are loops there are if conditions there are so many things. So it is good always to 有循环，如果条件有这么 多东西。所以总是好的
describe the flow using using arrows. So, now the question is flowchart or pseudocode 使用箭头描述流程。所以，现在 的问题是流程图或伪代码
because flowchart also looks like a very cool way of writing. expressing an algorithm and 因为流程图看起来也是一种非常 酷的写作方式。表达算法和
pseudocode is also a way of expressing an algorithm. Well, converting flowchart to actual 伪代码也是一种表达算法的方式 。那么，将流程图转换为实际
programming code is somewhat tedious, writing a pseudocode beforehand, which is readable, 编程代码有些繁琐，事先写 个伪代码，可读性强，
which is precise, concise, as well as unambiguous then converting that pseudocode to code of 这是精确、简洁且明确的， 然后将该伪代码转换为
any programming language, that is not that hard, that is simple in writing flowcharts 任何编程语言，不那么 难，编写流程图很简单
for very complicated problems is somewhat tedious, because then it It also requires 对于非常复杂的问题有点 乏味，因为那么它也需要
another transition from flowchart to reactive programming code. That's why writing pseudocode 从流程图到反应式编程代码的另一 种转变。这就是为什么要写伪代码
is more feasible, if the goal eventually is to convert that pseudocode to some core of 更可行，如果目标最终 是将该伪代码转换为
programming language. So, you can go with flowcharts you can go with pseudocode either 编程语言。因此，您可以使用 流程图，也可以使用伪代码
one is fine, but more feasible way of expressing algorithms is a pseudocode. That was just 一种很好，但更可行的算法表达 方式是伪代码。那只是
a very simple example. I mean computing, computing salary of an employee writing a procedure 一个非常简单的例子。我的意思是计算 ，计算编写程序的员工的工资
for that. I mean, this is so simple, nobody make your writing that kind of writing solution. 为了那个原因。我的意思是，这太简单了 ，没有人让你的写作成为那种写作解决方案。
have this kind of problem as a as an algorithm or as a pseudocode as a flowchart. But the 将这种问题作为算法或伪代码 作为流程图。但该
basic idea is, is is is the same, even if you have a complicated problem if even if 基本思想是，是一样的，即使 你有一个复杂的问题，即使
you have a problem with maybe many more steps, the idea is still the same. In the in the 您可能有更多步骤的问题， 但想法仍然相同。在中
next video, we will we will see a procedure how to how to make tea for example, that might 下一个视频，我们将看到一个 程序，例如如何泡茶，这可能
that may look look to you funny, I mean, do we really want do we really want to know the 这在你看来可能很有趣，我的意思是 ，我们真的想要吗，我们真的想知道
procedure to make tea? Well, the idea is not to learn how to make tea, the idea is to learn 泡茶的步骤？嗯，这个想法不 是学习如何泡茶，而是学习
how to express the solution of this problem making tea that's a problem, the solution 如何表达这个问题 的解决方案
of this for how to how to express solution of that problem as as a pseudocode. And we 关于如何将该问题的解决方案 表达为伪代码。和我们
will see one more example of flowchart as well. So hope to see you in the next video. 还将看到另一个流程图示例。所以 希望在下一个视频中见到你。
Okay. In the last video, we saw flowcharts and pseudocode, we just took an example of 好的。在上一个视频中，我们看到了流程 图和伪代码，我们只是举了一个例子
we took a very simple example computing salary or pay of employee of a company given hours 我们举了一个非常简单的例子，计算给 定时间的公司员工的工资或薪酬
and rate. And I also described weatherflow, the the comparison between flowchart and pseudocode. 和率。我还描述了weatherflow， 流程图和伪代码的比较。
And I said that pseudocode is closer to the core of some programming language, which eventually 我说伪代码更接近某些 编程语言的核心，最终
we need, because eventually we need automation of of a solution of a problem. And for that, 我们需要，因为最终我们需要 解决问题的自动化。为此，
we need a code of the digit the code for the solution, the general solution in some programming 我们需要一个数字的代码解决方案 的代码，一些编程中的通用解决方案
language, so flowchart and pseudocode, and then the core of some programming language 语言，所以流程图和伪代码， 然后是一些编程语言的核心
like Python, 像 Python，
it is somehow in sometimes handy to to break the problem or to devise a general solution 解决问题或设计通用解决方案 有时在某种程度上很方便
of any problem for in first step in a flowchart because that is more expressive, and more 流程图中第一步的任何问题，因为 它更具表现力，而且更多
generic, more general, maybe in a graphical way. And then once the proof of concept is 通用的，更通用的，也许以图形 方式。然后一旦概念证明是
clear, once it is clear that this is indeed a general solution, it has no bugs inside 清楚，一旦明确这确实是一个通用 的解决方案，它内部就没有错误
it has no errors, it will work always, then we can take another step to convert that flowchart 它没有错误，它将始终有效，然后我们 可以采取另一个步骤来转换该流程图
to pseudocode. And then pseudocode can be converted to the the code of any the code 到伪代码。然后伪代码可以 转换为任何代码的代码
in some programming language. But writing pseudocode right away, I mean, from the very 在某种编程语言中。但是立即 编写伪代码，我的意思是，从
beginning without flowcharts is also a common practice. Either way, whichever way suits 从没有流程图开始也是一种常见的做法 。无论哪种方式，哪种方式都适合
you. In this particular video, I'm going to talk about problem the problem is making tea. 你。在这个特定的视频中，我 将讨论问题是煮茶的问题。
You might be thinking, what are the different instances of this problem I'm in making tea 您可能会想，我在泡茶时遇到的 这个问题有哪些不同的实例
is making tea. What what kind of different instances are there? Well, one person may 正在泡茶。有哪些不同的 实例？嗯，一个人可能
be liking tea with, for example, 1.5 units of sugar, whatever the units are, and another 例如，喜欢含 1.5 个单位糖的茶 ，无论单位是多少，而另一个
person may want a tea with, let's say, two units of sugar, one person maybe, maybe needing 一个人可能想要一杯茶，比方说，两 个单位的糖，一个人可能，可能需要
a D with, for example, point five units of milk, and another one, maybe a different units 例如，一个 D 点五个单位的牛奶 ，另一个可能是不同的单位
of milk, and so on. So the procedure of making tea should stay same. And the instances which 牛奶等。所以泡茶的程序 应该保持不变。和实例
means the different people want tea in a different kind of combination that may vary. So let's 意味着不同的人想要不同种类的茶，这些 组合可能会有所不同。那么让我们
let's like let's see a procedure first and flowchart. And then in pseudocode, for for 让我们先看一个过程和流程 图。然后在伪代码中，对于
making a tea, for making tea. So let's start that that might look like that might look 泡茶，用来泡茶。所以让我们 开始吧，这可能看起来像
you look to you a kind of funny kind of problem. But that's a genuine problem. For example, 你看着你一种可笑的问题。但这 是一个真正的问题。例如，
if you want to make tea, what is algorithm for this? So first we start and then the first 如果你想泡茶，这个算法是什么？ 所以首先我们开始，然后是第一个
step we do is we put teabag in a cup, that might be a first step. You can argue should 我们所做的步骤是将茶包放入杯子中 ，这可能是第一步。你可以争论应该
this be a first step should that be the second step and so on the sequence of By the way, 这是第一步，应该是第二步， 依此类推，顺便说一句，
solving one problem, you can have multiple algorithms for that. And do different algorithms 解决一个问题，你可以有 多种算法。并做不同的算法
may just vary because of the sequence of statements even if you have the same statements. So I'm 即使您有相同的语句，也可能因语句 的顺序而有所不同。所以我
not talking about that the algorithm or the general solution is unique. You can have multiple 不是说算法或一般解决方案 是唯一的。你可以有多个
different general solutions or procedures. So for example, putting a teabag in a cup 不同的一般解决方案或程序。 例如，在杯子里放一个茶包
that might be first step, or the first step might be the boil, boil the water and pour 这可能是第一步，或者第一步 可能是煮沸，煮沸水并倒入
the water and pour the water in the cup and then put the tea back. Both are fine, I mean 把水倒在杯子里，然后把茶放回去 。两个都很好，我的意思是
this way or that way. So let's start with putting a tea bag in a cup. So that's an that's 这样或那样。所以让我们从在杯子 里放一个茶包开始。所以这是一个
an input. We take the tea bag from somewhere. That's our input last time, I do You that 一个输入。我们从某处拿走茶包。这 是我们上次的意见，我做你那
input is taken as parallelograms put a teabag in a cup and then forget about that cup and 输入被视为平行四边形将茶包放入 杯子中，然后忘记那个杯子，
boil the water somewhere there is a water I mean take the water from somewhere and boil 在某处煮水 有水 我是 说从某处取水并煮沸
it and see if after let's say five or six or seven time units whatever the time units 看看在让我们说五个或六个或七个 时间单位之后，无论时间单位如何
are, see if the water is boiled or not assume that there is a test that tells you that the 是，看看水是否煮沸 假设 有一个测试告诉你
water is boiled or not. So, there is a test available to you. So, you apply that test 水煮沸与否。所以，有一个测试可供 您使用。所以，你应用那个测试
and check that the water is boiled or not if it is not oil then keep on boiling. So 检查水是否煮沸，如果不 是油，则继续煮沸。所以
boil it again. And assume there is a procedure of boiling of water in in in normal case, 再煮一次。并假设在正常情况下 有一个将水煮沸的程序，
boiling water is just happened by I mean keeping the temperature high or putting that thing 沸水只是发生在我的意思是保持 高温或放置那个东西
putting the pot of water on fire or something like so, but that that itself is a procedure. 把一壶水放在火上或类似的东西 ，但这本身就是一个程序。
So, 所以，
while the water again and boil the water again check if the water is boiled if no then boil 当水再次煮沸时再次检查水是否 煮沸如果没有然后煮沸
it again. If not boil again then check if no then boil it again this is called a loop 再说一遍。如果没有再次煮沸，则检查 是否没有然后再次煮沸，这称为循环
this is called a loop or repetition you are doing the same kind of stuff again and again. 这称为循环或重复，你一次 又一次地做同样的事情。
Until there is a particular condition that is that is met. So in this case, the condition 直到满足特定条件为止。 所以在这种情况下，条件
is when while the water is not boil, keep on doing the same procedure again and again. 是在水没有沸腾的情况下 ，继续重复相同的过程。
This is called repetition or loop. So you boil the water again, check the condition 这称为重复或循环。所以 你再次烧开水，检查条件
if the condition is true, for example, the water boil Yes, then come out. Then you're 如果条件为真，例如，水沸腾 了，那么出来。那你就
then you can exit this loop and come out. Then pour the water pour the water in in the 那么你可以退出这个循环并出来 。然后倒入水，将水倒入
cup. Here we should hear we should describe that is that the same cup or a different cup? 杯子。这里我们应该听到我们应该描述 的是，是同一个杯子还是不同的杯子？
Well, this see you pick up here is acting as as a placeholder where this tea bag and 嗯，这个看到你在这里捡起来充当 占位符，在那里这个茶包和
the water is going in. So we have a cup, we put teabag in it, then we put the boil water 水要进去了 所以我们有一个杯子 我们 把茶包放进去 然后我们把开水
in it, but before pouring the boiled water in it. We just boiled the water. Okay, and 在里面，但在倒入开水之前。我们 只是把水烧开。好的，还有
then after we have water in a cup and a tea bag in a cup, what should we do next? We actually 那么当我们在杯子里放了水，在杯子里放了一 个茶包之后，接下来我们应该做什么呢？我们其实
we actually first test one sugar or need more sugar? If yes, then then add sugar. So let's 我们实际上首先测试一种糖还是需要更多 的糖？如果是，然后加糖。那么让我们
apply some arrows. If yes, add them add sugar. And then again ask do you need do you need 应用一些箭头。如果是的话，加他们加糖 。然后再问你需要吗 你需要吗
more sugar? Or one sugar now? Yes, add sugar. One sugar. Yes, add sugar that is again a 加糖？还是现在一颗糖？是的，加糖。 一颗糖。是的，加糖，这又是一个
loop that is again a loop while while the while you want sugar. I mean you test that 循环又是一个循环，而你想要糖 的时候。我的意思是你测试那个
the sugar is okay or not. Here you test that the sugar is okay or not or whatever sugar 糖好不好。在这里你测试 糖是否可以或任何糖
you need. If Is that okay or not? Until that condition is not met, you keep on adding the 你需要。如果可以吗？在不满足 该条件之前，您继续添加
sugar, add a teaspoon again, then test out a teaspoon that is again a loop or repetition. 糖，再次加入一茶匙，然后 测试一茶匙再次循环或重复。
Once the condition is met once you know then exit this loop and ask what milk because some 一旦你知道满足条件，然后退出这个 循环并询问什么牛奶，因为有些
people just take tea without milk. Maybe somebody wants a milk maybe somebody don't. So want 人们只喝茶而不喝牛奶。也许有人想要 牛奶，也许有人不想要。好想要
milk? Yes. So add milk. So that's that's a mistake this this loop should go there. There 牛奶？是的。所以加牛奶。所以这是 一个错误，这个循环应该去那里。那里
right there. And this line shouldn't be there. That's that's wrong. Add milk and then ask 在那里。这条线不应该在那里。 那是错的。加牛奶然后问
what milk? Yes, admin, that's again a loop. Once you exit the loop, then you ask need 什么牛奶？是的，管理员，这又是一个循环 。一旦你退出循环，然后你问需要
to steer. Yes, steer, then ask again. This line again shouldn't be there. So that that's 引导。是的，转向，然后再问。 这条线不应该再出现。所以那是
another loop. Once you exit this loop, then the T is ready, you serve that D finish you're 另一个循环。一旦你退出这个循环，那么 T 就准备好了，你服务那个 D 完成你
done with the procedure. Now let's see the same procedure in pseudocode program is the 完成程序。现在让我们看看 伪代码程序中的相同过程是
keyword and that's what program name is program make D what is a keyword put teabag in a cup 关键字，这就是程序名称的意思 program make D 关键字是什么 将茶包放入杯中
while water not while while is a key word, while this is not while this condition is while water not while while 是关键字，while this is not while this condition is
not satisfied, keep on doing this. Whatever written in while and while is is the body 不满意，继续这样做。无论在 while 和 while is 中写的是身体
of this repetition are called loop. So while water is not boil, boil water. Then again 这种重复被称为循环。所以当水没有 沸腾时，把水烧开。然后又
check water boiler not know what again. I'm in keep on boiling. So this is repetition. 检查热水器不知道是什么了。我 一直在沸腾。所以这是重复。
Once the water is boiled, which means this condition is becomes false what not oil becomes 一旦水煮沸，这意味着这种情况 会变成假的，而不是油变成的
false so water boil, then you exit this loop, you pour that water in cup, that's again a false 所以水沸腾，然后你退出这个循环 ，你把水倒进杯子里，这又是一个
key word, you in a cup, and then you ask, okay, need sugar? Yes, add sugar, need sugar, 关键词，你在杯子里，然后你问，好 吗，需要糖吗？是的，加糖，需要糖，
yes, add sugar. So you keep on doing this until you don't need sugar anymore. So, that's 是的，加糖。所以你继续这样做 ，直到你不再需要糖。所以那是
again a loop. So, so, you might be thinking that why we are writing this add sugar and 又是一个循环。所以，所以，你可能会 想，为什么我们写这篇文章要加糖和
this boil water to writer to this this why we are really indenting this that style of 这个烧水给作者这个，这就是为什么 我们真的要缩进这种风格
pseudocode to just display that this is inside this this is this particular statement or 伪代码只是显示这是在 this 这是这个特定的语句或
set of statements are called the body of the loop and this end Oil should be here in this 一组语句被称为循环体， 这个结束油应该在这里
alignment here in this line and so, there is a there is a bug in this slide this should 在这一行中对齐，因此，这张幻灯片 中有一个错误，这应该
be 是
here okay once this condition is false sugar needed no then you can exit this loop and 这里好，一旦这个条件是假糖，不 需要那么你可以退出这个循环
you go here while milk needed yes add milk, check again milk needed yes add milk milk 你去这里时需要牛奶是加牛奶，再次 检查需要牛奶是加牛奶牛奶
needed yes add milk. Once this condition becomes false milk needed no then you can exit this 需要是加牛奶。一旦这种情况变成不 需要假奶，那么你就可以退出
loop, you can just go to here. While latest here need to steer steer D need to steer yes 循环，你可以去这里。虽然这里 最新的需要转向 D 需要转向是的
sturdy he was there yesterday, once this condition is false get out and your tea is ready Do 坚强 他昨天在那里，一旦这种情况是假的， 就出去，你的茶已经准备好了 做
whatever you want to do. This example was so simple, but it expresses a very powerful 无论你想做什么。这个例子很简单 ，但它表达了一个非常强大的
tool in in the pseudocode as well as in flowcharts. And that tool is sometimes called loop which 工具在伪代码以及流程图中。 这个工具有时被称为循环
is there to repeat a particular procedure whatever procedure you want to repeat again 是否要重复特定程序，无论 您想再次重复什么程序
and again to until there is a particular condition that is met that is loop loop is there. So, 并再次 to 直到满足特定条件， 即存在循环循环。所以，
the The purpose of this slide is was just to just to make you make you convinced and 这张幻灯片的目的只 是为了让你相信和
make you comfortable with the pseudocode and flowchart we will not be talking about flowcharts 让你对伪代码和流程图感到 满意我们不会谈论流程图
any further from here on we will we will be just talking about pseudocode in just one 从这里开始，我们 将只讨论伪代码
or two more videos. And then we will be directly going towards from we will be we will be comfortable 或另外两个视频。然后我们 会直接走向我们会很舒服
enough with pseudocode for solving certain kinds of problems that we will then eventually 伪代码足以解决某些类型 的问题，然后我们最终将
be moving from pseudocode to actual Python code. And and I bet you I'm going to tell 正在从伪代码转向实际的 Python 代码 。而且我敢打赌我会告诉你
you that the pseudocode in the next video I'm going to explain that will be very, very 下一个视频中我将解释 的伪代码将非常非常
easily will be converted to the actual exact Python code. So in the next video, we are 很容易将转换为实际的确切 Python 代码 。所以在下一个视频中，我们
going to actually solve a problem of finding out minimum value from a list of values, sometimes 将实际解决从值列表中 找出最小值的问题，有时
called the searching problem, we're going to solve it by first using pseudocode. And 称为搜索问题，我们将首先 使用伪代码来解决它。和
then in a later video, we will see how to write the actual Python code for that problem. 然后在后面的视频中，我们将看到 如何为该问题编写实际的 Python 代码。
So hope to see you in the next video. Okay, let's dive into real problem. Let's say you're 所以希望在下一个视频中见到你。好的 ，让我们深入研究真正的问题。假设你是
given, you're given a list of numbers, let's say, let's say l is some list. with numbers, 给定，你得到了一个数字列表，假设 ，假设 l 是一些列表。用数字，
let's say we define list by these, these square brackets, let's say the list contains 23. 假设我们通过这些定义列表，这些 方括号，假设列表包含 23。
Let's say that's a value minus four, that value is zero, that's a value 73. That's a 假设这是一个减去 4 的值，该 值为零，即值 73。那是一个
value, and maybe maybe minus 10. That's a value, maybe 13. That's a value. So let's 值，也许是负 10。那是一个值，也许 是 13。那是一个值。那么让我们
just take an example that we have 123456 values in a list. So and that list is basically we 举个例子，我们在一个列表中有 123456 个值 。所以那个列表基本上是我们
took the list here as L and we just describe that let's say the list is declared by or 将这里的列表作为 L 并且我们只是描述 让我们说列表是由或声明的
expressed by the square brackets, and the elements of the list, they are separated by 用方括号表示，列表 的元素之间用
comma. That is just our convention for this kind of problem for this problem just for 逗号。这只是我们对 此类问题的约定
this code. And And I'm not talking about any particular programming language yet. This 这段代码。而且我还没有谈论 任何特定的编程语言。这个
is just a list of numbers. And let's say we want a procedure that finds out the minimum 只是一个数字列表。假设我们 想要一个找出最小值的过程
value of any list. Well, first of all, why this problem has multiple instances. Well, 任何列表的值。嗯，首先，为什么 这个问题有多个实例。好，
we need to come up with a solution that works for any list for example, if the list is if 我们需要想出一个适用于任何列表的 解决方案，例如，如果列表是 if
the list has these six values, then the procedure should find out the minimum In this list, 列表有这六个值，那么程序应该找出 这个列表中的最小值，
the minimum value in this list out of all the values is minus 10. 所有值中此列表中的最小值 为负 10。
Because minus 10 is smaller than every other value. 23 is bigger minus four is smaller 因为负 10 比其他所有值 都小。 23大减四小
than 23. Zero is bigger than minus four, because the, the value with negative sign, it is smaller 比23.零比负四大， 因为负号的值更小
with the value of a positive sign. But if you have two values with negative signs, the 具有正号的值。但是如果 你有两个带负号的值，
value with a bigger number, in terms of magnitude is actually smaller in negative sense. So 数值越大，就量级而言，实际上 在负面意义上越小。所以
if you compare minus four and minus 10 minus 10 is smaller. In minus in minus domain, in 如果比较负四和负 10，负 10 会 更小。在负域中的负中，在
positive domain, the result is different. So I was talking about why this problem has 正域，结果不同。所以我 在谈论为什么这个问题有
multiple instances, why you need a general solution for that, that's less just go and 多个实例，为什么你需要一个 通用的解决方案，那就更少了
find out the minimum that is minus 10. Go home happy? Well, we need a solution that 找出负 10 的最小值。回家快乐吗 ？嗯，我们需要一个解决方案
works for another list. Another list with different numbers. And maybe different number 适用于另一个列表。另一个具有 不同数字的列表。也许不同的数字
of numbers. Maybe in this list, we have six numbers, another list may have 74 numbers, 的数字。也许在这个列表中，我们有六个 数字，另一个列表可能有 74 个数字，
another list may have 1 trillion numbers, we want to come up with a procedure that always 另一个列表可能有 1 万亿个 数字，我们想提出一个程序
finds out the minimum value in that list. Obviously, the minimum value may repeat, I 找出该列表中的最小值。显然 ，最小值可能会重复，我
mean, the minimum value may occur more than once in a list. So what is a minimum value 意味着，最小值在列表中可能出现 不止一次。那么什么是最小值
rather than knowing how many times that occur, what is the minimum value, that's a problem 而不是知道发生了多少次，最 小值是多少，这是一个问题
finding out a minimum value, and we want to find out, we want to come up with a procedure 找出一个最小值，我们想找出 ，我们想提出一个程序
that finds out the minimum value, regardless of the list, whatever the list is, this procedure 找出最小值，无论列表如何 ，无论列表是什么，这个过程
should actually return or end up finding out the minimum value. So, in this particular 应该实际返回或最终找出最小 值。所以，在这个特殊的
case, again, for this particular example, the minimum value is minus 10. And we will 同样，对于这个特定示例 ，最小值为负 10。我们将
take example of this list, and we will see how to code a procedure for that. So but but 以这个列表为例，我们将看到如何 为此编写一个过程。所以但是但是
before starting this procedure, what kind of things we really need to to, to write a 在开始这个程序之前，我们真正 需要做什么样的事情，来写一个
pseudocode. For this kind of problem, we may start by writing that program, like in the 伪代码。对于此类问题，我们可以 从编写该程序开始，例如
previous video, program name as search. And then we take input or input list, then we 以前的视频，节目名称作为搜索。然后 我们获取输入或输入列表，然后我们
take input, the number of values in the list the total number of values, and then we move 取输入，列表中值的数量是 值的总数，然后我们移动
on as as we want to move on. But writing out a procedure in terms of pseudocode, it is 就像我们想要继续一样。但是用 伪代码写出一个过程，它是
always good to to avoid these input statements inside the pseudocode. And always supply whatever 在伪代码中避免这些输入语句总是 好的。并且总是提供任何东西
whatever needed, always supply the instance, from outside and assume that the instance 无论需要什么，始终从外部 提供实例并假设该实例
is supplied and then just work on that instance. Rather than reading the instance. Rather than 提供，然后只在该实例上工作 。而不是阅读实例。而不是
taking the values of instance, a particular instance from inside the code, it is always 从代码内部获取实例的值， 一个特定的实例，它总是
a good practice to, to, to supply the instance from outside, so supply the list from somewhere, 从外部提供实例的好习惯， 因此从某个地方提供列表，
and this n is really the size of the list. In this particular case, let's say if this 这 n 确实是列表的大小。在这 种特殊情况下，让我们说如果
is the list, then that list will be there, supplied from somewhere, but we'll see how 是列表，然后该列表将在那里，从 某个地方提供，但我们将看到如何
to supply that. And this n value here, in this particular case, the N value is six the 供应那个。这里的 n 值，在 这种特殊情况下，N 值是六
total number of values in the list 12345, and six, these are six values. So it is a 列表中值的总数为 12345，六个， 这些是六个值。所以它是一个
good practice to rather than writing program and then this, just write the name of the 好的做法，而不是编写程序然后 这个，只需写下程序的名称
problem you're going to solve in this particular case the name is search minimum from list. 在这种特殊情况下，您将要解决的问题 名称是列表中的搜索最小值。
And then this particular we are talking about this list l with total number of elements 然后这个特殊的我们正在谈论 这个列表 l 与元素总数
as n whatever the values inside the L is we do not know and and this n may take different 作为 n 无论 L 中的值是什么，我们都不 知道，并且这个 n 可能会采用不同的
values, l can be different, this n can be different for different instances. But it 值，l 可以不同，对于不同的实例 ，这个 n 可以不同。但它
is not a good practice to take input from inside here. Then, one more convention is 在这里从内部获取输入不是一个 好习惯。然后，另一个约定是
that, let's say list of two represents the second element in the list. In this particular 也就是说，假设两个列表表示列表 中的第二个元素。在这个特殊的
case, L of two is basically L of two is basically the second element in the list, which is minus 情况下，L of two 基本上是 L of two 基本上 是列表中的第二个元素，即减号
four, L of let's say three is the third element in this list, which is a zero, and so on. 四，假设三的 L 是此列表中的第三 个元素，即零，依此类推。
So let's let's take a convention, that whenever we want to access the elements of the lists, 所以让我们采取一个约定，每当 我们想要访问列表的元素时，
whatever whenever you want to read the elements from the list, we will read the element number 无论何时您想从列表中读取元素 ，我们都会读取元素编号
by giving the element number here let's say whatever the if we write L of AI, that means 通过在这里给出元素编号，让我们 说无论我们写 AI 的 L，这意味着
it means the ayat element of the list. 它表示列表的 ayat 元素。
So, first we take a variable, we are assuming here that the list is supplied to us the total 所以，首先我们取一个变量，我们 在这里假设列表提供给我们的总数
number of elements in the list is supplied to us. So we first take the minimum value, 列表中的元素数量提供给我们 。所以我们首先取最小值，
we, which we really want to compute the minimum value we want to compute, but any list can 我们，我们真的想计算我们想要计算 的最小值，但任何列表都可以
be supplied in this procedure. So what's the procedure, the minimum value that we want 在此过程中提供。那么程序是 什么，我们想要的最小值
to compute, we just consider the very first value of the list in this case, the very first 为了计算，我们只考虑在这种情况 下列表的第一个值，第一个
value is 23, we consider that is the minimum value. Obviously, that is wrong, this is not 值为 23，我们认为这是最小值 。显然，这是错误的，这不是
minimum value, minimum value may be somewhere else, or maybe this one may be somewhere else, 最小值，最小值可能在别处 ，或者这个可能在别处，
but we are not sure that the first value in the list is the minimum value. But let, let's 但我们不确定列表中的第一个 值是最小值。但是，让我们
just hold on for a moment and move on. Let's say the minimum value is this here, this is 稍等片刻，继续前进。假设 最小值是这里，这是
called the assignment assignment. This min value is a placeholder or a variable, and 称为分配作业。这个最小值是一 个占位符或一个变量，并且
I have assigned this value l one to it. Now, from here onwards, the min value will be will 我已将这个值分配给它一个。现在 ，从这里开始，最小值将是
be will be having a value which is 23. In this particular case, okay, so min value is be 的值为 23。在这种特殊情况 下，好的，所以最小值是
this, which is 23. Now, let's declare, let's declare another variable, which is called this, 即 23. 现在，让我们声明，让我们 声明另一个变量，它被称为
counter, we may need this counter. And let's declare this with two, why we are declaring 计数器，我们可能需要这个计数器。让我们 用两个来声明，为什么我们要声明
this with two it will become clear later on. So now we so min Valley right now, for this 这与两个稍后将变得清楚。所以 现在我们现在这么敏谷，为此
particular list, the min value takes the value 23. So and counter takes the value two, these 特定列表，最小值取值 23。 因此，计数器取值 2，这些
are two things for these two variables. Now, we apply a loop while counter is smaller than 这两个变量是两件事。 现在，当计数器小于
n smaller equal to n. Remember the value of n for this particular example is six, and n 小于等于 n。请记住，此特定 示例的 n 值为 6，并且
counter here is two. So because counter has value two, while two is less than or equal 这里的柜台是两个。所以因为计数器 的值为二，而二小于或等于
to six, first check whether this condition is true or false, because if this condition 六、首先检查这个条件是真 还是假，因为如果这个条件
is true, then you will go to the body of the loop, then this whole box will execute. If 为真，那么你将转到循环体， 然后整个框将执行。如果
this condition becomes false, then you will exit the loop and we'll go out. So now counter 此条件变为假，然后您将退出循环 ，我们将退出。所以现在反
is to the so two is smaller or equal to six. true false. That is true. So the condition 是对所以二小于或等于六。真 假。那是真实的。所以条件
is to two is indeed smaller than or equal to six, that is true. So we will go inside 是二确实小于等于六，这 是真的。所以我们要进去
to the box and see what happens. Then what we will do, we will pick and pick a value 到盒子里，看看会发生什么。然后我们 将做什么，我们将选择一个值
from at the index counter. Right now the counter has value to L off counter means pick the 从索引柜台。现在计数器的值 为 L off counter 意味着选择
value, because the counter has value to pick the second value, which is minus four and 值，因为计数器具有选择第二 个值的值，即负四和
pick that value minus four from the list, pick that value and copy that value or assign 从列表中选择该值减去四， 选择该值并复制该值或分配
that value to a variable v. That's a new variable we maybe needed somewhere okay. Previously 将该值转换为变量 v。这是一个我们 可能需要的新变量。之前
the min value which is a variable, it was containing the very first value which is 23. 最小值是一个变量， 它包含第一个值 23。
Now we have picked the second value the counter value is two. So we have picked the second 现在我们选择了第二个值，计数器值 为 2。所以我们选择了第二个
value from the list, which is minus four. Now we compare if the value now which is minus 列表中的值，即减四。现在 我们比较现在的值是否为负
four is that value smaller than our minimum value. So far, the minimum value so far is 四是该值小于我们的最小值。到目前 为止，到目前为止的最小值是
is 23. So minus four is smaller than 23. Yes, the condition is true, if the condition is 是 23。所以负四小于 23。是的 ，条件为真，如果条件是
true, we will go into this block, otherwise we will go into this block. So right now the true，我们会进入这个区块，否则 我们将进入这个区块。所以现在
condition is true. So we will go in this block and minimum value will just be replaced by 条件为真。所以我们将进入这 个块，最小值将被替换为
the new value. And the new value right now is minus four. So because a minus four is 新值。现在的新值是负 四。所以因为负四是
smaller than 23, so we are here in this body, the if condition becomes true, you're in this 小于 23，所以我们在这个身体里， 如果条件成立，你在这个身体里
body, and the minimum value becomes whatever the value is in V and right for this example, 体，最小值变为 V 中的任何值， 并且对于本示例来说是正确的，
the value in V is minus four. Okay? So if if if you go into the if condition, then you're V 中的值是负四。好的？所以如果 如果你进入 if 条件，那么你就是
not going into the else part, either you're going to F part or in the else part one of 不进入 else 部分，要么你要去 F 部分，要么在 else 部分之一
them. Okay, so then we move back Oh, there's a bug here we need to add the counter. We 他们。好的，那么我们往回走哦，这里有一 个错误，我们需要添加计数器。我们
need to increment the counter here after after this. Before this. There is another statement 在此之后需要在此处增加计数器 。在这之前。还有一个说法
increment the counter. increment counter. That's another statement increment counter. 增加计数器。递增计数器。这 是另一个语句增量计数器。
So Now increment the counter after this if part increment the counter, and the counter 所以现在如果部分增加计数器，则 在此之后增加计数器，并且计数器
will become three. Now, we will repeat the procedure and check three is smaller than 会变成三。现在，我们将重复 该过程并检查三是否小于
six, yes, we will go inside, and we will pick now the counter value is three, we will go 六，是的，我们进去，我们现在 选择计数器值是三，我们就去
and pick the third entry. And now the third entry will be in V, the V will now contain 并选择第三个条目。现在第三个 条目将在 V 中，V 现在将包含
zero. Previously it contained minus four now it will contain zero min value is containing 零。以前它包含负四，现在 它将包含零最小值包含
minus four now, so zero is smaller than minus four, no, if zero is smaller than minus four, 现在减四，所以零小于减四 ，不，如果零小于减四，
then do this. But zero is not smaller than minus four, then go to the else part. And 然后这样做。但是零不小于负 四，那就去else部分吧。和
as far as just saying just go on do nothing, I mean don't do anything. So when you're here 至于只是说继续什么都不做，我的意思 是什么都不做。所以当你在这里
don't do anything except if condition increment the counter again. Now, you increment the 除非条件再次增加计数器，否则不 要做任何事情。现在，你增加
counter the counter value will become four and the value add for is 73. First of all counter 计数器值将变为 4 并且 值相加为 73。 首先
check for is smaller equal to six Yes, we will contain the value at index four which 检查是否小于等于 6 是的， 我们将包含索引 4 处的值
is 7373 is smaller than minus four no do nothing and given the counter check the if condition 是 7373 小于负四，什么都不做 ，给计数器检查 if 条件
check the while condition now counter will be five five is smaller or equal to six Yes, 检查 while 条件现在计数器将 是 5 5 小于或等于 6 是的，
pick the fifth entry because country's fifth the fifth entry is minus 10 选择第五个条目因为国家的第五 个条目是负 10
minus 10 is smaller than minus four yes okay. Replace min value with the new value. Now 负 10 小于负 4 是好的。用 新值替换最小值。现在
the min value will contain minus 10 okay because if has executed else will not execute, you 最小值将包含负 10 好吧，因为如果 已经执行 else 将不会执行，你
exit the if condition and then you increment the counter the counter will become six. Now 退出 if 条件，然后增加计数 器，计数器将变为 6。现在
six is smaller equal to six Yes, because six is equal to six hence the condition is true. 六小于等于六 是的，因为 六等于六所以条件为真。
Now, you go and pick the sixth entry which is 13. Check 13 is smaller than minus 10 because 现在，您去选择第六个条目， 即 13。检查 13 小于负 10，因为
min value is containing minus 10. So far, no that is false go to else condition, the min 值包含负 10。到目前为止， 没有错误，转到 else 条件，
two else part just go on to nothing, increment the counter, now the counter will become seven 其他两个部分继续什么都不做，增加 计数器，现在计数器将变为七
and you go back and check the condition seven is smaller equal to six false exit the loop. 然后你回去检查条件七小于 等于六假退出循环。
Okay, exit the loop, go to this condition, go to this statement. Now Now you're out of 好了，退出循环，转到这个条件 ，转到这个语句。现在你没了
the loop and return the min value. And see the min value here is containing the actual 循环并返回最小值。并看到 这里的最小值包含实际
min value which is minus 10. So that's how we search the minimum, this return is also 最小值为负 10。所以这就是我们搜索 最小值的方式，这个返回也是
a keyword. So which means if we if we just if we just if we just use that function, if 一个关键字。所以这意味着如果我们只是如果 我们只是如果我们只是使用那个函数，如果
we if we just use that pseudocode with if we just use that pseudocode for this different 如果我们只是使用该伪代码，如果 我们只是使用该伪代码来表示不同的
kind of lists with with its sizes, whatever the list, this is this was just one example 各种大小的列表，无论列表 是什么，这只是一个例子
if we chain the list, the procedure will work one one bug in in the code was the increment 如果我们链接列表，该过程将 在代码中的一个错误是增量
counter statement was not there, it should be there after the end F and before this end counter 语句不存在，它应该在 结束 F 之后和结束之前存在
while here. So this that was the pseudocode of searching a minimum. In the next video 在这里。所以这就是搜索最小值 的伪代码。在下一个视频中
we are going to use this pseudocode and we will we will see how to rearrange the values 我们将使用这个伪代码，我们 将看到如何重新排列这些值
of a list or sorting the values of lists such that all the values that are smaller they 列表或排序列表的值， 以便所有较小的值
become earlier than the bigger values. And the problem is called sorting. So in the in 变得早于较大的值。这个 问题叫做排序。所以在
the next video we are going to talk about one more problem, very famous problem called 下一个视频我们将讨论另一个 问题，非常有名的问题叫做
the sorting problem. And after that problem, we will be going towards Python. Because after 排序问题。在那个问题之后， 我们将转向 Python。因为经过
that problem, you will be having a fairly good idea how to solve a problem how to write 那个问题，你会有一个很好的 想法如何解决一个问题如何写作
a pseudocode for a problem. And the way we are writing the pseudocode is very close to 问题的伪代码。我们编写 伪代码的方式非常接近
the actual Python code which will become so clear to you. So hope to see you in the next 实际的 Python 代码对您来说将变得 如此清晰。所以希望下次再见
video. Okay, in the last video we talked about we talked about this how to find out minimum 视频。好的，在我们讨论的上一个视频 中，我们讨论了如何找出最小值
value from a list of values. And we came up with an algorithm with name search men from 值列表中的值。我们想出了一个 算法，其中的名字搜索男人来自
list. Here we have just made a little modification that rather than just returning the minimum 列表。这里我们只是做了一点修改 ，而不是仅仅返回最小值
value, we are also returning the position of the minimum value in the list. So for example, 值，我们还返回列表中 最小值的位置。例如，
if the list is 17024, let's say in nine letter that's our list. There are seven numbers in 如果列表是 17024，让我们用九个字母说 这是我们的列表。里面有七个数字
the list, the minimum value is zero. so the value the minimum value itself is zero, but 列表中，最小值为零。所以 最小值本身的值为零，但是
that appears in position three. So when when this procedure will end, the min value will 出现在位置三。所以当这个 过程结束时，最小值将
contain zero and the ID x which is the position at which the value the minimum value was achieved 包含零和 ID x 是达到 最小值的位置
that will contain three So, not only we are not only we are finding out the minimum value, 这将包含三个所以，不仅 我们不仅要找出最小值，
but also we are finding out the position of the minimum value. 但我们也在找出最小值 的位置。
This procedure, our pseudocode actually describes a very simple, very simple concept, you consider 这个程序，我们的伪代码其实描述了一个 很简单，很简单的概念，你考虑一下
the very first value as a minimum value and the very first position as a position of the 第一个值作为最小值 ，第一个位置作为
minimum value, and then traverse the list element by element and, and see if you find 取最小值，然后逐个元素 遍历list，看看有没有找到
any value that is smaller than the minimum value so far, if that is found, then replace 迄今为止小于最小值的任何 值，如果找到，则替换
your minimum value with the new minimum value and update your position number. And then 您的最小值与新的最小值并更新 您的位置编号。进而
keep on moving till the end of the list. So, so that's what, that's the concept behind 继续前进，直到列表的末尾。所以， 就是这样，这就是背后的概念
the behind this algorithm searching minimum from the list. And to traverse the list we 这个算法的背后是从列表中搜索 最小值。并遍历列表我们
use this loop while loop. So next we solve a problem called sorting problem very, very 使用这个循环 while 循环。所以接下来我们 解决一个叫做排序问题的问题，非常非常
famous problem in computer science. So the problem really is let's say we have a list, 计算机科学中的著名问题。所以问题 真的是假设我们有一个列表，
let's say 14035. And seven, let's say and the sorted order the ascending sorted order 比方说 14035。 七，比方 说 排序顺序 升序排序
is the order in which the list is presented so that the minimum value occurs first, then 是列表显示的顺序，以便 最小值首先出现，然后
the second minimum, then the third minimum, and so on. So the sorted order for this particular 第二个最小值，然后是第三个最小值 ，依此类推。所以这个特定的排序顺序
list will be this, so this is the result, this should be the result of this sorting 列表将是这个，所以这是结果 ，这应该是这个排序的结果
procedure. So let's see how can we solve this problem, we named this algorithm as sorted 程序。那么让我们看看我们如何解决这个 问题，我们将这个算法命名为 sorted
list and sorted list contains this L. In this particular case, the L is simply this. And 列表和排序列表包含这个 L。在这 种特殊情况下，L 就是这个。和
this n is the size of the list. In this particular case, the size of the list is six, so six, 这 n 是列表的大小。在这种特殊情况下 ，列表的大小是六，所以六，
and right now l two is empty. So although we have to populate l two, but right now it 现在我两个是空的。所以虽然我们 必须填充 l 两个，但现在它
is empty. And counter again, we initialize the counter with one. And as as long as the 是空的。再次计数器，我们用 1 初始化计数器。而且只要
Conqueror is smaller than six, we keep on we keep on moving inside this, this block, 征服者小于六，我们继续我们 继续在这个，这个块内移动，
that's the that's the body of the loop. So what we do is we pass the list and the size 这就是循环的主体。所以我们 要做的是传递列表和大小
of the list. And we use the previous algorithm to find out the minimum from the list. So 的名单。我们使用前面的算法从 列表中找出最小值。所以
the minimum from the list will be found as zero and its position will be found as three. 列表中的最小值将被发现为 零，其位置将被发现为三。
So min value will contain zero, and Id x will contain three, then what we do, we pick this 所以最小值将包含零，而Id x 将包含三 个，那么我们做什么，我们选择这个
minimum value and insert in L two l two was initially empty. So we insert in L two, we 最小值和插入在 L 两个 l 两个最初 是空的。所以我们插入L 2，我们
insert the minimum value, which is zero so far. And then just in the original list l 插入最小值，到目前为止为零 。然后只是在原始列表中 l
we delete the value at the position index. So for example, the index position is three, 我们删除位置索引处的值 。例如，索引位置是三，
so we delete this particular value. So what we really do is we delete this value, we delete 所以我们删除了这个特定的值。所以 我们真正做的是删除这个值，我们删除
this particular value. And the list now becomes with size 1234 and five, so what we do is 这个特殊的价值。现在列表变成了大小 为 1234 和 5，所以我们要做的是
we decrement the size with with one and then we move on now the country is one again, the 我们用 1 减少大小，然后我们继续 前进，现在国家又是一个，
N value rather than six. Now the N value is five, so one is smaller than five, but the N 值而不是六个。现在 N 值 是 5，所以 1 小于 5，但是
list has no zero now in it because it was deleted, we searched the minimum again, and 列表中现在没有零，因为它被删除 了，我们再次搜索最小值，然后
we insert the minimum in the list. Now the minimum will be one in the new list. And we 我们在列表中插入最小值。现在最 小值将是新列表中的一个。和我们
delete that value from the list. And we decrement the size we keep on moving, eventually the 从列表中删除该值。我们减少我们 继续移动的大小，最终
list l two will be populated like so. And once. And once this value of n becomes negative, 列表 l 两个将像这样填充。还 有一次。一旦这个 n 值变为负数，
which is minus one with we will exit the loop and we will return the sorted list. But see 这是减一，我们将退出循环，我们 将返回排序列表。但是看
how this sorting procedure actually uses the algorithm that we that we defined in in RPB 这个排序过程如何实际使用 我们在 RPB 中定义的算法
previous video. 之前的视频。
I'm not talking about that this kind of sorting algorithm is the most famous sorting algorithm. 我不是说这种排序算法 是最著名的排序算法。
There are efficient algorithms very great kind of algorithms for sorting. But the idea 有高效的算法，非常好的 排序算法。但是这个想法
here is not to actually teach sorting the idea here to actually come up with the pseudocode 这里并不是要真正教排序 这里的想法来实际提出伪代码
for this sorting problem. And also to show you how you can use the pseudocode how you 对于这个排序问题。并且还 向您展示如何使用伪代码
can use existing pseudo cores as as instructions in in other pseudo codes. So that's all about 可以使用现有的伪核作为其他伪代码 中的指令。所以这就是全部
problem solving. If you really understand the selection sort and all that procedure 问题解决。如果你真的了解 选择排序和所有的程序
really well, you're actually very good in problem solving, at least the problem solving 真的很好，你实际上很擅长解决 问题，至少是解决问题的能力
is that we encounter in the logic that we need to solve different kinds of problems 是我们在逻辑中遇到需要 解决不同种类的问题
in computer science. In the next video, I'm going to actually convert these pseudo codes 在计算机科学中。在下一个视频 中，我将实际转换这些伪代码
to Python codes. What do you need? Doo doo doo, right this sortlist procedure in actual 到 Python 代码。你需要什么？ Doo doo doo， 对这个排序列表的程序实际上是正确的
python programming language, and how will you change the search minimum from list in python 编程语言，以及如何 从列表中更改搜索最小值
actual python programming language, we will see the Python details bit by bit in detail, 实际的python编程语言，我们会 一点一点的看Python的细节，
starting from right zero and ending at the very high details of Python. So, in the next 从右零开始，以 Python 的非常高 的细节结束。所以，在接下来的
video, I will just be showing you how to convert this code. But when we will start learning 视频，我将向您展示如何转换此 代码。但是当我们开始学习
Python, we will start from zero and we will see each and everything of, of Python in in Python，我们将从零 开始，我们将在
detail. So don't worry. In the next video, if you see, I mean, things like lengthy chords 细节。所以别担心。在下一个视频中，如果 你看到，我的意思是，像长和弦这样的东西
in a very beginning, these are just because we have arrived at a pseudo code. It is very, 一开始，这些只是因为我们得到 了一个伪代码。这个很，
I'm just want to show you how the pseudo codes which are very across expressible, how they 我只是想向你展示那些非常易于 表达的伪代码，它们是如何
can be easily converted to Python programming, just to show you the power of and simplicity 可以轻松转换为Python编程， 只为向你展示强大和简单
of Python programming language. So in the next video, I'll be converting these pseudo Python 编程语言。所以在下一 个视频中，我将转换这些伪
codes to Python code actual programming code. So hope to see you in the in the next video. 代码到 Python 代码实际编程代码。所以 希望在下一个视频中见到你。
Okay, in the previous video, we just get a flavor of problem solving by using this selection 好的，在上一个视频中，我们 只是通过使用此选择来解决问题
sort called the sorting procedure. The idea was just to use this procedure to solve this 排序称为排序过程。这个想法只 是使用这个程序来解决这个问题
kind of problem. And we saw in detail, not in that detail, we just just brushed up but 种问题。我们看到了细节，而不是那个 细节，我们只是刷了一遍，但是
we saw how to write a pseudocode for solving a problem of sorting, which requires actually 我们看到了如何编写伪代码来 解决排序问题，这实际上需要
a list to be sorting in ascending order. For example, in this video, I'm going to convert 要按升序排序的列表。例如 ，在这个视频中，我要转换
first this code search minimum from list, you see that code, you know that code completely, 首先这个代码从列表中搜索最小值， 你看到那个代码，你完全知道那个代码，
we're first going to convert that code in Python code, and then we will convert this 我们首先要在 Python 代码中转换 该代码，然后我们将转换这个
code in Python code. So see step by step, what changes are there. First of all, in Python Python 代码中的代码。所以一步一 步看，有什么变化。首先，在Python中
that we will see in detail. When you define procedures, different kinds of procedures, 我们将详细了解。当你定义程序 时，不同种类的程序，
they are called functions in Python. And rather than writing this, we have to write a def 它们在 Python 中被称为函数。而不是 写这个，我们必须写一个 def
statement before it and then whatever name we want to write out, the rest of the thing 它之前的语句，然后是我们想要 写出的任何名称，其余的东西
stays the same, except at the very end, we have to write a colon. That's the syntax of 保持不变，除了在最后，我们 必须写一个冒号。这是语法
Python. So the changes from here to here is a def statement, which defines that is used Python。所以从这里到这里的变化 是一个 def 语句，它定义了使用
for defining def for define. And then at the end, we write a colon. Next thing that we 用于定义 def 用于定义。然后在最后，我们 写一个冒号。接下来我们要做的
will see in detail, don't worry if you 会详细看的，不用担心
if you're if you just see that why we're messing up with lips. So early, we will see that things 如果你是，如果你只是看到我们为什么要 搞砸嘴唇。这么早，我们会看到事情
in detail. But just to compare the in pseudocode. Normally the lists are indexed the indexes 详细。但只是为了比较 in 伪代码 。通常列表被索引索引
of the list start from one. But in Python programming language, the first index of the 的列表从一个开始。但是在 Python 编程语言中，第一个索引
list usually starts from zero. So they are the minimum value was the first value of the 列表通常从零开始。所以 他们的最小值是第一个值
list here, the first value is actually the index and Python is zero, rest of the things 在这里列出，第一个值实际上 是索引，Python 为零，其余的
are same, you declare the variable as in pseudocode. The same goes exactly in Python. They're the 是一样的，你用伪代码声明变量。 在 Python 中也是如此。他们是
because the index was one. And so the counter was one more than whatever the index was. 因为索引是一。所以计数器 比索引值多一。
Here, the counter is simply one, we need to right here ID x ID x equals to zero that we 在这里，计数器只是一，我们需要 在这里 ID x ID x 等于零，我们
just missed. In the previous the ID x is one, so here the ID x is zero, that's okay. Okay, 刚刚错过。前面的 ID x 是 1，所以这里 的 ID x 为零，没关系。好的，
then next, we write while counter is less or equal to n. Same thing while counter is 然后接下来，我们在 counter 小于或等于 n 时写入。同样的事情，而计数器是
less or equal to n here. So here we just write the, the colon at the end, we might have written 这里小于或等于 n。所以这里我们只写 了，最后的冒号，我们可能已经写了
this equal sign here, this equal sign, we just missed the equal sign the equal sign 这个等号，这个等号，我们 只是错过了等号等号
is there. So now, but see that see the difference here, the violet goes that way, here we have 在那儿。所以现在，但是看看这里的区别 ，紫罗兰朝那个方向走，我们有
a colon at the end, rest of the things are exactly the same. Now, v is equal to L counter 末尾有一个冒号，其余的完全 一样。现在，v 等于 L 计数器
v is equal to L counter the same thing if v is less than the minimum value, same thing 如果 v 小于最小值，则 v 等于 L 计数器相同的事情，相同的事情
if v is less than the minimum value in the pseudocode. Python is exactly the same. Just 如果 v 小于伪代码中的最小 值。 Python 完全一样。只是
see the colon at the end, we have colon at the end of the while statement, we have colon 看到末尾的冒号，while 语句 的末尾有冒号，我们有冒号
at the end of the definition, we have colon at the end of the if statement. The other 在定义的末尾，我们在 if 语句 的末尾有冒号。另一个
statement in pseudocode. In Python exactly the same. Now, in pseudocode, we have l statement. 伪代码中的语句。在 Python 中完全一样 。现在，在伪代码中，我们有 l 语句。
In Python, we have l statement. If we want to write an else statement, we have write 在 Python 中，我们有 l 语句。如果我们 想写一个 else 语句，我们有写
a colon at the end of that. Then in Python in pseudocode, we have a past statement Python 末尾有一个冒号。然后在 Python 的伪代码 中，我们有一个过去的语句 Python
in our past statement, same things in pseudocode. We have n def, just to describe that this 在我们过去的陈述中，伪代码中的内容相同。 我们有 n 个定义，只是为了描述这个
f ends. In Python, everything is described by the indentation style. So if this indentation f 结束。在 Python 中，一切都由缩进 样式来描述。所以如果这个缩进
goes on, if we have If you're here, then this is goes if this if goes out, so we need not 继续，如果我们有如果你在这里，那么 如果这出去了，那么我们就不需要了
write ends every day. Similarly, the vile body has this indentation style, this is all 每天写完。同样，邪恶的身体 有这种缩进风格，这就是全部
the while body, whatever that is, that is earlier than this is not in the wild body. while 体，不管是什么，比 this 更早的都不是野体。
So, rather than writing the tokens and while and if the Python handles everything using 因此，与其编写令牌和 while 以及 Python 是否使用
indentation, so no need of end if no need of end while Oh, we haven't, right, we haven't 缩进，所以如果不需要 end while 就不 需要 end 哦，我们没有，对，我们没有
written a counter here. So we have to write a counter plus plus here, so counter. So the 在这里写了一个计数器。所以我们要在这里 写一个计数器加加号，所以计数器。所以
same statement, we missed this statement in the Python code. So the same statement, exactly 同样的语句，我们在 Python 代码中遗漏 了这个语句。所以同样的陈述，正是
the same statement goes here. That's it. The rest of the story is same, we do not need 这里也有同样的说法。就是这样。剩下 的故事是一样的，我们不需要
an end search here. The goal here is to show that the pseudocode is, I mean, the way you 在这里结束搜索。这里的目标是表明 伪代码是，我的意思是，你的方式
write the pseudo codes, they are they're highly, 编写伪代码，它们是高度的，
they highly resemble with the actual code in Python, Python is that expressive Python 它们与 Python 中的实际代码非常相似 ，Python 是富有表现力的 Python
is very, very high level language. I mean, the way the you the way you think the problem 是非常非常高级的语言。我的意思 是，你的方式你思考问题的方式
in the pseudocode, the actual Python code is much similar to it. So learning the Python 在伪代码中，实际的 Python 代码 与它非常相似。所以学习Python
is very, very simple. The simplicity of Python is really a great property of Python. And 非常非常简单。 Python 的简单性确实 是 Python 的一大优点。和
that's one big reason of popularity of, of Python. Now the return statement is same and 这是 Python 流行的一大原因 。现在返回语句是相同的
everything is same, then we move toward the sorting. Again, we have sortlist, we have 一切都一样，然后我们走向排序。 再次，我们有排序列表，我们有
to write the Define def define, and then we have this colon out there, we have to write 写Define def定义，然后我们 有这个冒号，我们必须写
the colon there, then let's do is defined like empty, it's empty in Python as well. 那里的冒号, then let's do 被定义为 空，它在 Python 中也是空的。
Counter starts from zero, because they are the list starts from index one. In Python, 计数器从 0 开始，因为它们是从索引 1 开始的列表。在 Python 中，
the list starts from zero, so we are at zero, while same as this one. Here we have this 列表从零开始，所以我们在零，而与 这个相同。在这里我们有这个
colon, maybe, maybe an equal sign, maybe an equal sign should appear here. I guess we 冒号，也许，也许是等号，也许等 号应该出现在这里。我猜我们
are missing an equal sign. But either way, the code is more or less the same rest this 缺少等号。但无论哪种方式 ，代码或多或少是相同的
statement exactly same as this statement, we have insert in L two, here, we write a 语句和这个语句完全一样，我们在L 中插入了两个，这里，我们写一个
band append function, I'm in Python, here with ID lead this in Python, we have a Dell 带附加功能，我用的是 Python，这里用 ID 用 Python 来引导这个，我们有一个戴尔
statement, rest of the story is exactly same. So you see converting pseudocode to Python 声明，其余的故事完全相同。所以 你看到将伪代码转换为 Python
code is, is way more easier. This is this is not a this is not a formal introduction 代码是，更容易。这 不是这不是正式介绍
to Python. I mean, the the goal here in this video in these kind of session videos is just 到 Python。我的意思是，在这些会话 视频中，此视频的目标只是
to introduce you with problem solving. But I I found this, I mean, I found this beneficial 向您介绍解决问题的方法。但我发现 了这个，我的意思是，我发现这很有用
to show you that the pseudocode actually resembles to the actual Python code a lot, although 向您展示伪代码实际上与实际的 Python 代码非常相似，尽管
we will be dealing with variables lists, while loops, if conditions, all these kind of stuff 我们将处理变量列表，while 循环，if 条件，所有这些类型的东西
in them in a in a big and huge detail. When we in the upcoming videos, when we will introduce 在他们的一个大而巨大的细节。当我们 在即将发布的视频中，当我们将介绍
the Python syntax and variables and all that kind of stuff. Actually, you will be mastering Python 语法和变量等等 。事实上，你会掌握
each and everything in Python. And, and further, you may not write these lengthy chords to Python 中的一切。而且，更进一步，你 不能把这些冗长的和弦写下来
do stuff in Python, I mean, the whole dad thing is just you write l dot sort and you're 用 Python 做东西，我的意思是，整个 爸爸的事情就是你写 l 点排序，你是
done. I mean, you need not write a lot of lines of codes in Python. Here, I just here 完毕。我的意思是，你不需要用 Python 编写 很多行代码。在这里，我就在这里
I just showed you that if you have a procedure, you can, if you have a pseudocode it looks 我只是告诉你，如果你有一个程序，你可以 ，如果你有一个伪代码，它看起来
like much like the same as Python, which, which actually tells you the expressive power 就像Python一样，它实际上 告诉你表达能力
of Python and simplicity of Python, and how it is closer to what you think. But the actual Python 和 Python 的简单性，以及它 如何更接近您的想法。但实际
problem solving 解决问题
in Python does not require so many lines of codes, I mean, there are so many functions, 在Python中不需要那么多行代码， 我的意思是，有那么多功能，
so many powerful procedures. For those you just write one line and a huge amount of work 这么多强大的程序。对于那些 你只写一行和大量工作的人
is done for you. And there are very good one liners for Python I mean in for for for for 已为您完成。并且有非常好的 Python 衬垫，我的意思是 for for for
programming in Python, you did not write a lot of lines of code to do some stuff. I mean 用 Python 编程，你没有写很多代码 来做一些事情。我的意思是
a few lines of code even a single line of code does a lot for you. And for that you 几行代码甚至一行代码都可以 为您做很多事情。为此你
need to know the features of Python the feature of the features and the different kinds of 需要知道 Python 的特性 特性 的特性和不同种类的
syntax and features and libraries and the packages and what what is available with Python. 语法、特性、库、包以及 Python 的可用功能。
I tell you almost each and everything is available just you need to know what is available. Once 我告诉你几乎每样东西都是可用的，只是 你需要知道什么是可用的。一次
you know the what what what what are the things that are available. You need not to write 你知道什么什么什么是可用 的东西。你不需要写
lengthy codes you need now to build a lot of logic on yourself. Things are prepared, 您现在需要冗长的代码来为自己 构建大量逻辑。东西准备好了，
they're waiting for you, you just have to figure them out what are these things to do 他们在等你，你只需要 弄清楚他们要做什么
what what kind of features are there in Python, if you know that you are done. So you need 如果你知道你已经完成了，那么 Python 中有什么样的特性。所以你需要
not to be writing these kinds of codes and lengthy kind of codes. Although knowing that 不要编写这些类型的代码 和冗长的代码。虽然知道
all knowing that is a is a is a huge advantage, but doing a bigger and bigger and bigger stuff. 都知道是一个是一个是一个巨大的 优势，但做一个越来越大的东西。
Python will give you a lot of features a lot of functionality that you need not to go into, Python 会给你很多特性很多 你不需要用到的功能，
and you need not write a lot of code for it. And that's the second power of Python. One 并且您无需为它编写大量代码。这 就是 Python 的第二个力量。一
is simplicity. Second, it gives you a lot of features a lot of functionality, a lot 是简单。其次，它给了你 很多特性很多功能，很多
of built in stuff ready for you, you want to do something, it will be probably there 为你准备好的内置东西，你 想做某事，它可能就在那里
in Python, you need to know where it is. And for that we have whole future series on Python 在 Python 中，你需要知道它在哪里。为 此，我们有关于 Python 的整个未来系列
to know Python each and every step in Python, and to know important packages in Python. 了解 Python 中的每一步，并了解 Python 中的重要包。
Because knowing important packages and knowing how to code in Python will save a lot of time 因为知道重要的包和知道如何 用 Python 编码会节省很多时间
for you. So spending some time on learning Python will be saving a lot of your time. 为你。因此，花一些时间学习 Python 将节省您的大量时间。
To solve the actual pure problem. Whatever problems you're doing, you're going to solve. 解决实际的纯问题。无论你在 做什么问题，你都会去解决。
And Python is a real programming language granting programming language, knowing this Python 是一种真正的编程语言 授予编程语言，知道这一点
language is almost enough. So hope to see you in in the next videos where we will start 语言差不多就够了。所以希望在 我们将开始的下一个视频中见到你
Python from exactly zero. And we will see each and everything of Python in detail. Hope Python 从零开始。我们将详细 了解 Python 的所有内容。希望
to see you in the next video. If you're new to data science, you may stuck in choosing 下个视频见。如果您是数据科学 的新手，您可能会坚持选择
the best language for data science. And in this video, I'm going to I'm going to talk 数据科学的最佳语言。在这个 视频中，我要去我要说话
about Python, which is the greatest language so far for data science. To explain the features 关于 Python，它是迄今为止最伟大 的数据科学语言。解释特征
of Python, let me first go back to a little bit history of Python from where it started. 关于 Python，让我首先回顾一下 Python 从 它开始的地方开始的一点点历史。
It basically starts in 1980s. It was introduced first in 1980s. But with constant improvements 它基本上始于1980年代。它于 1980 年代 首次推出。但随着不断的改进
and a lot of bug fixes. It was officially launched in 1989. Nine years later. It was 和很多错误修复。它于 1989 年 正式推出。九年后。它是
created by Guido van Rossum and it is open source which means it is accessible to everyone. 由 Guido van Rossum 创建，它是开源 的，这意味着每个人都可以访问它。
Even though it's open source. It can be used for commercial purpose. The main goal of Python 尽管它是开源的。它可以用于 商业目的。 Python的主要目标
was to keep the code easier to use and understand. Its huge library enables data scientists to 是为了让代码更易于使用和理解。其庞大 的图书馆使数据科学家能够
work faster with the ready to use tools it is dynamically typed. So the variables that 使用动态输入的现成工具可以 更快地工作。所以变量
you are defined that you are defining that they are defined automatically, you need not 你被定义你正在定义它们 是自动定义的，你不需要
to set the type whatever the contents in bring in, the type will be defined automatically. 设置类型无论引入什么内容 ，类型都会被自动定义。
It is more readable and uses lesser code to perform the same task as compared to other 与其他代码相比，它更具可读性并且 使用更少的代码来执行相同的任务
programming languages. It is flexible, portable, and can run on any platform easily. It is 编程语言。它灵活、便携，可以轻松 地在任何平台上运行。这是
scalable, and can be integrated with other third party software easy. Python programming 可扩展，并且可以轻松地与其他 第三方软件集成。 Python编程
is easy to use, and has a simple and fast learning curve. new data scientist can easily 易于使用，并且具有简单快速的学习 曲线。新的数据科学家可以很容易地
understand Python, but it's easy to use syntax and better readability. So so that's what 了解 Python，但它易于使用语法和更 好的可读性。所以就是这样
this point is basically it's it's really a beginner friendly if you if you're new to 这一点基本上是如果你是新手， 它真的是一个初学者友好的
programming. Well, Python offers you a very easy environment to go on. It also provides 编程。好吧，Python 为您提供了一 个非常简单的环境。它还提供
plenty of data processing tools that help in better handling the data. Python is important 大量的数据处理工具，有助于 更好地处理数据。 Python很重要
for data scientists, because it provides a vast variety of applications used in data 对于数据科学家来说，因为它提供 了大量用于数据的应用程序
science, it also provides more flexibility in the field of machine learning and deep 科学，它还在机器学习和深度学习 领域提供了更大的灵活性
learning. 学习。
It has, it has a lot of packages like TensorFlow, Kara's tiano. That is helping data scientists 它有，它有很多包，比如 TensorFlow，Kara 的 tiano。这有助于数据科学家
to develop specifically the trending deep learning algorithms very, very quickly. So 非常非常快速地专门开发流行 的深度学习算法。所以
basically, the sport, the sport of machine learning and deep learning is huge in Python. 基本上，这项运动，机器学习和深度 学习的运动在 Python 中是巨大的。
That's huge. As, as is the case with many other programming languages? It's available 那是巨大的。就像许多其他 编程语言一样？可用
libraries that lead to Python success around around 72,000 available packages. In Python 导致 Python 成功的库大约有 72,000 个可用包。在 Python 中
package index, sometimes called by pi, Python. Why? Python package index by by around 72,000 包索引，有时由 pi、Python 调用。为什么 ？ Python 包索引增加了大约 72,000
packages are available and they are good Constantly. So huge number of packages mature packages 包可用，而且它们一直很好。如此 庞大数量的包成熟包
are available. It is free open source and consequently, any Can anyone can write a library 可用。它是免费开源的， 因此，任何人都可以编写库
package to extend its functionality. Data Science has become an early beneficiary of 包以扩展其功能。数据 科学已成为早期受益者
these particularly ponders The Big Daddy of all of them. The other great thing about Python 这些人特别考虑了他们所有人 的大爸爸。 Python 的另一个优点
is there are millions of users who are happy to offer advice or suggestions. When you get 是否有数百万用户乐于提供 意见或建议。当你拿到时
stuck in something, chances are someone else has been stuck there first. So a lot of community 卡在某处，很可能是其他人 先卡在了那里。所以很多社区
is there, a lot of packages are there, it's open source it it's easy to use, it's easy 在那里，有很多包，它是开源 的，它很容易使用，很容易
to learn. It's simple, it's readable, more close to human language, it's high level language, 学习。它简单，可读，更 接近人类语言，是高级语言，
you code less you do more, I mean, you write a very few lines of codes, and you achieve 你代码少你做更多，我的意思是， 你写了几行代码，你就实现了
a lot of work. So, I mean, I've spoken a lot of verbs here, too, too. I mean, explain that 很多工作。所以，我的意思是，我也在这里 讲了很多动词。我的意思是，解释一下
Python really is best suited language for data science. But let me let me introduce Python 确实是最适合数据科学的 语言。但是让我来介绍一下
you some statistics about Python, the popularity of Python with respect to big with respect 你对Python的一些统计，Python 的流行就大就
to its use, and with respect to the job opportunities that are there in Python. So for example, 关于它的使用，以及关于 Python 中 的工作机会。例如，
if you see this chart, in the ranking of top 10, languages, Python stays at the top. So 如果你看到这张图表，在前 10 名语言的 排名中，Python 仍然位居榜首。所以
that's the latest statistic, collected in 2019, February 2019. And out of the out of 这是最新的统计数据，收集于 2019 年，2019 年 2 月。
the total share of the languages, I mean, around 26%, just goes for Python, and the 语言的总份额，我的意思是， 大约 26%，只用于 Python，而
trend is moving up, which means the people are more interested in Python, I mean, the 趋势正在上升，这意味着人们对 Python 更感兴趣，我的意思是，
trend of using Python is getting larger and larger, as compared to several other languages 与其他几种语言相比，使用 Python 的趋势​​越来越大
like Java, JavaScript, C, sharp, bhB, C, our objective c, swift and MATLAB. I mean, many 像 Java、JavaScript、C、sharp、bhB、C、我们的目标 c、swift 和 MATLAB。我的意思是，很多
of them are used for data science, but Python stays at the top. I mean, this is that popular 其中一些用于数据科学，但 Python 仍然 位居榜首。我的意思是，这很受欢迎
language. And further, if you see, for example, the job opportunities in Python so so that 语。此外，如果你看到，例如 ，Python 的工作机会，那么
says, I'm in a different companies like Facebook, Julia, and I'm in Google and several different 说，我在 Facebook、Julia 等不同的公司工作 ，我在 Google 和几个不同的公司工作
companies. This actually graph shows from 2014 onwards, that the job opportunities and 公司。这张实际图表显示， 从 2014 年起，就业机会和
job postings are in different languages are at what amount, and you can see the graph 不同语言的职位发布数量是 多少，你可以看到图表
of Python, although starting a bit low, but then stays up and stays up, which means the Python的，虽然起步有点低，但是 后来熬夜熬夜，也就是说
80 if you see the numbers 85% of the total jobs, there are just for Python. And not only, 80 如果您看到占总作业数 85% 的数字 ，则仅适用于 Python。而且不仅如此，
I mean, Python is not just for data science, it's a general purpose programming language, 我的意思是，Python 不仅用于数据科学 ，它还是一种通用编程语言，
it's open source, it can be it can be used to perform any kind of task for embedded programming 它是开源的，可用于执行 嵌入式编程的任何类型的任务
for, uh, for for posting, I mean, codes or embedding code on Raspberry Pi for web development 用于，呃，用于发布，我的意思是，在 Raspberry Pi 上编写代码或嵌入代码以进行 Web 开发
and whatnot. You can you can, you can do the desktop development on it, you can use the 什么的。你可以你可以，你可以在 上面做桌面开发，你可以使用
web developer knowledge you can use the data science, I mean, I mean, this is general purpose 您可以使用数据科学的 Web 开发人员知识 ，我的意思是，我的意思是，这是通用的
programming language. In other disciplines do it is performing very well. But data science 编程语言。在其他学科做它 的表现非常好。但数据科学
for data science, it is almost the default language today. 对于数据科学，它几乎是当今的 默认语言。
So, I mean, if you're going to learn data science, really, we need Python. I mean, Python 所以，我的意思是，如果你要学习数据科学 ，真的，我们需要 Python。我的意思是，Python
really is the choice, the default choice, and we need it. And in this particular course, 真的是选择，默认选择，我们 需要它。在这个特殊的课程中，
we are going to, we are going to introduce Python to you with all aspects, I mean, we 我们将要，我们将从各个方面向您 介绍 Python，我的意思是，我们
will start from the very beginning level. And we will gradually move towards the very 将从最开始的级别开始 。我们将逐步走向最
advanced programming in Python, including the introduction to the data science packages, Python 中的高级编程，包括 对数据科学包的介绍，
like pandas and matplotlib, for visualizations, and NumPy, for handling numeric data and stuff 像 pandas 和 matplotlib，用于可视化，以及 NumPy，用于处理数字数据和其他东西
like so. So, in this particular course, we are really going to teach you Python, and 像这样。所以，在这个特定的课程 中，我们真的要教你 Python，而且
we are not assuming you have any programming experience before. So and this is one plus 我们不假设您之前有任何编程 经验。所以这是一个加分项
of Python. I mean, whether you're an engineer, you're coming from health sciences, you're 的蟒蛇。我的意思是，无论你是工程师 ，你来自健康科学，你是
coming from biology, you're coming from arts, humanities, or from wherever. Python is something 来自生物学，你来自艺术、人文 或任何地方。 Python是什么东西
that is very easy to get hands on. So if you're not assuming that you have any programming 这很容易上手。所以如果你 不假设你有任何编程
background, you have any data science background nothing. So we will start from the zero and 背景，你没有任何数据科学背景 。所以我们将从零开始
And we will gradually move to 200. So, and including the introduction to the data science 我们将逐渐移动到 200。所以 ，包括对数据科学的介绍
packages. So Python is the best, it is a default. If you're going to work in data science, Python 包。所以Python是最好的，它是默认的。 如果你打算从事数据科学工作，Python
is the default. And we are going to, we're going to introduce you Python from the very 是默认值。我们将 要向您介绍 Python
beginning to the very professional. So hope to see you in this course. Okay, before actually 开始就很专业。所以希望在这门 课程中见到你。好吧，实际上之前
discussing the best ID for Python, and particularly for data science, let's first discuss what 讨论 Python 的最佳 ID，尤其是数据科学的 最佳 ID，让我们首先讨论什么
an ID he is, as you start your coding journey, many of you prefer coding in a text editor 他是一个 ID，当你开始你的编码之旅时，你们 中的许多人更喜欢在文本编辑器中编码
maybe like notepad plus plus, where you write the code and then open a terminal window to 也许像记事本 plus plus，你在那里写 代码，然后打开一个终端窗口
execute your code. When there is an error detected in your code, you switch back to 执行你的代码。当您的代码 中检测到错误时，您切换回
the text editor, correct your errors, typos and run the code again in the terminal, everything 文本编辑器，更正你的错误，错别字 并在终端中再次运行代码，一切
is fine. Typically, for large scale problems, however, you not only have to code but you 很好。然而，通常，对于大规模 问题，您不仅要编码，还要
also need to make sure your code works in all scenarios, which means you also need a 还需要确保您的代码适用于所有 场景，这意味着您还需要一个
testing module. Many times you have multiple coding and testing files, and switching between 测试模块。很多时候你有多个编码 和测试文件，并在之间切换
editor and terminal often becomes both confusing and efficient. So, an environment is needed, 编辑器和终端经常变得既混乱又 高效。所以需要一个环境，
where you can write you can run and play with your code all at one place. So the one that 在您可以编写的地方，您可以在一处 运行和使用您的代码。所以那个
provides you with the capability of not just coding, not just writing the code, but but 为您提供的不仅仅是编码的能力 ，不仅仅是编写代码，而是
also testing your code, running your code highlighting your syntax, bracket matching, 还测试您的代码，运行您的代码 突出显示您的语法，括号匹配，
auto completion, debugging your code, code suggestions, and and many more features. That 自动完成、调试代码、代码 建议以及更多功能。那
is called an ID II or integrated development environment. Now, there are several ID is 称为 ID II 或集成开发环境 。现在，有几个ID是
for different languages for for Python, there are several ideas for example, Jupyter Notebook 对于不同的 Python 语言，有几 个想法，例如 Jupyter Notebook
is an ID IE by charm is an ID IE spider is an IP ID and thought cannot be whim atom and 是魅力的 ID IE 是 ID IE 蜘蛛是 IP ID 和思想不能是心血来潮的原子和
there are a lot more there are several of them. Now the question is for data science, 还有很多，其中有几个。现在 的问题是关于数据科学，
in particular, what Id E is is the best or are what people suggest to be the best. So 特别是，Id E 是最好的，或者是 人们认为最好的。所以
before actually showing you the statistics that which one is the best before actually 在实际向您展示哪个是 最好的统计数据之前
showing you the actual numbers, the statistical numbers that shows which one is better, what 向您展示实际数字，显示哪个 更好的统计数字，什么
are the other let me just go through a few of them few of it ease and their features 其他的让我来看看其中的 一些简单和它们的功能
and stuff. And then we will move to move to statistics and some numbers that will show 和东西。然后我们将转向统计 数据和一些将显示的数字
that which one is better over the other. So let me start with with this Jupyter Notebook. 哪个优于另一个。所以让我 从这个 Jupyter Notebook 开始。
For the past couple of years Jupyter Notebook has been gaining a lot of popularity in terms 在过去的几年里，Jupyter Notebook 在以下方面越来越受欢迎
of coding and debugging. notebooks have been redefining the concepts of an ID E and are 编码和调试。 notebooks 重新 定义了 ID E 的概念，并且
adding more and more features on to it. Jupiter was introduced in 2014 after its predecessor 在其上添加越来越多的功能。木星 是在其前身之后于 2014 年推出的
ipython and from that date, it is really considered to be a bless in the coding community. ipython 从那时起，它真的被认为 是编码社区的福音。
Jupiter stands for I'm in some people say Jupiter stand for Giulia Python r but that 木星代表我在有些人说木星 代表 Giulia Python r 但那
I come in that acronym does not mean just this. I mean Jupyter Notebook today is supporting 我进来的首字母缩略词不仅仅意味着 这个。我的意思是 Jupyter Notebook 今天支持
more than Giulia, Python and R and by the way, this Giulia Python, R and R all these 不仅仅是 Giulia、Python 和 R 顺便说一句 ，这个 Giulia Python、R 和 R 所有这些
are open source languages for and they are best suited for data science. This Jupyter 是开源语言，它们最适合 数据科学。这个 Jupyter
Notebook, it has markdown editor. It allows you to write HTML code, it allows you to write 笔记本，它有降价编辑器。它允许 您编写 HTML 代码，它允许您编写
latex in it. I'm in a lot more. Further this Jupyter Notebook. It's a web application based 里面的乳胶。我还有很多。进一步这个 Jupyter Notebook。它是一个基于 Web 的应用程序
server client structure, which is easy to use and allows you to create, analyze, and 服务器客户端结构，易于使用 ，允许您创建、分析和
manipulate documents. And all these documents are in the form of notebooks. Since it's a 操纵文件。所有这些文件都是笔记本 的形式。由于它是一个
web web interface, it can integrate with many of the existing web libraries. For example, web web 界面，它可以与许多现有 的 web 库集成。例如，
for data visualization. Jupiter has so many functionalities you can write formula using 用于数据可视化。 Jupiter 有很多 功能，你可以用它来编写公式
labtech run a Python code and visualization. For example, a raw audio signal using matplotlib labtech 运行 Python 代码和可视化。例如 ，使用 matplotlib 的原始音频信号
plotting library, all in the same notebook. Jupyter Notebook is not just an idea he but 绘图库，都在同一个笔记本中。 Jupyter Notebook 不仅仅是他的一个想法，而是
it's widely used and an educational tool for presentation and even for writing blogs. You 它被广泛使用，是一种用于演示甚至 用于编写博客的教育工具。你
can export your notebook from iPython Notebook formats to PDF or to HTML or even to.py, which 可以将您的笔记本从 iPython Notebook 格式 导出为 PDF 或 HTML 甚至 to.py，
is the Python file. The user interface of Jupiter makes it a favorite tool, especially 是 Python 文件。 Jupiter 的用户界面 使其成为最受欢迎的工具，尤其是
amongst the data science community. And one plus of this Jupiter is, it's it's very quick 在数据科学界中。这个木星 的一个优点是，它非常快
to start, I mean, very easy and very quick to start, I mean, not much rocket science 开始，我的意思是，非常容易且非常快速地 开始，我的意思是，没有太多的火箭科学
to write your first goal, you want to write your HelloWorld it's very, very quick. And 写你的第一个目标，你想写你 的HelloWorld它非常非常快。和
you're better to go and do that. By charm, if I discuss pi charm, however, if I discuss 你最好去这样做。通过魅力，如果我 讨论圆周率魅力，但是，如果我讨论
some of its properties, and let me just discuss, first that the pipe the PI charm is by the 它的一些属性，让我来讨论一下， 首先，PI 魅力所在的管道是
company JetBrains. And if you have never used japin JetBrains other IDs like Java ID, then JetBrains 公司。如果您从未使用过 japin JetBrains 其他 ID，例如 Java ID，那么
running your first code successfully can eat up a little bit of your time, actually, a 成功运行你的第一个代码可能会 占用你一点时间，实际上，
large amount of your time maybe such as I mean, setting an interpreter by charm. By 你的大量时间可能就像我的意思 ，通过魅力设置翻译。经过
charm, however, is, is much better for, for working with multiple scripts, handling multiple 然而，魅力在于，对于 处理多个脚本，处理多个
files and linking them together and huge large scale coding products. The good thing about 文件并将它们链接在一起以及巨大 的大规模编码产品。好的方面
Python is it supports Anaconda. And as a result, all the packages that fall under Anaconda Python 是否支持 Anaconda。结果， 属于 Anaconda 的所有软件包
are supported by char pi charm as well. And those packages in including NumPy, Sai, pi char pi 魅力也支持。以及包括 NumPy、Sai、pi 在内的那些包
matplotlib, and so on. Just like other IDE ease pi charm has a powerful debugger. With matplotlib 等。就像其他IDE一样，ease pi魅力有一个强大的调试器。和
a graphical interface. It offers jet integration, it has skills, shell terminal and worryin 图形界面。提供jet集成，有技巧 ，有shell终端，有烦恼
control system. Python, it is customizable, which allows you to choose between different 控制系统。 Python，它是可定制 的，它允许您在不同的
themes, color schemes, and key binding and whatnot. Additionally, Python lets you add 主题、配色方案和键绑定等等 。此外，Python 允许您添加
plugins for non pythonic files. And these plugins take care of indentation highlighting 非pythonic文件的插件。这些 插件负责缩进突出显示
the errors and keywords just on the fly. So Python is also providing I mean, a huge support 即时错误和关键字。所以 Python 也提供了我的意思是巨大的支持
for coding Python. But, I mean, the one bad thing about Python, which is not that bad, 用于编码 Python。但是，我的意思是，Python 的一件坏事，也没有那么糟，
but one bad thing is it is memory intensive. It eats up a lot of memory. It's a heavy thing. 但一件坏事是它是内存密集型的。它占用 了大量内存。这是一件很沉重的事情。
And secondly, I mean getting getting getting started with PI charm is not that quick. I 其次，我的意思是开始使用 PI 魅力并不是那么快。一世
mean, it takes a lot of time to just go with that. Spider however, is a lightweight, open 意味着，要花很多时间才能做到这一点。 然而，Spider 是一个轻量级的、开放的
source ID Oh by the way, this by but this by charm is is is not I mean it has Professional source ID 哦，顺便说一句，this by 但 this by 魅力是不是我的意思是它有专业
Edition and and Community Edition and it does not open source completely. Spider however, 版和社区版，它没有完全 开源。然而蜘蛛，
is a lightweight open source, ie that comes pre installed with Anaconda. And it was built 是一个轻量级的开源，即预装 了 Anaconda。它是建造的
mainly for data science practitioners and engineers. Its look and feel is much like 主要面向数据科学从业者和工程师 。它的外观和感觉很像
MATLAB. So if you're a MATLAB programmer, if you've used MATLAB before, you switch to MATLAB。所以如果你是一个 MATLAB 程序员 ，如果你以前用过 MATLAB，你就切换到
Spyder and you get a mean much look and feel the same cannot be by the way the unthought Spyder 和你得到的外观和感觉 一样不能顺便说一下
cannot be also has roughly the same look and feel as MATLAB 不能与 MATLAB 具有大致相同的外观 和感觉
So, but spider was built for data science community, it is integrated with essential 所以，Spider 是为数据科学社区 构建的，它集成了基本的
data centric libraries like NumPy, Sai, pi, matplotlib, pandas, ipython, and whatnot. 以数据为中心的库，如 NumPy、Sai、pi、matplotlib、pandas、ipython 等等。
The built in capabilities can be extended further by plugins and API's Spyder contains 内置功能可以通过插件进一步 扩展，API 的 Spyder 包含
features like text editor with syntax highlighting code completion, static code analysis, debugging 具有语法高亮代码完成功能的文本编辑器 、静态代码分析、调试等功能
variable exploring, it also has profiler that recursively determines the runtime and number 变量探索，它还具有递归确定 运行时间和数量的分析器
of calls for every function and methods call in a file. And I mean, there's no thought 文件中每个函数和方法调用的调用 次数。我的意思是，没有想法
cannot be there is a vendor's atom there are a whole lot of it is just for Python language. 不可能有供应商的原子，有 很多只是用于 Python 语言。
But But the question really is being a data scientist, which one is which one should you 但问题真的是成为一名数据 科学家，你应该选择哪一个
choose being a beginner? which one should you choose? Even even for professionals, if 选择成为初学者？你应该选择哪 一个？即使是专业人士，如果
you want to stay in data science, which ID he will you prefer over the other? I mean, 你想留在数据科学领域，你会更 喜欢他的哪个 ID？我的意思是，
there are so many of them. I have just described three or four of them. So let's see some stats 有这么多。我刚刚描述了其中的三四 个。所以让我们看看一些统计数据
based on popularity of different IDs for data science, and then decide which one is better 根据数据科学不同ID的流行度 ，然后决定哪个更好
over the other. So for example, this data this this analysis, that the chart I'm showing 在另一个之上。例如，这个 数据这个分析，我展示的图表
here, this analysis by was was done by Katie nuggets and The link for that and it shows 在这里，这个分析是由凯蒂掘金 和链接完成的，它显示
that the most popular Python editors till December 2018 and you can see that the Jupiter 直到 2018 年 12 月最受欢迎的 Python 编辑器，你可以看到 Jupiter
is at the top, the second is pi charm, then spider then Visual Studio code and sublime 在顶部，第二个是 pi 魅力，然后是蜘蛛 ，然后是 Visual Studio 代码和崇高
tags, then add on atom women there are so many others, but Jupiter is at the top and 标签，然后加上原子女人还有 很多其他的，但木星在顶部，
this is for I mean, these all are listed with respect to the data science community. So 我的意思是，这些都是针对数据 科学社区列出的。所以
in the data science community which Python ID he is best over the other and, and Jupiter 在数据科学社区中哪个 Python ID 他是最好的，和 Jupiter
Jupiter is at the top I mean it is it is way out. And one reason to this is its simplicity. 木星在顶部我的意思是它是出路 。原因之一是它的简单性。
It's it's supporting to so many different formats. It's it makes an interactive document 它支持这么多不同的格式 。它是一个交互式文档
it makes it makes a web page that is interactive, you can just change the code you can make 它使网页具有交互性，您只需 更改您可以制作的代码
another web page and so on. You can you can run it on a local system you can run it an 另一个网页等等。你可以你可以在 本地系统上运行它你可以运行它
online survey system and whatnot I mean it has so much flexibility and very quick start 在线调查系统等等 我的意思是它 有很大的灵活性和非常快速的启动
and easy to use. If you for example see the popularity of Python IDs with respect to the 并且易于使用。例如， 如果您看到 Python ID 在
employment then then you can see overall the the Jupiter has been a winner as compared 就业然后你可以看到整体木星 相比之下一直是赢家
to pi charm spider also your code and sublime if you see company or self employed still 如果您仍然看到公司或自雇人士，那么 pi 魅力蜘蛛也是您的代码和崇高的
the Jupiter is V out it has been if you see for in a student perspective, Jupiter is the 木星是 V out 如果你从学生 的角度来看，木星是
choice. If you go to academia or university, Jupiter is the choice if you are working with 选择。如果你去学术界或大学，如果 你正在工作，木星是你的选择
government or nonprofit Jupiter is the choice I'm in Jupiter is I mean Jupiter is kind of 政府或非营利性木星是我在木星 的选择 我的意思是木星有点
outlier it is it is staying at the top everywhere. Further if you if you analyze the popularity 离群的是它在任何地方都保持在顶部 。此外，如果您分析受欢迎程度
of Python, it is with respect regions for example, again, overall, Jupiter is a winner. 在 Python 中，就区域而言，再一 次，总体而言，木星是赢家。
If you see US or Canada Jupiter's most popular mostly used Europe, Jupiter is the winner 如果你看到美国或加拿大木星最 受欢迎的欧洲，木星是赢家
Asia, Jupiter is the winner, America use Jupiter sevinor effect Africa and Middle East Jupiter, 亚洲，木星是赢家，美国使用木星 sevinor效应非洲和中东木星，
Australia, New Zealand Jupiter. I mean, these numbers are suggesting that Jupiter is is 澳大利亚、新西兰木星。我的意思 是，这些数字表明木星是
at the top, not just at the top. It's easy, I mean, and maybe that's one reason why Jupiter 在顶部，而不仅仅是在顶部。这很容易 ，我的意思是，也许这就是为什么木星
stands on the top for the data science. So these numbers and these all statistics suggest 站在数据科学的顶端。所以这些 数字和所有这些统计数据表明
that we should use Jupyter Notebook for Python. And we will be doing that. In fact, for this 我们应该使用 Jupyter Notebook for Python。 我们将这样做。事实上，对于这
particular course we'll be working on Jupiter for all kinds of coding. And in the in the 在特定课程中，我们将使用 Jupiter 进行各种编码。而在
next video, I will be just showing you how to install 下一个视频，我将向您展示如何 安装
Jupiter environment how to install basically Python and how to run Jupiter for the first Jupiter 环境如何安装 Python 基本 以及如何运行 Jupiter 的第一个
time from it. So I hope to see you in the next video. Okay, in this video, I will show 时间从它。所以我希望在下一个视频中 见到你。好的，在这个视频中，我将展示
you how to install Python. There are multiple ways of installing Python you can go to python.org 你如何安装Python。有多种安装 Python 的方法，您可以访问 python.org
and install Python from there I would recommend to use Anaconda distribution it has Python 并从那里安装 Python 我建议使用 它有 Python 的 Anaconda 发行版
it has a lot of packages pre installed it has Jupyter Notebook as well. So installing 它预先安装了很多软件包，也 有 Jupyter Notebook。所以安装
through Anaconda is easier as well. So if for example if you are working on a Windows 通过 Anaconda 也更容易。因此， 例如，如果您正在使用 Windows
system you should download the executable for Windows we will be working with Python 您应该下载 Windows 的可执行 文件，我们将使用 Python
three rather than Python two. So you should be installing you should be downloading Python 三个而不是 Python 两个。所以 你应该安装你应该下载Python
three point whatever the latest version is. Further if your system is 64 bit you should 无论最新版本是三点。此外，如果 您的系统是 64 位，您应该
be installing 64 bit version otherwise you will be installing 32 bit version. So let's 正在安装 64 位版本，否则您将 安装 32 位版本。那么让我们
say you have downloaded the executable file for Windows then after the download you just 假设您已经下载了适用于 Windows 的 可执行文件，然后在下载后您只需
from that xe file and follow the steps and you'll be able to install Anaconda once the 从该 xe 文件并按照步骤操作，一旦 安装完成，您就可以安装 Anaconda
Anaconda is installed then in the search bar you just type Anaconda prompt and the Anaconda 安装 Anaconda 然后在搜索栏中 输入 Anaconda prompt 和 Anaconda
prompt kind of symbol that my mouse is pointing at this will appear in front of you, you just 我的鼠标指向的提示符号会 出现在你面前，你只是
run it you will see a command prompt like so. Then in that just type Jupyter Notebook 运行它你会看到这样的命令提示符 。然后在其中输入 Jupyter Notebook
and press enter and you will be having Jupiter running in front of you. Let me let me show 然后按回车键，你就会看到木星 在你面前运行。让我让我展示
you that on my on my system. How to do that. Let's see. For example, this is my search 你在我的系统上。怎么做。让我们 来看看。例如，这是我的搜索
bar. Let me type and conda prompt so this is the Anaconda prompt. So if I click it, 酒吧。让我输入和 conda 提示，所以这 是 Anaconda 提示。所以如果我点击它，
it runs then I just typed for example, Jupiter note book Then I just press enter. For the 它运行然后我只是输入例如，木星 记事本然后我按回车键。为了
first time it will take some seconds to run. So let's wait for it. So yes, it runs and 第一次运行需要几秒钟。所以让我们拭目以待 吧。所以是的，它运行并且
it will show you kind of browser in front of you. And that's what the Jupiter into interface 它会在你面前显示一种浏览器 。这就是木星进入界面
is. We will see then how from this Jupiter how to write the code how to make the code 是。然后我们将看到如何从这个 Jupiter 如何编写代码 如何制作代码
files and stuff but that's how from Anaconda installing after installing Anaconda that's 文件和东西，但这就是安装 Anaconda 后从 Anaconda 安装的方式
how you will launch the Jupiter. So this is that easy, no problem. Then, for example, 你将如何发射木星。所以这很容易 ，没问题。然后，例如，
you can install you can install Python if you're working on Linux and just download 你可以安装你可以安装 Python 如果 你在 Linux 上工作，只需下载
the version for Linux. And then rather than For example, let's say your your your file Linux 的版本。然后而不是 例如，假设您的文件
is downloaded in the Downloads folder then run this command bash and this.sh that's the 下载到 Downloads 文件夹中，然后 运行此命令 bash 和 this.sh
file name. The installer prompts in order to continue installation process this I'm 文档名称。为了继续安装 过程，安装程序提示我
in these kinds of commands will will appear Press Enter to Continue then press Yes, and 在这些类型的命令中会出现 Press Enter to Continue 然后按 Yes，然后
the installer will finish with the thanks message. After that, you just go to downloads 安装程序将完成感谢信息 。之后，你只需去下载
folder and type Jupyter Notebook and the Jupyter Notebook. interface the browser based interface 文件夹并输入 Jupyter Notebook 和 Jupyter Notebook。 interface 基于浏览器的界面
will appear in front of you. You can have if you're if you're working on Mac, you can 会出现在你的面前。如果你在 Mac 上工作，你可以拥有，你可以
you can in you can download the Anaconda distribution for Mac, then you'll find an anaconda Anaconda 你可以在你可以下载 Mac 的 Anaconda 发行版 ，然后你会找到一个 anaconda Anaconda
navigator, the launchpad you can launch that and then just click there's a Jupiter icon 导航器，您可以启动的启动板 ，然后只需单击木星图标
in front of you just press the Launch button and you'll be having your Jupiter running 在你面前只需按下启动按钮 ，你就会让你的木星运行
in front of you. So in this video, we just talked about how to install Python. If you 在你面前。所以在这个视频中，我们 只讨论了如何安装 Python。如果你
install Python using Anaconda you will be having Jupyter Notebook as well. In the next 使用 Anaconda 安装 Python，您也 将拥有 Jupyter Notebook。下一个
video, we will see how to actually use that Jupyter Notebook interface for example, I 视频，我们将看到如何实际使用 Jupyter Notebook 界面，例如，我
work on Windows, so I'll be having this kind of interface although the interface looks 在 Windows 上工作，所以我将拥有 这种界面，尽管界面看起来
like same because it's a browser based web based interface. In the next video, I will 一样，因为它是基于浏览器的基于 Web 的界面。在下一个视频中，我会
show you how to get comfortable with Jupiter and we will be also writing our first HelloWorld 向您展示如何适应 Jupiter，我们 还将编写我们的第一个 HelloWorld
program in Python. So hope to see you in the next video. Okay, so in this video, I will 用 Python 编写程序。所以希望在下一个视频中 见到你。好的，所以在这个视频中，我会
show you 给你看
how to write the first program in Python basically the HelloWorld program. Before that, in the 如何在 Python 中编写第一个程序基本上 是 HelloWorld 程序。在此之前，在
previous video, I show you I showed you how to launch Jupyter Notebook. So once you launch 在上一个视频中，我向您展示了我向您展示 了如何启动 Jupyter Notebook。所以一旦你启动
Jupyter Notebook, whether you are working on Windows, whether you're working on Linux Jupyter Notebook，无论您是在 Windows 上工作，还是在 Linux 上工作
or Mac, whatever, when you will launch the Jupyter Notebook, you will see this web based 或者 Mac，不管怎样，当你启动 Jupyter Notebook 时，你会看到这个基于网络的
interface. And here you are in the right corner you can see the button new, you just click 界面。在这里你在右上角你可以 看到新的按钮，你只需点击
it, you will select Python three, and you will see a beautiful interface in front of 它，你会选择Python三，你会 看到一个漂亮的界面在前面
you that will allow you to go here, there are a lot of file edit view there are a lot 你允许你去这里，有很多 文件编辑视图有很多
of parents kernel and a lot of controls here we will see them as we move on. But this is 父母内核和许多控件在这里我们将 在继续前进时看到它们。但这是
how you this is this is what the coding environment is this is kind of editor as well as I mean 你如何，这就是编码环境，这是一 种编辑器，也是我的意思
this is complete, ie interface in front of you. So let's see this interface a little 这样就完成了，即界面呈现在你面前 。那么让我们稍微看一下这个界面
bit. Step by step at least the controls that that we need. First of all, you are seeing 少量。至少一步一步地控制我们 需要的。首先，你看到
where my cursor is moving. That's the file name or the notebook name. You can change 我的光标移动的地方。那是文件名 或笔记本名称。你可以改变
the notebook name or you can just write for example. Whatever the name of the notebook 笔记本名称，或者您可以只写例如 。不管笔记本叫什么名字
you want, for example, mastering by Thorne 例如，您想要由 Thorne 掌握
for 为了
beginners. Okay, so let's say that you're mastering Python, let's say let's say zero 初学者。好吧，假设您正在掌握 Python，假设您已经掌握了零
to hero, maybe. So let's say this is your filing, you just create that file and you'll 对英雄，也许。假设这是您的归档 文件，您只需创建该文件即可
see this mastering Python zero to hero that file is created with this file is renamed. 看到这个掌握 Python 零到英雄，用 这个文件创建的文件被重命名。
Second. This is a cell in which you are going to type your code. The code, I mean, the two 第二。这是您要在其中键入代码的单元格 。代码，我的意思是，两个
modes of writing is one is you can write the Python code. Another way is you can write 编写方式之一是您可以编写 Python 代码。另一种方法是你可以写
the markdown. The markdown is important in in a way that if you want to describe your 降价。降价在某种程度上很 重要，如果你想描述你的
code, if you want to write other stuff other than Python code, you can use these markdown 代码，如果你想写Python代码以外的 其他东西，你可以使用这些markdown
cells and they We will be helping you. For example, if I select this markdown, and I 细胞和它们 我们将帮助您。例如 ，如果我选择这个降价，我
just select this markdown, and I type here, for example, 只需选择这个降价，然后我在这里输入 ，例如，
this is by THON directorial. And then I press Shift Enter, it will appear as a heading. 这是 THON 导演的。然后我按 Shift Enter，它将显示为标题。
And a new cell will be graded down. This is also a cell. But this is a markdown cell. 一个新的单元格将被降级。这也是一 个细胞。但这是一个降价单元格。
As you can see, now in this cell, that's a code cell, you can switch a cell from code 正如你所看到的，现在在这个单元格中，这是一 个代码单元格，你可以从代码中切换一个单元格
to markdown by just pressing an escape key, when you press an escape key, you will see 只需按转义键即可降价，当 您按转义键时，您会看到
the color will change here, you can press Escape key, then if you press M, it will change 这里的颜色会改变，你可以按Escape 键，然后如果你按M，它会改变
to markdown. And if you press Y, it will change to a code cell. There are several I mean shortcuts 降价。如果您按 Y，它将更改为代码 单元格。有几个我的意思是快捷方式
that are available keyboard shortcuts, if you if you just see, if you go to help and 这是可用的键盘快捷键，如果 你只是看到，如果你去帮助和
see this keyboard shortcuts, there are several shortcuts that will be available in front 看到这个键盘快捷键，前面 会有几个快捷键
of us. For example, if you press escape, and then press F, you can do the Find and Replace 我们。例如，如果按 Esc，然后 按 F，则可以执行查找和替换
operation. And if you press enter, then that will go into Edit Edit Mode, if that's important, 手术。如果你按下回车键，就会进入 编辑编辑模式，如果这很重要的话，
if you press Shift, enter, the cell will run and the new the cursor will go into the new 如果你按 Shift 键，回车，单元格 将运行，新的光标将进入新的
cell. And there are a lot of controls you should be seeing most of them, I mean, getting 细胞。并且有很多控件你应该看到 其中的大部分，我的意思是，让
a good grip on these controls will help you moving in this Jupyter Notebook very quickly. 很好地掌握这些控件将帮助您在 此 Jupyter Notebook 中快速入门。
So for example, this is a Python tutorial that's a markdown cell, you can also create 例如，这是一个 Python 教程，它是 一个 Markdown 单元格，您还可以创建
this, this cell also as a markdown cell. And then you can type here for example. This is 这个，这个单元格也作为一个降价单元格 。然后你可以在这里输入例如。这是
our first program in Python. It there it is just started here, for example, and it just 我们的第一个 Python 程序。例如 ，它是从这里开始的，它只是
appears like like a description. And again, a new cell is created down and there you can 看起来像一个描述。再一次，一个新 的单元被创建下来，你可以在那里
write your code. So let's write the first Python code HelloWorld. So first of all, you 写你的代码。那么让我们编写第一个 Python 代码 HelloWorld。所以首先，你
will write Brent Brent command will allow you to print anything on the screen. brantas 将写 Brent Brent 命令将允许您在 屏幕上打印任何内容。布兰塔斯
says double codes, starts ends. And in the double code, you write whatever you want to 说双码，开始结束。在双重代码 中，你想写什么就写什么
be printed on the screen, for example. Hello, 例如，打印在屏幕上。你好，
world. 世界。
And once you have written that code, just press Shift and enter, and this code will 一旦你写好了代码，只需按 Shift 并输入，这段代码就会
execute in front of you. So that's HelloWorld printed in front of you. And that's our first 在你面前执行。这就是打印在您面前 的 HelloWorld。这是我们的第一个
program, I mean, writing the very first program in Jupyter Notebook. is is that easy. Not 程序，我的意思是，在 Jupyter Notebook 中编写 第一个程序。就是这么容易。不是
only that, this Jupyter Notebook will be created, you can you can just I mean describe anything, 只是，这个 Jupyter Notebook 将被创建， 你可以我的意思是描述任何东西，
you can write the headings, you can write HTML in it, you can write math, using lattic. 你可以写标题，你可以在其中写 HTML，你可以写数学，使用 lattic。
And for example, let me let me write lattic, or mat in front of you just just let's say 例如，让我让我写 lattic，或者 mat 在你面前只是让我们说
you're making a notebook that requires some mathematics in it. And it allows you to write 你正在制作一个需要一些数学 知识的笔记本。它允许你写
mathematics as well. For example, A equals B plus C, Shift Enter, and that appears like 数学也一样。例如，A 等于 B 加 C，按 Shift Enter，看起来像
a mathematical equation, not just this, you can write very complicated equations. I mean, 一个数学方程，不仅仅是这个，你可以 写出非常复杂的方程。我的意思是，
and and, and this whole notebook will contain your descriptions in terms of HTML or latech, 和，整个笔记本将包含您 的 HTML 或 latech 描述，
or descriptions, and code and all that mixed up, whatever. And at the end, you will, you 或描述，代码和所有这些混在一起的 东西，不管怎样。最后，你会，你
can, you can just download this. You can just download this, this notebook, as if you want 可以，你可以下载这个。你可以 随意下载这个，这个笔记本
a PDF file PDF file. If you want a notebook file, it's an output file if you want to latech PDF 文件 PDF 文件。如果你想要一个笔记本 文件，如果你想延迟，它是一个输出文件
if you want just a Python file if you want slides, for example. I mean, you can download 例如，如果您想要幻灯片，则只需要一 个 Python 文件。我的意思是，你可以下载
the same thing as slides. It will make slides for you. So there are a lot of ways of using 和幻灯片一样。它会为你制作幻灯片 。所以有很多使用方法
this notebook. And that's a ready made document. I mean, you end coding, the document is ready 这个笔记本。这是一个现成的文件。我的 意思是，你结束编码，文件准备好了
for you. So this notebook is really, really powerful Jupyter Notebook and coding in it 为你。所以这个 notebook 真的非常强大 的 Jupyter Notebook 并在其中进行编码
is not just the coding. I mean, it is Preparing a document. If you want to prepare a document, 不仅仅是编码。我的意思是，它正在准备 一份文件。如果你想准备一份文件，
you want to describe anything you want to add images, and at the end of the day, it 你想描述任何你想添加图像的 东西，在一天结束的时候，它
will be an HTML document for you. It can be shared on web. I mean, it's ready. Nothing 将是您的 HTML 文档。它可以在网络上共享 。我的意思是，它已经准备好了。没有
we we want to further finish it. So that was our HelloWorld program in Python. We will 我们想进一步完成它。这就是我们用 Python 编写的 HelloWorld 程序。我们会
continue to build this byte mastering Python zero to hero notebook, we will continue coding 继续构建这个字节掌握 Python 零 到英雄笔记本，我们将继续编码
in that we will describe the headings we will write the markdown cells and all that stuff. 在那我们将描述标题，我们将编写 降价单元格和所有这些东西。
And we will at the end of this course, you will be having one notebook with all kinds 我们将在本课程结束时，您将拥有 一本笔记本，其中包含各种
of descriptions and code in it. You can use that notebook afterwards, we will be building 其中的描述和代码。之后你可以 使用那个笔记本，我们将构建
well one notebook, one complete notebook for Python. So that's about it. That's the hello 一本笔记本，一本完整的 Python 笔记本 。就是这样。这就是你好
world. In the next video, we will see how to what are what are the constructs in in 世界。在下一个视频中 ，我们将看到如何在
Python, what are variables and other stuff. But before that, I also wanted to show that Python，什么是变量和其他东西 。但在那之前，我也想证明
this notebook is an enhanced worryin are the upgraded version of ipython shell. And I also 这款笔记本是ipython shell 的升级版 ，是一款增强版。我也
want to show you ipython shell as well. So in the next video, we will just see the ipython 也想向您展示 ipython shell。所以在 下一个视频中，我们将只看到 ipython
shell and we will see how can we how can we view Python as just as a calculator by using shell，我们将看到我们如何通过 使用将 Python 视为计算器
ipython shell. So hope to see you in the next video. Okay, so in this particular video, ipython 外壳。所以希望在下一个视频中见到 你。好的，所以在这个特定的视频中，
I'm going to show you the ipython shell just open up the Anaconda prompt as as before, 我将向您展示 ipython shell 就像以前 一样打开 Anaconda 提示符，
like you want to open a Jupyter Notebook, then you just type here Jupyter Notebook. 就像你想打开一个 Jupyter Notebook，那么 你只需在此处输入 Jupyter Notebook。
And you will be you will be in the in the notebook word Jupyter Notebook word. But if 并且您将在笔记本单词 Jupyter Notebook 单词中出现。但是如果
you just type in ipython and press enter, then a prompt is open for you in a colored 您只需输入 ipython 并按回车键 ，就会为您打开一个彩色提示
way. And this is perfectly fine to write any kind of Python code in here. Actually, the 道路。在这里可以编写任何类型 的 Python 代码。实际上，该
Jupyter Notebook is more enhanced and more featured the use of ipython. Basically everything Jupyter Notebook 使用 ipython 进行了 更多增强和更多功能。基本上一切
that I bought, that is there in ipython is there in Jupyter Notebook as well. But it 我买的，ipython 中有，Jupyter Notebook 中也有。但它
has more features more documentation and stuff. So for example, if I just write a Python code 有更多功能更多文档和东西。例如 ，如果我只写一个 Python 代码
here, 这里，
hello world, let's say it will work in ipython shell as well. But remember, previously in 你好世界，假设它也可以在 ipython shell 中工作。但请记住，之前在
in Jupyter Notebook, we type Shift Enter to run a particular command here, we just press 在 Jupyter Notebook 中，我们键入 Shift Enter 以在此处运行特定命令，我们只需按
enter and everything will work. If you want to clear the screen here, whatever the whatever 输入，一切都会好起来的。如果 你想在这里清屏，不管怎样
we typed here, if you want to clear that, just press Ctrl l if you're on Windows Ctrl 我们在这里输入，如果你想清除它， 如果你在 Windows Ctrl 上，只需按 Ctrl l
l will work on Windows. Now ipython is just like, you can use the Python in this particular 我将在 Windows 上工作。现在 ipython 就 像，你可以在这个特殊的地方使用 Python
shell just like a calculator, for example, you want to plus three, press enter, that's shell就像一个计算器，比如 你要加三，按回车，就是
five, let's say it's nine multiplied by seven, the answer is 63. You can write a complicated 五、假设是九乘以七，答案 是63。你可以写一个复杂的
statement as well, for example, 45 minus eight is static, or multiplication, static is achieved 语句也是一样，例如45减8是静态 的，或者乘法，静态是实现的
by multiplication is achieved by a static symbol seven. And then you can have this minus 乘法是通过一个静态符号七来 实现的。然后你可以有这个减号
then divided by two and just press Enter. And that's the answer 16.0. If for example, 然后除以二，然后按 Enter 键。 这就是答案 16.0。例如，如果
by the way, I have just press the up arrow key and last command just appears. I have 顺便说一句，我刚刚按了向上箭头键 ，最后一个命令就出现了。我有
pressed up arrow key again. And the second last command appears. I press the up arrow 再次按下向上箭头键。出现倒数 第二个命令。我按向上箭头
key again and the third last command appears and now I'm pressing the down arrow keys. 再次键，出现倒数第三个命令 ，现在我按下向下箭头键。
So for example this and you may have whatever the result is, you may have that multiplied 所以例如这个，你可能会得到 任何结果，你可能会乘以
by 10 and minus or or maybe plus plus 15. So the result is minus 145, and so on. So 减 10 减或加减 15。所以结果 是减 145，依此类推。所以
this Python ipython shell, you can write very complicated are almost I mean, the complete 这个Python ipython shell，你可以写的 很复杂的都差不多了，完整的
Python coding can be written in ipython shell. And you can use this shell just for a calculator. Python 编码可以用 ipython shell 编写 。您可以将此外壳仅用于计算器。
Now let let's see, for example, you you compute this result, let's say 45 minus 45 minus nine 现在让我们看看，例如，你计算这个 结果，比方说 45 减 45 减九
and let's say you compute this result, whatever the result is, and you save that result in 假设你计算了这个结果，不管结果 是什么，你把结果保存在
a symbol, let me call that symbol as a variable. In here the variable is So let's say you save 一个符号，让我将该符号称为变量 。在这里变量是所以假设你保存
that in a, and then you have another variable, let's say B, and three static 45, or maybe 在 a 中，然后你有另一个变量，比方 说 B，和三个静态 45，或者也许
three steric 2.6, that is saved in B. Now, you have you have done this particular calculation, 三个立体 2.6，保存在 B 中。现在 ，你已经完成了这个特殊的计算，
you know that 45 minus nine is in a, the result is in a, and then you have this particular 你知道 45 减 9 在 a 中，结果在 a 中，然后你有这个特殊的
result that is in B. And now, you just want to add the two results together, and you want 结果在 B 中。 现在，您只想将两 个结果加在一起，并且您想要
to print the 打印
what what normal calculators does not have the support of saving the results and reusing 什么普通计算器不支持 保存结果和重复使用
them. But here in Python, even if you just want to use the Python, just as a calculator, 他们。但是这里在 Python 中，即使你只是 想使用 Python，也只是作为一个计算器，
you can declare as many variables as you can and you can save the previous results, you 你可以声明尽可能多的变量， 你可以保存以前的结果，你
can retrieve the previous results. And you can use the previous results, save new results 可以检索以前的结果。并且可以 使用以前的结果，保存新的结果
and so on. These kind of symbols that are used to save the results, and then they can 等等。这些用于保存结果 的符号，然后它们可以
be just used afterwards, these are called variables. And our next video will be on variables, 只是在之后使用，这些被称为变量 。我们的下一个视频将是关于变量的，
what are these variables, what are the types, what kind of variables the Python supports 这些变量是什么，类型是什么 ，Python支持什么类型的变量
one way or the other, if you want to go beyond calculators, you need certain results to be 一种或另一种方式，如果你想超越 计算器，你需要某些结果
saved and retrieved retrieved afterwards. And the variables are are the constructs the 保存和检索后检索 。变量是构造
variables are the features that actually do that. So the calculator is fine, you can use 变量是实际执行此操作的功能。 所以计算器很好，你可以使用
this ipython shell just as a calculator. But if you want to do interesting programming, 这个 ipython shell 就像一个计算器 。但如果你想做有趣的编程，
complicated programs, I mean, you want to achieve a task that involves much more calculations 复杂的程序，我的意思是，你 想要完成一项涉及更多计算的任务
one way or the other, you have to save certain results in somewhere. And then you have to 一种或另一种方式，您必须将某些 结果保存在某处。然后你必须
combine the results together because the longer problems in normally are broken up into smaller 将结果组合在一起，因为通常较 长的问题会分解为较小的问题
piece of problems. And each smaller problem has a result that should be saved somewhere 一块问题。每个较小的问题都有 一个结果应该保存在某个地方
and afterwards the several results they should be combined to achieve the result that we 然后将几个结果组合起来， 达到我们想要的结果
are after. So these variables are required if you are going to do some interesting or 之后。所以如果你 要做一些有趣的或
complicated calculations or computations. So you, by the way before, before having these 复杂的计算或计算。所以你， 顺便说一下，在拥有这些之前
Jupyter Notebooks spit out just the enhanced version of this ipython shell, the iPod ipython Jupyter Notebooks 只是吐出这个 ipython shell 的增强版本，iPod ipython
shell just people used to write a lot of Python programming just in ipython shell. And even shell 只是人们过去常常在 ipython shell 中编写大量 Python 编程。乃至
even today is several people are writing their code complete code in ipython shell. But the 即使在今天，仍有几个人在 ipython shell 中编写完整的代码。但该
the Jupyter Notebook is more enhanced for the enmore documented more, I mean, it has Jupyter Notebook 更加增强，因为它 记录的更多，我的意思是，它有
better interfaces and several features that are better than just using ipython shell. 更好的界面和一些比仅使用 ipython shell 更好的功能。
So you have seen this ipython shell, it's very powerful, great, everything is fine with 所以你已经看到了这个 ipython shell， 它非常强大，很棒，一切都很好
it. But we will be using Jupyter notebooks, which are just the enhanced variants of this 它。但是我们将使用 Jupyter notebooks， 它只是这个的增强变体
ipython for our upcoming coding. So the purpose of this video was just to was just to introduce ipython 用于我们即将进行的编码。所以 这个视频的目的只是为了介绍
you with ipython shell and just to tell you that you can use Python just as a calculator 你使用 ipython shell 只是为了告诉 你你可以将 Python 用作计算器
and even more than that, and in the next video, we will be introducing variables in Jupyter 甚至更多，在下一个视频中，我们 将在 Jupyter 中引入变量
Notebook and we will see the Python or Python is really really much more powerful than just Notebook，我们将看到 Python 或 Python 真的比仅仅强大得多
a calculator. So hope to see you in the next video. Okay, in this video, we will talk about 一个计算器。所以希望在下一个视频中见到 你。好的，在这个视频中，我们将讨论
variables and operators the operations that you can perform on on variables. A variable 变量和运算符 可以对变量 执行的操作。一个变量
in a very layman term is basically a symbol that stores some data that can be used later 通俗地说，基本上就是一个符号， 用来存储一些以后可以使用的数据
on. So for example, this x is a symbol corrector or a symbol y is a symbol x y is a symbol 在。例如，这个 x 是一个符号校正器或一个 符号 y 是一个符号 x y 是一个符号
normally, and these are called names of the variables. For example, this is a variable 通常，这些被称为变量的名称 。例如，这是一个变量
name x, y is a variable name y, x y is a variable name itself. Now, these variables, they can name x, y 是变量名 y, x y 是变量名本身 。现在，这些变量，他们可以
store different kinds of data, I mean, whenever you want a particular data to be used again 存储不同类型的数据，我的意思是， 每当您想要再次使用特定数据时
and again, it is better to save that data or label that data by a symbol by a descriptive 再一次，最好是保存该数据或 通过描述性的符号来标记该数据
name so that you can retrieve that team retrieve that data by using that label or symbol. So 名称，以便您可以检索该团队使用该 标签或符号检索该数据。所以
one way or the other. This this variable actually is a description of the data that you want 一种或另一种方式。这个这个变量实际上 是你想要的数据的描述
to use our store and you want to use later on in your program. Different types of data 使用我们的商店，并且您希望稍后在 您的程序中使用。不同类型的数据
are there, for example, the integer type data. 例如，是否存在整数类型数据。
For example, if the data you want to store is integer type, it's a number And the number 例如，如果你要存储的数据是整数 类型，它是一个数字和数字
is just the integer number it does not have a decimal point expansion that is a type of 只是整数它没有小数 点扩展是一种类型
data and that can be stored in a variable in that in that case, the variable type itself 数据并且可以存储在变量中， 在这种情况下，变量类型本身
will be integer, you need not to specify the type of variable when you are storing the 将是整数，您在存储时不 需要指定变量的类型
data to it the storing data to a variable is sometimes called assigning data to a variable data to it 将数据存储到变量 有时称为将数据分配给变量
or assignment. For example, if your variable is x, and you are assigning a value let's 或任务。例如，如果您的变量是 x， 并且您正在分配一个值，让我们
say two, then two is integer value its integer it does not have a decimal expansion and when 说二，那么二是整数值，它的 整数没有十进制扩展，当
to is assigned to x, based on the content to that to basically is an integer type value, to 被赋值给 x，根据 to 的内容，to 基本上是一个整数类型的值，
automatically this the type of x is set to be integer. And that is sometimes called the 自动将 x 的类型设置为 整数。这有时被称为
dynamically typed Python is dynamically typed language or dynamic typing, you need not to 动态类型 Python 是动态类型语言 或动态类型，你不需要
specify the type of the variable the contents that you are assigning to a variable, they 指定变量的类型您分配 给变量的内容，它们
will define the type of the variable on the fly. And the assignment for example, in here 将动态定义变量的类型 。和分配例如，在这里
I'm storing two insight x and next time if I want to print for example, what is there 我正在存储两个 Insight x ，下次如果 我想打印，例如，那里有什么
in x the the print value will be two. Now, this kind of symbol is hot right there is 在 x 中，打印值将为 2。现在 ，这种符号很热就在那里
no keyboard symbol that looks like so, so rather than writing this symbol for assignment, 没有看起来像这样的键盘符号 ，所以不要写这个符号来赋值，
normally an equal sign symbol is used for assignment for example, x is equal to two 通常使用等号符号进行 赋值，例如，x 等于 2
that means two is assigned in x five is equal five is equal to five means five is assigned 这意味着在 x 中分配了两个 5 等于 5 等于 5 意味着分配了 5
in y 7.2 equal x y equals 7.2x y is completely a new variable, it has nothing to do with 在 y 7.2 等于 x y 等于 7.2x y 完全 是一个新变量，与它无关
x or y. And it is handy sometimes to to to suggest the name of the variables that are x 或 y。有时建议变量 的名称很方便
too descriptive that are very, very descriptive to increase the readability and management 描述性太强，非常非常具有描述性 ，以增加可读性和管理
of the code, because later on you will you will be seeing when you will be working in 代码，因为稍后你会 看到你什么时候工作
data science and other stuff. The programs that you will be writing might not be very 数据科学和其他东西。您将 要编写的程序可能不是很
short programs, they might be lengthy programs. So readability of a program and management 短节目，它们可能是冗长的节目 。所以程序和管理的可读性
of a program becomes an issue if you if you if you do not assign the names of the variables 如果您不分配变量的名称 ，程序的名称就会成为问题
carefully. However, if you write the names very in a very descriptive way, by just writing 小心。但是，如果您以非常具有 描述性的方式写下名称，只需写下
the name of the variable by just creating the variable symbol or or or the name, it 变量的名称通过创建变量 符号或或或名称，它
tells a better look and feel of what kind of data inside and what should I do with that. 告诉更好的外观和感觉里面有什么样 的数据，我应该用它做什么。
So, I was talking about this equal sign this equal sign is used for assignment. Here for 所以，我在谈论这个等号，这个 等号用于赋值。在这里为
examples when 7.2 is assigned to a variable x y, automatically the type of x y variable 示例当 7.2 被分配给变量 x y 时 ，自动指定 x y 变量的类型
is set to be a floating point integer floating point number a float is a data type in in 设置为浮点整数浮点数浮点数 是 in 中的数据类型
Python that describes that the particular data is a real valued it may have a decimal 描述特定数据是实数值 的 Python 可能有小数
expansion as well not just integer and floats are the only data types in Python, there are 不仅整数和浮点数是 Python 中 唯一的数据类型，还有扩展
several others for example, you can define complex numbers if you if you want to you 例如其他几个，如果你愿意 ，你可以定义复数
can for example, defining a complex number might be for example, you write the name of 可以例如，定义一个复数 可能是例如，你写的名字
C and you write two plus four j if you write the symbol j here, it automatically becomes C，你写二加四 j 如果你在这里 写符号 j，它会自动变成
complex. And now you can you can use this see the way the complex numbers should be 复杂的。现在你可以用这个 来看看复数应该是怎样的
created. Similarly, there are other data types like fractions decimals, there are there are 创建。同样，还有其他数据 类型，如分数小数，还有
further data types, the objects called strings. For example, if you if you if you assign let's 进一步的数据类型，称为字符串的对象 。例如，如果您如果您分配让我们
say s equals double quotes Hello say s 等于双引号 Hello
then that S is also a variable and the type of this variable a string string is just a 那么 S 也是一个变量，这个变量 的类型字符串只是一个
sequence of a lot of collectors, where he is a collector is a collector L is a collector 许多收藏家的序列，他是 收藏家是收藏家 L 是收藏家
L is a collector always a collector W is a vector. And when we will define anything, L 是一个收集器，收集器 W 总是一个 向量。当我们定义任何东西时，
any sequence of characters inside the double quotes and then ended the double quotes here, 双引号内的任何字符序列， 然后在此处结束双引号，
or the single quotes, single quotes and double course either way, then the type of this is 或单引号，单引号和双课程任一 种方式，那么 this 的类型是
become strings. And these characters should be created as it is. Like for example, if 变成字符串。这些角色应该 按原样创建。例如，如果
we have another variable s two and we just say one, two, in double quotes. Now this s 我们有另一个变量 s 2，我们只是 用双引号表示一、二。现在这
two is no longer 12 as an integer. It is a sequence of characters where first character 二不再是 12 作为整数。它是一 个字符序列，其中第一个字符
is one and other graduates two, we will talk about strings in detail in the upcoming videos 是一个，其他毕业生是两个，我们将 在即将发布的视频中详细讨论字符串
but just to give you a look and feel that Python actually supports a lot of data types, 但只是为了让您感受一下 Python 实际上支持很多数据类型，
a lot of interesting data types including the most important data type is integer float 很多有趣的数据类型，包括最 重要的数据类型是整型浮点数
and string as well that we will see in detail. Further you can assign you can assign more 和字符串以及我们将详细看到的。您 可以进一步分配您可以分配更多
than one values to more than one variables in in a single line there is sometimes called 在一行中的多个值到 多个变量有时被称为
multiple assignment. For example, if you write a comma b equals four comma 5.00, then four 多重赋值。例如，如果你写一个逗号 b 等于四个逗号 5.00，那么四个
will be assigned to a and 5.0 will be assigned to B. notice one thing although 5.0 looks 将分配给 a 并且 5.0 将分配给 B。 注意一件事，虽然 5.0 看起来
like an integer, but when you when you write a decimal expansion, it automatically becomes 就像一个整数，但是当你写一个 小数展开式时，它会自动变成
float. So, if you Now type the type, if you now check the type of a it will be integer 漂浮。所以，如果你现在输入类型，如果 你现在检查 a 的类型，它将是整数
and if you check the type of B it will be float. Once you have declared a lot of variables, 如果您检查 B 的类型，它将是 浮动的。一旦你声明了很多变量，
they stay in the memory they occupy a particular space inside the memory. For example, x is 它们留在内存中，它们占据内存内部 的特定空间。例如，x 是
just a label to a memory inside the memory that is to located somewhere. Similarly, y 只是内存中位于某处的内存 的标签。类似地，y
is also located somewhere in memory. And similarly x y is also located somewhere in memory. And 也位于内存中的某处。同样，xy 也位于内存中的某处。和
this is the data inside that memory. These will stay in the memory and the occupy the 这是该内存中的数据。这些 将留在记忆中并占据
memory. If you if you decide to no longer use a particular variable and future in the 记忆。如果您决定不再 使用特定变量和未来
in the program, then you can call this function d l space, whatever the variable name, and 在程序中，那么你可以调用这个函数 d l 空间，不管变量名是什么，并且
it will delete the it will delete the variable from the memory like it was never there. And 它将删除它将从内存中删除变量 ，就像它从未存在过一样。和
once the variable is no longer in memory, it is it is not accessible. If you now access 一旦变量不再在内存中，它 就不可访问。如果您现在访问
the variable again, you will get an error. Let's see all these concepts. Let let's see 再次变量，你会得到一个错误。让我们 看看所有这些概念。让我们看看
most of these concepts in Jupyter Notebook and let's let's actually, let's let's actually Jupyter Notebook 中的大部分概念， 让我们实际上，让我们实际上
define certain variables, use them, print them, do some multiple assignment and see 定义某些变量，使用它们，打印 它们，进行一些多重赋值并查看
a lot of stuff in in Jupyter Notebook. So let's go to Jupyter Notebook. So that was Jupyter Notebook 中有很多东西。那么让 我们来看看 Jupyter Notebook。所以那是
our notebook that we were doing, that we were actually working on the last time. So let's 我们正在做的笔记本，我们实际上 是在上一次工作。那么让我们
say I define a variable X, let's say x is two. Why not? Why not? I should describe this. 假设我定义了一个变量 X，假设 x 是 2。 为什么不？为什么不？我应该描述一下。
as what we are doing here is let's say variables. So just to give a heading that we are now 因为我们在这里做的是让我们说变量 。所以只是给我们现在的标题
in variables, so variables, notice that now I'm in a code cell. Previously I was in a 在变量中，所以变量中，注意现在我 在一个代码单元中。以前我在一个
markdown cell, notice this change in this particular cell, this is markdown in this 降价单元格，注意这个特定单元格 的这个变化，这是降价
particular cell, this is code cell, C that goes, Okay, x is equal to let's say, three, 特定的单元格，这是代码单元格，C 去，好吧，x 等于比方说，三，
let's into this. Now x is assigned a value three. If you want to know how many variables 让我们进入这个。现在 x 被赋值 为 3。如果你想知道有多少变量
right now are there in the memory, we can write this command whose This is a percentage 现在在内存中，我们可以写 这个命令，这是一个百分比
symbol, if you write percent a symbol and then just type a command, w h o s, it will 符号，如果你写一个符号百分比， 然后只输入一个命令，w o s，它会
tell you all the variables that are on right now that are there in the memory. And right 告诉你现在在内存中 的所有变量。对
now the memory has a variable with name x, its type is integer, and the data inside the 现在内存有一个名为 x 的变量， 它的类型是整数，里面的数据
variable is three, that's the memory view that you're now seeing. Okay, if you want 变量是三个，这就是你现在看到 的内存视图。好的，如果你愿意
to explicitly check the type of x, you can print type x. So for example, this function 要明确检查 x 的类型，您可以 打印类型 x。例如，这个函数
type will will actually find out the type of whatever variable you give inside and then type 实际上会找出你在里面给出 的任何变量的类型，然后
this print function will help you printing that on on the notebook. So if you see the 此打印功能将帮助您将其打印 在笔记本上。所以如果你看到
type of x, the type is basically its integer type. Now, x 的类型，类型基本上是它的整数类型。 现在，
if you for example, change the value of x as three to let's say, 5.7. So you have same 例如，如果您将 x 的值更改为 3， 假设为 5.7。所以你有同样的
variable, but you just change the value from three to 5.7. So let's see what happens now. 变量，但您只需将值从 3 更改为 5.7。 所以让我们看看现在会发生什么。
So if we call us again, we have now the variable name is still x, but its type automatically 所以如果我们再次调用我们，我们现在 变量名仍然是 x，但它的类型自动
it's type automatically change to floating point number, because of because we assign 它的类型自动更改为浮点数 ，因为我们分配
a floating point number to it. And this is the data if we want to explicitly check the 一个浮点数。如果我们要 明确检查，这就是数据
type of this x, that would be class float now, further. Let's say we have another variable 这个 x 的类型，现在是浮动类 ，进一步。假设我们有另一个变量
ABCD. That's a variable name, let's say and we assign a value 55 six Point, three, two, A B C D。这是一个变量名，假设我们 分配一个值 55 六点，三，二，
that's that's the value. If we now called whose function whose command, we will be having 这就是价值。如果我们现在调用 who 函数 who 的命令，我们将有
two particular values, one variable as ABCD, its type is float. another variable is x, 两个特定值，一个变量为 ABCD，其 类型为 float。另一个变量是 x，
its type is float, and that is there. If we, for example, do a multiple assignment, for 它的类型是浮动的，就在那里。例如 ，如果我们进行多项赋值，对于
example, a comma, when you write comma, first variable finishes, second variable starts 例如，一个逗号，当你写逗号时，第一 个变量结束，第二个变量开始
A, B, C, D, F, let's say these are five variables. And if you assign five values to five variables, A、B、C、D、F，假设这是五个变量。 如果你给五个变量分配五个值，
again in a comma separated list, 356, point 07, point two, and let's say minus three. 再次在逗号分隔列表中，356， 点 07，点二，假设减三。
So if you enter that, and you now check the status of the memory, because now all these 所以如果你输入那个，然后你现在检查 内存的状态，因为现在所有这些
values are assigned to the respective variables, if you now check the memory view, a is an 值被分配给各自的变量，如果你现在 检查内存视图，a 是一个
integer type variable with value three ABCD, the old variable that we assigned earlier, 值为 3 ABCD 的整数类型变量， 我们之前分配的旧变量，
it's already float B is also integer, it has value five sees float, sees float all those 它已经是浮点数 B 也是整数，它的值为 5 看到浮点数，看到浮点数所有这些
6.0 looks looks much like integer. But when you when you write a point explicitly, it 6.0 看起来很像整数。但是当你 明确地写出一个观点时，它
becomes it becomes a floating point number. So D is again, float with 7.2, f is integer, 变成浮点数。所以 D 又是， 浮点数为 7.2，f 是整数，
it's minus five. And x is the old old variable that we know already. Now, if we, for example, 现在零五。 x 是我们已经知道的旧 变量。现在，如果我们，例如，
delete a particular variable, if we for example, we we no longer want to use ABCD variable 删除一个特定的变量，例如， 我们不再想使用 ABCD 变量
ABCD. That's one variable that we don't want to use in future. And now if we see again, A B C D。这是我们将来不想使用的一个 变量。现在如果我们再次看到，
the view of the memory, we don't have this and if we now want to access this, for example, 内存的视图，我们没有这个，如果 我们现在想要访问这个，例如，
if we want to print this ABCD, we will get an error, we will get an error and we should 如果我们想打印这个 ABCD，我们会得到一 个错误，我们会得到一个错误，我们应该
we should get an error because this particular variable does not exist in the memory, it 我们应该得到一个错误，因为这个特定 的变量在内存中不存在，它
points to no data, it has gone, it has gone like it was never, it was never there. So 指向没有数据，它已经消失了，它像从来没有 一样消失了，它从来没有存在过。所以
that's about the variables. We just talked about integer and float, there are several 那是关于变量。我们刚刚谈到 整数和浮点数，有几种
other variable types as well. For example, let me just give you an example of an example 其他变量类型也是如此。 例如，让我给你举个例子
of a complex number, if you are really interested in that's a complex number if you print its 一个复数，如果你真的对那是一个 复数感兴趣，如果你打印它
type so that the type is complex. Similarly, you can have a string variable, let's say type 使类型复杂。同样，你可以 有一个字符串变量，比方说
hello, how are you? That's a string variable, if you bring the type of this you will get 你好吗？这是一个字符串变量，如果 你带上这个类型，你会得到
a string we will we have a whole set of videos just on string data type, because this is 一个字符串，我们将拥有一整套字符串 数据类型的视频，因为这是
very important data type we will we will see that in detail. But the purpose here is just 非常重要的数据类型我们将详细 介绍。但这里的目的只是
to tell you that there are a lot of data types that Python supports and Python is dynamically 告诉你Python支持的数据类型 很多，而且Python是动态的
typed whatever content you are assigning to a variable the that content decides the type 键入您分配给变量的任何 内容，该内容决定类型
of the screen you need not to specify. 您不需要指定的屏幕。
So I end this video here. In the next video, we will be talking about operators basically 所以我在这里结束这个视频。在下一 个视频中，我们将主要讨论运营商
what kind of so once we have decided once we have declared once we have defined a lot 什么样的所以一旦我们决定一旦 我们宣布一旦我们定义了很多
of variables, what we can do with these variables, can we add two variables together and get 的变量，我们可以用这些变量做什么， 我们可以将两个变量相加得到
the result stored in another variable can we multiply two variables together, can we 存储在另一个变量中的结果我们 可以将两个变量相乘吗？
have an operation like addition or mixed types for example, one variable is a floating by 例如，有一个像加法或混合类型这样 的操作，一个变量是一个浮动的
number and other variable is integer number integer type, can we mix up those can we add number 和其他变量是 integer number 整数类型 ，我们可以混淆那些可以我们添加
two different types of variables together and get a result then what will be the type 两种不同类型的变量放在一起 并得到结果那么类型是什么
of the result and so on. So a lot of these discussions on operators the very basic arithmetic 结果等等。所以很多关于运算符 的讨论都是非常基本的算术
operators on these variables, particularly the integer and float variables, we will see 这些变量上的运算符，特别是 整数和浮点变量，我们将看到
that in the next video, so hope to see you in the next video. So in the last video, we 在下一个视频中，所以希望在下一个视频 中见到你。所以在上一个视频中，我们
saw variables and we particularly saw integer type variable and floating point, variable 看到了变量，我们特别看到 了整型变量和浮点型变量
type. We also saw very briefly on Jupyter notebooks are complex, and string as well. 类型。我们还非常简要地看到了 Jupyter 笔记本很复杂，字符串也是如此。
So in this video, we are going to talk about operators, basically the arithmetic operators. 所以在这个视频中，我们将讨论 运算符，基本上是算术运算符。
Obviously, if you are defining variables, you're not defining the them the variables 显然，如果您正在定义变量 ，则不是将它们定义为变量
just to just to view them later on. Most probably you will be storing data to the variables 只是为了稍后查看它们。您很可能 会将数据存储到变量中
and then you are you're applying some computation on a set of variables together. Comparing 然后你正在对一组变量进行 一些计算。比较
new results saving that and doing some stuff, most probably you will be adding to variables 新结果保存并做一些事情 ，很可能你会添加到变量
some one way or the other in inside a program, you may have to add two variables, you may 在程序内部以某种方式或另一种方式， 您可能需要添加两个变量，您可能
have to subtract a variable from the other, you may have to divide a variable you may 必须从另一个变量中减去一个变量， 您可能必须除以一个变量，您可能
have to compute for example, these are arithmetic operators, let me let me just this this plus 例如，必须计算，这些是算术运算 符，让我让我就这个加上
symbol is used to add to variables. This minus symbol or subtraction is used to subtract 符号用于添加到变量。这个 减号或减法是用来减
a variable value from the other variable value. Obviously, these all are operated on values, 来自另一个变量值的变量值。显然 ，这些都是对值进行操作的，
not the names. Division, it like like the name suggests, it's if you want to divide 不是名字。除法，顾名思义 ，就是如果你想除法
this this person to a symbol when it is applied to two different variables, if x is on left 将此人应用于两个不同变量时 的符号，如果 x 在左侧
and y is on right, what it does it, it actually divides x by y, and checks what the remainder y 在右边，它做了什么，它实际 上将 x 除以 y，并检查余数
is, for example, if x is 27, and y is five, then what's the remainder? What do you think? 例如，如果 x 是 27，y 是 5，那么 余数是多少？你怎么认为？
If we divide 27 by five, what's the remainder the remainder will be? Two Yes, so the result 如果我们将 27 除以 5，余数是 多少？二 是的，所以结果
will be two here. So this computes the remainder. This multiplication this star symbol is used 这里会有两个。所以这计算了余数 。这个乘法这个星号被使用
as multiplication like in mathematics, we normally write this cross symbol. But in in 就像数学中的乘法一样，我们 通常会写这个十字符号。但在
Python, and in most of programming languages, Star symbol is used to achieve multiplication. Python，在大多数编程语言中 ，星号是用来实现乘法的。
This double slash is like the division, but it is division with the result flow to the 这个双斜线就像除法，但 它是除法，结果流向
quotient. What I'm saying is the following. For example, if you divide, let's say 10. 商。我要说的是以下内容。 例如，如果你除以 10。
by three, the result will be a floating point number, and the result will be 3.33. Something 乘以三，结果将是一个浮点数 ，结果将是 3.33。某物
like so. But if you want just the quotient, not the remainder, if you want the integer, 像这样。但是如果你只想要商而 不是余数，如果你想要整数，
that's the quotient value, then you write the double slash three, and it will return 那是商值，然后你写 双斜杠三，它会返回
just the value that is that is there before the decimal expansion. So this value will 只是在十进制扩展之前存在 的值。所以这个值会
be returned. So this is kind of the integer division or floor division, this double star 被退回。所以这是一种整数 除法或地板除法，这个双星
is used to compute the power. For example, if you want to compute to the right doublestar, 用于计算功率。例如，如果 你想计算到正确的双星，
four, that means two raised to the power four in mathematics, we write this as following. 四，即数学中二的四次 方，我们写成如下。
And the result will be 16, you can save that result in another variable, or you can just 结果将是 16，您可以将该结果保存 在另一个变量中，或者您可以
print it or you can write that in a file of whatever. So these are most important. operators. 打印它或者你可以把它写在任何文件 中。所以这些是最重要的。运营商。
One thing that I want to tell you that these operator are not just for integers and floating 我想告诉你的一件事是，这些运算符 不仅适用于整数和浮点数
point numbers, the applications of these operators is much broader than these later, we will 点数，这些算子的应用比这些要 广泛得多，后面我们会
see the objects or the data types that are collections. And very, I mean, the data types 查看属于集合的对象或数据类型 。非常，我的意思是，数据类型
that are beyond these integers and floats, and still there, this plus minus division, 超出这些整数和浮点数，仍然 存在，这个加减除法，
and all some of these are all of these, they have their meanings there. Even even even 所有这些都是所有这些，它们在 那里有它们的含义。甚至连
this plus is used for strengths. Now think for example, if you have a string, let's say 这个加号用于优势。现在想想， 如果你有一个字符串，让我们说
hello. 你好。
And you have another string, for example, let's say this is string s one, and you have 你有另一个字符串，例如， 假设这是一个字符串，你有
another string, let's say s two, which is why then Python allows you even to add these 另一个字符串，让我们说 s 两个，这 就是为什么 Python 允许您甚至添加这些
kind of data types, although some doesn't make any sense with these kinds of string 类型的数据类型，尽管有些对这些 类型的字符串没有任何意义
variables, but we will see four different kinds of data types. The the definition of 变量，但我们将看到四种 不同的数据类型。的定义
these operators, they actually changed or adapted accordingly. For example, in mathematics, 这些运营商，他们实际上相应地 改变或适应了。例如，在数学中，
we are much more fluent a four with plus with Debian with subtraction, and it makes sense 我们在 Debian 加减法中更流畅地 使用四加法，这是有道理的
to add two integers to subtract a floating point number from another floating point number 将两个整数相加以从另一 个浮点数中减去一个浮点数
and stuff, but with data type that is unfamiliar to you right now, these operators may not 等等，但是对于您现在不熟悉的数据 类型，这些运算符可能不会
make that sense to you. But there are definitions there, there are ways to use these variables. 对你有意义。但是那里有定义，有 一些方法可以使用这些变量。
For the data types that are even there or even beyond an integer and floating point 对于甚至存在甚至超出整数 和浮点数的数据类型
numbers, we will see all these details as we move on, as we move on to as we move on 数字，当我们继续前进时，我们将看到 所有这些细节，当我们继续前进时
to the videos. And I mean, as in later on, we will see all these things in detail, but 到视频。我的意思是，正如稍后，我们 将详细了解所有这些内容，但是
just to tell you that these operators are not just limited to integers and floating 只是告诉你，这些运算符 不仅限于整数和浮点数
point numbers or complex numbers, they can be applied to several different data types. 点数或复数，它们可以应用 于几种不同的数据类型。
So a lot of words, I guess you were born Now, let's go to Jupyter Notebook and have fun 这么多话，我猜你已经出生了 现在， 让我们去 Jupyter Notebook 玩得开心
with these kinds of concepts that we are dealing with. So yeah, here. So let's first press 与我们正在处理的这些概念。所以是的 ，在这里。所以让我们先按下
escape, then m just to change it to markdown and then good scape one for heading begetting. 逃脱，然后我只是将其更改为降价， 然后将其作为标题生成的好 scape 。
And here I write, let's say operators, and shift enter its runs and automatically then 我在这里写，让我们说运营商，然后 shift 输入它的运行，然后自动
go to code. Okay, now let's say I have a variable. So let's say what kind of variables I already 去代码。好的，现在假设我有一个变量。所以 让我们说我已经有了什么样的变量
have. In the previous video, we use that. So we already have these kinds of variables 有。在上一个视频中，我们使用了它 。所以我们已经有了这些类型的变量
with us. Now, what is let me define a new variable, let's say sum of sum of A, B, that's 和我们。现在，让我定义一个新变量 是什么，让我们说 A、B 的总和，那就是
a new variable sum underscore AB, that's a variable name, you can have a better way you 一个新的变量 sum 下划线 AB，这是一 个变量名，你可以有一个更好的方法
will name maybe some of A and B, that might be a variable name. It is good to have the 可能会命名 A 和 B 中的一些，这可能 是一个变量名。很高兴拥有
variable names that are descriptive that describe what data is inside. Because in in programs, 描述数据的描述性变量名称 。因为在程序中，
the programs become manageable, readable, and a lot of benefits are there. So Sum of 程序变得易于管理、可读， 并且有很多好处。所以总和
a and b, let's say that's a variable name. And you add a, b, you just write a plus b. a 和 b，假设这是一个变量名。 你加a，b，你就写一个加b。
Let me make the zoom level a little high so that you can see it clearly. So a plus b, 让我把缩放级别调高一点，以便您 可以清楚地看到它。所以a加b，
let's say that's there. If you press Shift, enter, and now your brand. Some of By the 让我们说就在那里。如果您按 Shift 键， 请输入，然后是您的品牌。一些由
way, if you have written some of you need not write everything, just press tab, and 方式，如果你写了一些你不需要写 所有的东西，只需按tab键，然后
it will automatically complete the remaining part of the variable and press Shift Enter 它将自动完成变量的剩余 部分并按 Shift Enter
and you have eight. If you check the type of this variable, some of tab automatically 你有八个。如果你检查这个变量 的类型，一些选项卡会自动
completes tab complete that is called tab completion, while it's integer, the type of 完成制表符完成，称为制表 符完成，而它是整数，类型
this particular variable is integer, that's a new variable and why and the type is integer 这个特定的变量是整数，这是一 个新变量，为什么和类型是整数
because a was integer, B was integer. And integer plus an integer is an integer. What 因为a是整数，B是整数。而 整数加整数就是整数。什么
if we add an integer with a floating point number? What do you think? What should be 如果我们添加一个带有浮点数的整数 ？你怎么认为？应该是什么
the result? If I just type type? A, that's an integer plus d with some floating point 结果？如果我只输入类型？ A, 那是 一个整数加上带有一些浮点数的 d
number. So a plus d, the result will be here, and type of that result. What will be the 数字。所以加上 d，结果将在这里， 以及该结果的类型。将是什么
type of that result? What do you think? Let me pause here for a few minutes, and oh, no, 结果的类型？你怎么认为？让我 在这里暂停几分钟，哦，不，
no, no, not for a few minutes. For a few, maybe seconds, maybe two or three seconds, 不，不，不是几分钟。几秒钟， 也许几秒钟，也许两三秒钟，
what will be the result? What will be the type of an integer and a float combined? 结果会怎样？整数和浮点 组合的类型是什么？
Well, the types are up costed, which means the floating point number, the result will 嗯，类型是加成本的，这 意味着浮点数，结果将
be a floating point number. And the reason is, every integer by default is a floating 是一个浮点数。原因是，默认 情况下每个整数都是浮点数
point number, a floating point number is a is an upper class, or you can say a superset. 点数，浮点数是一个上层类， 或者你可以说是一个超集。
So in Python, in Python, by default, the types are up costed to super super sets. So here 因此，在 Python 中，在 Python 中，默认情况下，类型 的成本会增加到超级超集。所以在这里
integer plus a float, the result will be a floating point number. And that's a result, 整数加一个浮点数，结果将是 一个浮点数。这就是结果，
you might be thinking why we have why we haven't stored the result in another variable. Well, 您可能会想为什么我们没有将结果 存储在另一个变量中。好，
if we want to store the result in another variable, we can, or if we just compute the 如果我们想将结果存储在另一个变量中 ，我们可以，或者如果我们只是计算
result and apply some operation on that, we can do that. For example. We could do the 结果并对其应用一些操作，我们可以 做到这一点。例如。我们可以做到
following, for example, a plus d. That's whatever the result is raised to the power three, whatever 下面，例如，加 d。这就是结果 被提升到 3 次方，不管
the result is, whatever the result is, divided by maybe four. And we just save that in a 结果是，不管结果是什么，除以四 。我们只是把它保存在一个
new variable. Let's say. Let's say the new variable is V. Let's say we save that value, 新变量。让我们说。假设新变量 是 V。假设我们保存该值，
and V. And now we print we, and we have the result for me. Wow. So we can do a lot of 和 V. 现在我们打印我们，我们有结果 给我。哇。所以我们可以做很多
stuff with these kinds of variables. Let me show you a fancy stuff that we will see later 与这些类型的变量的东西。让我给你 看一个我们稍后会看到的花哨的东西
on. Don't worry if you don't get it just as one, for example, as one is Hello. Hello, 在。如果您没有将它作为一个来理解，请 不要担心，例如，一个是 Hello。你好，
and let's say s two is world. And we have another variable, let's say s, which is s 假设两个是世界。我们还有另 一个变量，比如说 s，它是 s
one plus s two. What it will do is it will just concatenate them together. We will see 一加二。它会做的是将它们 连接在一起。我们会看到
strings a lot later on. But just to tell you this plus is not just for not just for numbers, 字符串很多以后。但只是告诉你 这个加号不仅仅是为了数字，
it is for other data types, very fancy data types that are there. One more thing, let's 它适用于其他数据类型，非常花哨 的数据类型。还有一件事，让我们
say we define 10 and we divide it by Three, and we want a quotient, the quotient is three. 假设我们定义了 10 并将其除以 3，我们想要一个商，商是 3。
However, if we have 10 divided by three, Shift Enter, the result actually is 3.33, and so 但是，如果我们将 10 除以 3，按 Shift Enter， 结果实际上是 3.33，依此类推
on, you might be wondering we have not saved that result in a particular variable. So where 继续，您可能想知道我们没有将该结果 保存在特定变量中。那么在哪里
the result is saved, actually, if you do not, if you do not save the result, if you do not 结果被保存，实际上，如果你不， 如果你不保存结果，如果你不
assign the result, for example, in this way, the result will be assigned to a variable 给结果赋值，比如这样，结果 会被赋值给一个变量
or, but if you do not assign if you do not store the result in a particular variable 或者，但如果您不将结果存储 在特定变量中，则不赋值
explicitly, by default, there is a variable in Python, which is underscore underscore 显式地，默认情况下，Python 中有一 个变量，它是 underscore underscore
contains the last result that you did not store in a particular variable explicitly. 包含您没有明确存储在特定 变量中的最后一个结果。
So, that underscore is basically one default variable for for the result, if you want, 因此，如果您愿意，该下划线基本上 是结果的一个默认变量，
don't try to update this underscore, just just read it Do not assign anything to underscore. 不要尝试更新此下划线，只需阅读 它不要为下划线分配任何内容。
For example, if you assign something to underscore assignment will be done, but then the properties 例如，如果您将某些东西分配给 下划线分配将完成，但是属性
of underscore will no longer be there as they are in in Python built in properties. Okay, 下划线将不再存在，因为它们在 Python 内置属性中。好的，
so, that's about it, I guess. So that was the operators, we will see the operators more 所以，就是这样，我想。这就是 运营商，我们将更多地看到运营商
and more later on. But before ending this video, I leave you with a question. So the 以后还会有更多。但在结束这个视频 之前，我给你留下一个问题。所以
question is, we saw the variable names like, Sum of a and b X, Y variable name can be can 问题是，我们看到了变量名，如 a 和 b 之和 X，Y 变量名可以可以
be lengthy can be descriptive can be short anyways. So the question really is, can a 可以是冗长的，可以是描述性的，也可以 是简短的。所以问题真的是，可以
variable name start with a digit? For example? Is it possible that the variable name really 变量名以数字开头？例如 ？变量名真的有可能吗
is is starts from the variable name starts from for example, a digit? is a 3x? valid 是从变量名开始，例如从一个 数字开始？是 3x 吗？有效的
variable name? Or, for example, at the rate of at the rate of Why is that a variable name? 变量名？或者，例如，在速度 为什么是一个变量名？
Or, for example, this symbol times two times x, is that a variable name? What are the conventions 或者，例如，这个符号乘以两次 x，这是一个变量名吗？有哪些约定
to for variable names? can we can we write anything? In the left hand side? The right to 变量名？我们可以写点 什么吗？在左边？正确的
let's say 3x? Is equal to four? That means 3x is now a variable name. Is that true in 让我们说3倍？等于四吗？这意味着 3x 现在是一个变量名。这是真的吗
Python? Or are there conventions to define the variable names? So? Python？或者是否有定义变量名称 的约定？所以？
Yeah, think about it. See you in the next video with the answer to this. So I hope you 是的，考虑一下。在下一个视频中与 您一起回答这个问题。所以我希望你
will, you will be having answer for this question. Hope to see you in the next video. Okay, so 会，你将得到这个问题的答案。希望在下 一个视频中见到你。可以，然后呢
in the last video, I asked you a question about the naming convention of the odd variable 在上一个视频中，我问了你一 个关于奇数变量命名约定的问题
names. In particular, I asked you whether 3x is a proper variable name or not in Python? 名称。特别是，我问你 3x 在 Python 中是否是一个适当的变量名？
So what's your answer? Yeah. What do you think? How many of say, how many of you say no? How 那么你的答案是什么？是的。你怎么认为 ？有多少人说，有多少人说不？如何
many of you say yes? Well, by the way, you might have tried that, declaring that variable 你们很多人说是吗？好吧，顺便说一 句，您可能已经尝试过，声明该变量
name and Jupyter Notebook, and then you might have got this answer one of these? Well, name 和 Jupyter Notebook，然后您可能已经 得到了以下答案之一？好，
let me tell you, the answer is no. A variable cannot start with a digit. Not with, not with, 让我告诉你，答案是否定的。变量 不能以数字开头。不与，不与，
at the rate of not with hash symbol, not with I mean, there are several 以不带哈希符号的速度，不带我的 意思是，有几个
other special characters are not there except a few factors. One of those is underscore. 除了一些因素外，其他特殊字符都 不存在。其中之一是下划线。
Let's go to let's go to Jupyter Notebook and and check this. So, for example, 3x equals 让我们去看看 Jupyter Notebook 并检查 一下。因此，例如，3x 等于
five error, invalid syntax, let's say activate of y equals four. Invalid star d equals four 五个错误，无效的语法，假设 y 的 激活等于 4。无效星 d 等于四
error. Well, an exception is underscore underscore E equals six, that's allowed. Starting a variable 错误。嗯，一个例外是下划线下划线 E 等于 6，这是允许的。启动变量
name with underscore is allowed, it is different than the underscore that is built in underscore 允许带下划线的名称，它不同于 下划线内置的下划线
this underscore E is different than simply underscore. So it is good to not declare the 这个下划线 E 与简单的下划线 不同。所以最好不要申报
variable names that start from these because you will be getting errors further. variable 从这些开始的变量名称，因为 您将进一步得到错误。多变的
names should be descriptive. They should give you a look and feel of the data what they 名称应该是描述性的。他们应该 给你一个数据的外观和感觉
are containing and you're free to define variable names, as as descriptive as you want. So it 包含，您可以自由定义变量 名称，如您所愿。所以
is a good practice to, to start writing the variable names in a better way. One, one better 是一个很好的做法，以更好的方式 开始编写变量名称。一，一个更好
notation, one better notation of defining these variable names, even the function names, 表示法，一种更好的定义这些变量 名的表示法，甚至是函数名，
we will see the functions later on. One way to defining those is to use camel notation. 我们稍后会看到这些功能。定义这些 的一种方法是使用骆驼符号。
camel notation camel notation is you start with the variable name with for example, lowercase 骆驼表示法 骆驼表示法是 以变量名开头，例如，小写
letters, let's say your variable is starting time of the course. Let's say that's your 字母，假设您的变量是课程的开始 时间。让我们说那是你的
variable name. So you write starting, that's one word finishes, then the next word should 变量名。所以你写开始，一个 字写完，然后下一个字应该
start from capital T, starting time of the course, let's say. So this kind of notation 从大写T开始，课程开始时间 ，比方说。所以这种记法
is called camel notation. And very famous, particularly the Java developers, they normally 称为骆驼符号。非常有名，尤其是 Java 开发人员，他们通常
follow this and several other developers. But you should come up with a notation that 按照这个和其他几个开发人员 。但是你应该想出一个符号
is one notation, there are other ways of keeping consistently keeping the consistent strategy 是一种表示法，还有其他方法 可以保持一致的策略
of defining variables. There are several other ways this is one way. So starting time of 定义变量。还有其他几种方式，这 是一种方式。所以开始时间
the course is let's say 2.0. That's it. So that's a variable name, if you if you now 课程是让我们说 2.0。就是这样。所以 这是一个变量名，如果你现在
check, that's a variable name. But now, if you see this variable, just just the name 检查，这是一个变量名。但是现在， 如果你看到这个变量，只是名字
suggests the data inside is doing what? So the names should be descriptive, I mean, and 提示里面的数据是做什么的？所以名字 应该是描述性的，我的意思是，
make that as a habit. So, yeah, I guess we have now answered our question very concretely, 让它成为一种习惯。所以，是的，我想我们 现在已经非常具体地回答了我们的问题，
that variable name cannot start with a digit not with any special character other than 变量名不能以数字开头，不 能以任何特殊字符开头
underscore, okay. In the next video, I will be introducing comparisons with with variables. 下划线，好吧。在下一个视频 中，我将介绍与变量的比较。
For example, what if you want to compare whether one variable is smaller than the other or 例如，如果您想比较一个变量 是否小于另一个变量或
not? What if you want to compare whether the two variables they are containing values they 不是？如果您想比较它们所包含的两个 变量是否包含它们的值，该怎么办？
are same or not? What if you want to do comparisons of the of the data that is stored inside the 是否相同？如果您想对存储在内部的 数据进行比较，该怎么办？
variables, and based on the result of the comparison, you want to do something else. 变量，并根据比较的结果 ，您想做其他事情。
So in the next video, we will see a bool data type that is very, very famous, and it is 所以在接下来的视频中，我们将看到一个 非常非常有名的 bool 数据类型，它是
used in a lot in decision making. And we will see the comparison operator sometimes called 在决策中大量使用。我们将 看到有时称为比较运算符
the relational operators in the next video, so hope to see you in the next video. Okay, 下一个视频中的关系运算符，所以希望 在下一个视频中见到你。好的，
in this video, we are going to talk about a data type which is called bool. That's very, 在本视频中，我们将讨论一种 称为 bool 的数据类型。那很，
very famous data type. Actually, it's the most famous data type because it is used in 非常有名的数据类型。实际上，它 是最著名的数据类型，因为它用于
decision making all the control flow most of the controls, so depends on this data type. 决策制定所有控制流的大部分 控制，因此取决于此数据类型。
Although it is very, very famous, very much applicable data type, it is very simple. It 虽然是非常非常有名，非常适用 的数据类型，但是非常简单。它
is a data type with just two states with just two values. By the way, there are capacities 是只有两个状态和两个值的数据 类型。顺便说一句，有能力
of different data types. For example, in T integer, the 不同的数据类型。例如，在 T 整数 中，
different kinds of values that you can store are huge, you can store any negative number 您可以存储的不同类型的值是巨大 的，您可以存储任何负数
in it, you can store zero, you can store any positive number, the capacity of floating 在里面，可以存储零，可以存储 任意正数，浮动的容量
point number or the number of values that it can save is is even higher than even higher 点数或它可以保存的 值的数量甚至更高
than integer and the complex number is even higher than that and so on. But the bool data 比整数和复数甚至更高等 等。但是布尔数据
type, it has just two states one state is true. It has just two values. True is a value. 类型，它只有两种状态，一种状态为 真。它只有两个值。 True 是一个值。
And false is a value just these two straights true or false. In some programming languages, 而 false 是一个值，只是这两条直线是 true 或 false。在一些编程语言中，
the true is denoted by one, and the false is denoted by zero. But in Python, the true 真用一表示，假用零表示 。但在 Python 中，真正的
is just t ru e true that thing and false is false. That's it. If you For example, define 是真的那件事和假是假的。就 是这样。如果你例如，定义
a variable let's say any variable name, whatever the name is, let's say B and you assign true 一个变量让我们说任何变量名称，无论名称 是什么，让我们说 B 并且您分配 true
then it's its default data type will become bool. And if you have another variable, let's 那么它的默认数据类型将变为 bool。 如果你有另一个变量，让我们
see which is false. Then C is also bool. One thing that is important, there are other operations 看看哪个是假的。那么 C 也是布尔值 。一件事很重要，还有其他操作
other than arithmetic operators that we saw, adding subtraction division and stuff, there 除了我们看到的算术运算符，加上 减法除法和其他东西，还有
are other operators that we can apply on bool datatype. For example, a true and and is a 是我们可以应用于 bool 数据类型的其他 运算符。例如，一个 true and 是一个
keyword combining true and true. If if there is a variable, let's say a with a There is 结合 true 和 true 的关键字。如果有 一个变量，让我们说一个有一个
a boolean variable a with data true. If there is a boolean variable b with data true, then 数据为真的布尔变量 a。如果有一 个布尔变量 b 的数据为真，则
a and b is also true. So let's say I've used this variable D, in storing this A and B, a 和 b 也是如此。假设我使用了这个 变量 D 来存储这个 A 和 B，
the D will also be true. So true and true is always true. Further true and false, this D 也将是真的。所以真实和真实 总是真实的。进一步真假，这
is always false. And this is committed if for example, true and true is true, true and 总是假的。如果例如，true and true 是 true，true and
false is false, false and true is false, false and false is false. So, if you apply an operator 假是假，假是真，假是假，假是假 。所以，如果你申请一个运营商
and keyword to combine the two Boolean variables together, if both are true, then and will and 关键字将两个布尔变量组合在一起 ，如果两者都为真，则 and will
result a true otherwise and will result of false other than this and there are there 否则结果为真，除此之外 的结果为假，并且有
is there is another, there is another operator, keyword or so, this results false. If both 是否还有另一个，还有另一个运算符、 关键字等，结果为 false。如果两者
are false, false, false, false or false is false. If any one of these is true, then the 是假的，假的，假的，假的，假的或假的 是假的。如果其中任何一项为真，那么
result is true. Remember the difference between n and R and will result false if any one of 结果是真的。记住 n 和 R 之间的差异， 如果其中任何一个都将导致错误
the two operands at least one of the two operands is false, 两个操作数至少两个操作数之一为 假，
then the result is false. If both are or are anvisa true, if both of the operands are true, 那么结果是假的。如果两者都是或都 是 anvisa 真，如果两个操作数都为真，
otherwise it is false 否则是假的
or will result false if both of the options is false or false. Otherwise it is true. So, 如果两个选项都为 false 或 false，则结果 为 false。否则就是真的。所以，
you now know and you now know are there is another operator called not. This is not so 你现在知道了，你现在知道还有一 个叫 not 的运营商。这不是这样
not for example, returns not true. Results false and not false. returns true. Great. not 例如，返回不正确。结果假而 不假。返回真。伟大的。
So knot is a unary operator. unary means it just takes it just takes one variable and 所以结是一元运算符。一元意味 着它只需要它只需要一个变量
operate on that, and is a binary operator like plus is a binary operator. It takes two 对其进行操作，并且是一个二元运算符 ，就像 plus 是一个二元运算符。需要两个
variables to operate on, or is a binary operator it operate, it takes two operators, it takes 要操作的变量，或者是它操作的二元运算 符，它需要两个运算符，它需要
two variables to operate on and so on. So remember, remember these things, one, and 要操作的两个变量，依此类推。 所以记住，记住这些事情，一，
we'll return true if both of the variables are true, otherwise the result is false, or 如果两个变量都为真，我们将 返回真，否则结果为假，或
will result false. If both are false. Otherwise, it will return true and not is not just flips 将导致错误。如果两者都是假的。否则 ，它将返回 true 而不仅仅是翻转
the the state. So not true means false, not false means true. So these are basic, that's 状态。所以不真就是假，不假就是 真。所以这些是基本的，那就是
how you can combine the Boolean variables together. In the next video, we will be seeing 如何将布尔变量组合在一起。 在下一个视频中，我们将看到
how to apply these comparison operators and the result will be Boolean types. And how 如何应用这些比较运算符， 结果将是布尔类型。如何
can we combine the Boolean types together to to build a better decision making. So in 我们能否将布尔类型组合在一起 以构建更好的决策。所以在
this particular video, I just, I just introduced the boolean data type for you with you. In 这个特定的视频，我只是，我刚刚 为您介绍了布尔数据类型。在
the next video, we will see where the boolean data type actually appears, and how it impacts 下一个视频，我们将看到布尔数据类型 实际出现的位置，以及它如何影响
our, our our programming style or thinking style or coding style. So hope to see you 我们的，我们的编程风格或思维风格 或编码风格。所以希望见到你
in the next video with comparison operators that actually produces the Boolean variables. 在下一个视频中使用实际生成 布尔变量的比较运算符。
Hope to see you in the next video. Okay, in the last video, I discussed boolean data type 希望在下一个视频中见到你。好的，在 上一个视频中，我讨论了布尔数据类型
and I discussed that a boolean variable takes either a true or a false and we can combine 我讨论了一个布尔变量要么是 真要么是假，我们可以结合
these Boolean variables together with and our operators. And then we can apply a knot 这些布尔变量与我们的运算符 一起。然后我们可以打一个结
operator on a particular variable. And we we saw that a true and true returns true and 特定变量的运算符。我们 看到一个真和真返回真和
and otherwise it also returns false. Similarly false or false is false. Otherwise, or always 否则它也返回false。同样假或 假是假的。否则，或总是
returns of a true before before actually discussing these comparison operators. Let's do let's 在实际讨论这些比较运算符之前 返回真值。让我们做吧
just go to Jupiter and just just play with a boolean data type. Just Just for just for 只需转到 Jupiter 并使用布尔 数据类型即可。只为只为
a moment. Let us just convert this to markdown cell and just cried. Both that's a word Boolean 片刻。让我们将其转换为降价单元格 ，然后就哭了。这两个词都是布尔值
variable. So let's say A is true and B is true and C is false. False. And okay, so these 多变的。所以假设A是真的，B是真的 ，C是假的。错误的。好吧，所以这些
are variables. Let's press those to see what are the states of. So, a is a boolean variable 是变量。让我们按这些来看看它们 的状态。所以，a 是一个布尔变量
with value true B is a boolean variable with value true C is a boolean variable with value 值为真 B 是值为真的布尔变量 C 是值为真的布尔变量
false. So, now it is true B is true, C is false. So that means, let me print print a 错误的。所以，现在是真的 B 是真的，C 是 假的。所以这意味着，让我打印打印一个
and b, what do you think? What is what will be the result? Let me print a and see what b，你怎么看？会是什么结果 ？让我打印一个看看是什么
will be the result. And let me Brent? C and A. So because a and b both are true, the first 将是结果。让我布伦特？ C 和 A。 所以因为 a 和 b 都是真的，第一个
result will be true, because C is false, false, true and true is true. The the other two statements 结果会是真的，因为C是假的，假的 ，真的，真的是真的。另外两个声明
they will result false. So first value will be true, then false false. So yes, true, false 他们将导致错误。所以第一个值将是真 ，然后是假假。所以是的，真的，假的
false. Let's, let's check the or print. And by the way, let's store that are in another 错误的。让我们检查或打印。顺便 说一句，让我们将其存储在另一个
variable, let's say A is true, or C is false. So what do you think what will be the result 变量，假设 A 为真，或 C 为假 。所以你觉得结果会怎样
here, because or gives false when both are false, here is true. So the value of d will 在这里，因为 or 当两者都为假时给 出假，这里为真。所以 d 的值将
be true 是真实的
for the not a, because A is true, not a will be false. Similarly, not B, B is true. So 对于非a，因为a为真，非a必为假。 同样，不是B，B是真的。所以
not B will be false. Not C, C is true, C is false, and not c will be true. Similarly, 不是B会是假的。不是 C，C 是真的，C 是 假的，而不是 C 会是真的。相似地，
not D, we can save the result in another variable, let's say D. and we can just check the type 不是 D，我们可以将结果保存在另一个变量 中，比如说 D。我们可以检查类型
of D if we want, that's a Boolean, we can also check the value inside D and that is D 如果我们想要，那是一个布尔值， 我们也可以检查 D 中的值，那就是
false. So, yes, not only that, I mean, we can we can we can we can combine at a higher 错误的。所以，是的，不仅如此，我的意思是，我们 可以我们可以我们可以我们可以在更高的水平上结合
level for example, A and A and B, whatever the result is, or C or D, whatever the result 例如，A 和 A 和 B，无论结果如何 ，或 C 或 D，无论结果如何
is, and whatever the result is not of that. I mean, we can we can combine them in a very 是，无论结果如何都不是。我的意思 是，我们可以将它们组合在一个非常
complicated way. If we want a and b the result will be some Boolean, that Boolean and that 复杂的方式。如果我们想要 a 和 b 结果将 是一些布尔值，那个布尔值和那个
Boolean there 布尔那里
are the 是
result eventually will be a Boolean, and then not have that. So let's check what if that 结果最终将是一个布尔值，然后没有 那个。所以让我们检查一下
is the result is false, well, why the result is false. figured out why the result is false, 结果是假的，好吧，为什么结果是 假的。找出为什么结果是假的，
let me go to comparison operators. So, the comparison operators, let me just go through 让我去比较运算符。所以， 比较运算符，让我来看看
comparison operators. This equal equal to it compares whether two variables whether 比较运算符。 this equal to it 比较两个变量是否
whatever the variables are whether they are integer floating point, whatever, whether 无论变量是什么，它们是否是整数 浮点数，无论如何，是否
two variables are are, they have same data or not, for example, x equals equals two y. 两个变量是，它们是否具有相同 的数据，例如，x 等于两个 y。
That will be true if x and y, they both have same data. So for example, if X has value 如果 x 和 y，它们都具有相同的数据， 那将是正确的。例如，如果 X 有值
four, and y has value four, then we are just checking x equals equal to buy or not, the 4，并且 y 的值为 4，那么我们只是 检查 x 是否等于购买或不购买，
result will be Boolean. Because an X may not be a boolean variable y may not be a boolean 结果将是布尔值。因为 X 可能不 是布尔变量 y 可能不是布尔变量
variable. If we want to compare the values of x and y, then we write w equal without 多变的。如果我们想比较 x 和 y 的 值，那么我们写 w 等于而不是
a space inside. Remember, if we write single equal that will be an assignment operator. 里面的一个空间。请记住，如果我们编写 单个相等，那将是一个赋值运算符。
If we write w equal that means we are checking whether the two values are same or not. Similarly, 如果我们写 w 相等，则意味着我们 正在检查两个值是否相同。相似地，
if we write this particular symbol that checks whether two values are not equal or not, for 如果我们写这个特殊的符号来检查 两个值是否不相等，对于
example, x is not equal to y, the result will be true if x and why they both have different 例如，x 不等于 y，如果 x 以及为什么 它们都不同，则结果将为真
values, otherwise the result will be false. Remember, the result of comparison is always 值，否则结果为假。记住 ，比较的结果总是
a Boolean, it is either true or false. Okay, next we check whether less than So for example, 一个布尔值，它是真或假。好的， 接下来我们检查是否小于 So 例如，
if x is less than y, the result will be true. If x indeed has a value that is smaller than 如果 x 小于 y，则结果为真 。如果 x 的值确实小于
y, let's say x is two and y is 10. In that case, the result will be a true otherwise y，假设 x 是 2，y 是 10。在这种 情况下，结果将为真，否则
the result will be false. Similarly, we can compare the two variables using greater than 结果将是错误的。同样 ，我们可以使用大于
we can compare the two variables by less or whether whether the whether one variable less 我们可以通过less比较两个变量 或者是否一个变量小于
or equal to the other. For example, if X is less or equal to y, the result will be true 或等于另一个。例如，如果 X 小于 或等于 y，则结果将为真
of this comparison the result will be true if X has a value that is not larger than why 如果 X 的值不大于原因， 则此比较的结果将为真
as long as x and y are equal or x is smaller than y In any case, the result will be true 只要 x 和 y 相等或 x 小于 y 无论如何，结果将为真
otherwise false. Similarly, greater than or equal to. Okay, so I end this video here in 否则为假。同样，大于或等于。好 的，所以我在这里结束这个视频
the next video, we will be, we will be moving to Jupiter and playing with these operators, 下一个视频，我们将搬到木星 并与这些运营商一起玩，
and seeing the return types of Booleans. And then combining them together with ands and 并查看布尔值的返回类型。然后 将它们与 ands 组合在一起
ORS and doing doing interesting stuff with that. In this particular video, I just talk ORS 并用它做有趣的事情。在这个 特别的视频中，我只是说说
about the comparison operators, the boolean data type and combining them by and or not. 关于比较运算符、布尔数据类型 以及通过和或不组合它们。
In the next video, we'll be first moving to Jupiter, we will see the comparison operators, 在下一个视频中，我们将首先移至 Jupiter，我们将看到比较运算符，
we will write all these statements in Jupiter and just get a good hands on grip on that. 我们将在 Jupiter 中编写所有这些 语句，然后好好掌握它。
And then we'll be moving on verse. So hope to see you in the next video. So in the last 然后我们将继续进行诗歌。所以希望 在下一个视频中见到你。所以在最后
video, I talked about comparisons, w equal to not equal to less than, greater than, less 视频，我讲的是比较，w等于 不等于小于，大于，小于
than or equal to, greater than or equal to. So let's go to Jupyter Notebook and see how 大于或等于，大于或等于。所以 让我们去 Jupyter Notebook 看看如何
they actually work. So let me just first enter a markdown cell and type comparisons. Shift 他们实际上工作。所以让我先输入一个 Markdown 单元格并输入比较。转移
Enter comparisons. So we can we can compare different values by first assigning them to 输入比较。所以我们可以通过首先 将它们分配给不同的值来比较它们
variables. And then comparing those variables or we can we can compare the values directly 变量。然后比较这些变量，或者 我们可以直接比较这些值
or for example, rent. Two is less than three. What do you think two is lesson three, the 或例如，租金。二小于三。 你认为第二课是第三课，
result will be what Remember, the result of a comparison operator is always Boolean, it result will be what 记住，比较运算符 的结果总是布尔值，它
is either true or false. So in this case two is smaller than three. So the result will 是真的还是假的。所以在这种情况 下，二小于三。所以结果会
because this statement is true. So the result will be true and true will be counted. Further, 因为这个说法是正确的。所以结果将 是真实的，真实的将被计数。更远，
we can store that result in in another variable for example to is smaller than three, whatever 我们可以将结果存储在另一个变量 中，例如 to 小于三，无论
the result is, the result will be true, the result will be saved in a variable, see, if 结果是，结果为真，结果将保存 在一个变量中，看看，如果
we check the type of see 我们检查看到的类型
reject the type of seeing as long as let's print the value of C. So you can see the type 拒绝看到的类型，只要让我们打印 C 的值。这样你就可以看到类型
of C is Boolean, and C in this particular case is true. Moreover, for example, let's of C 是布尔值，在这种特殊情况下 ，C 为真。此外，例如，让我们
have three equals to four. Is that true or false? What do you think three equals to four, 三等于四。这是真的还是 假的？你认为三等于四，
three, w equals to four, that is false, three is not equal to four. And let's save this 三、w等于四，即为假，三不 等于四。让我们保存这个
result in D, remember three double equals to four, that's an operation the result is 结果在 D 中，记住三个 double 等于 4，这是一个运算结果是
false. This equal is an assignment operator that the false value will be assigned to the 错误的。这个等于是一个赋值 运算符，假值将被分配给
variable D. and here we can see Brent D. Burn it is false. Similarly, what do you think? 变量 D. 在这里我们可以看到 Brent D. Burn 它是假的。同样，你怎么看？
Three double equal to 3.0? What will be the result? Remember, three is integer. 3.0 is 三双等于3.0？结果会怎样？ 请记住，三是整数。 3.0 是
a floating point number. And I'm comparing three double equals to 3.01 is integer, and 一个浮点数。我正在比较三个 double 等于 3.01 是整数，并且
other is a floating point number. So what will be the result? Let's say the result is 另一个是浮点数。那么结果 会怎样呢？假设结果是
true, because they are comparing the values by discarding the decimal position. Further, true，因为它们通过丢弃小 数位来比较值。更远，
let's see. Three is smaller or equal to so let's say x is equal to four, y is equal to 让我们来看看。三小于或等于 所以假设 x 等于四，y 等于
nine. And z is equal to let's say 8.3. And r is equal to minus three, let's say and these 九。 z 等于 8.3。并且 r 等于 负三，让我们说这些
are our variables. Let's see. So what do you think what will be the result here x is smaller 是我们的变量。让我们来看看。那么 你认为这里 x 较小的结果是什么
than y. What will be the result of that x is smaller than y, the result will be true 比y。 x 小于 y 的结果 是什么，结果为真
and z is smaller than z is smaller than y. The result is again true because the smaller z 小于 z 小于 y。结果 再次成立，因为越小
than y or r r is r is equal to for example, x. So what do you think what will be the result 比 y 或 r r 是 r 等于例如 x。 所以你觉得结果会怎样
at the end after this, so, let's see first first this will be true, this will be again 在这之后的最后，所以，让我们先 看看这将是真的，这将再次发生
true, and that is false. Okay. So, this true and true will return true and true or anything, 真的，那是假的。好的。所以，这个 true and true 将返回 true and true 或任何东西，
the result final result is true. So, this will return or it's returning true. But, if 结果最终结果为真。因此，这将 返回或返回 true。但是，如果
I just do if I just switch the order, for example, if I just write this statement, which 我只是如果我只是切换顺序，例如 ，如果我只是写这个语句，其中
is false, this particular statement here and then I do this, what will be the result now, 是错误的，这里的这个特殊陈述然后 我这样做了，现在会是什么结果，
Now see, x is smaller than y it is true, r is equal to x that is false. So, this result 现在看，x 小于 y 是真的，r 等于 x 是假的。所以，这个结果
will be false eventually, and z is smaller than y, that result is z is smaller than y, 最终将是假的，并且 z 小于 y，结果是 z 小于 y，
let me just say z is larger than one, let me just check z is larger than y, z is larger 让我说 z 大于 1，让我检查 z 是否大于 y，z 是否更大
than I just just do just to tell you. So, this is true, this is false. Both of these 比我只是为了告诉你而已。所以 ，这是真的，这是假的。这两个
are let me let me switch the let me switch the listing r equals to x, I just want to 让我让我切换让我切换 列表 r 等于 x，我只想
show you the precedents of r and x is smaller than y. So now, if you see this is false, 向您展示 r 和 x 小于 y 的先例。所以 现在，如果你看到这是假的，
this is true, false and true is true, true or false and true is false, this is also false. 这是真的，假的和真的是真的，真的 是假的，真的是假的，这也是假的。
And the result overall is false. It should happen, but what if, what if this goes first, 结果总体上是错误的。它应该发生 ，但是如果，如果这首先发生呢，
if this goes first, I mean, I want to show you whether and an AR, which one of them will 如果先这样，我的意思是，我想告诉 你是否和 AR，他们中的哪一个会
operate first. So, in this particular case, the result is false, but it can happen let 先操作。所以，在这种特殊情况下， 结果是错误的，但它可能发生让
me let me tell you this in more and two, or false and true or false. And 我让我告诉你更多和两个，或假和 真或假。和
true, 真的，
what do you think what will be the result here, true or false and true, if true or false 你觉得这里的结果会是什么，是 真的还是假的，是真的还是假的
operate operate First, if true or false operate First, the result will be true, true and true, 操作先操作，如果真或假操作 先，结果为真，真假，
the result is true. If however, let me let me just write a false here. If all operates 结果是真的。但是，如果让我在这里 写一个假的话。如果所有操作
First, if all operates first, then false or false is false and false and true is the result 首先，如果所有的都先操作，那么false 或false就是false，false和true就是结果
eventually is false. And if and operates first, then false and true is false, false or false 最终是假的。如果和先操作，那么 false and true就是false，false or false
the result in both cases here is is false. So, a better way of representing these kind 在这两种情况下的结果都是错误的。 所以，一种更好的方式来表示这些
of sometimes sometimes they can make confusions, sometimes they can make confusions, for example, 有时有时他们会混淆，有时 他们会混淆，例如，
if we have a true here, if you have a false here for example, false and true 如果我们在这里有一个真，如果你在这里 有一个假，例如，假和真
How can I so, false, false and false or true. So, in this case, if in this case, if false 我怎么会这样，假的，假的，假的还是真的。所以 ，在这种情况下，如果在这种情况下，如果假
or true that operate First, the result will be true and false and false, false and true or true那个操作 首先，结果 会是真假假假假真
the result will eventually be false. However, if n operates First, the result will be false 结果最终会是假的。但是，如果 n 操作 First，结果将是 false
here, false or true the result will be true. So, here if and applies if you apply if n 在这里， false 或 true 结果将是 true。所以 ，这里 if and apply if you apply if n
is applied first, then the result overall result will be true. But if all is applied 首先应用，然后结果整体结果 将是真实的。但如果全部应用
first, then the overall result will be false. So it is it is good to know whether and will 首先，那么总体结果将是错误的 。所以很高兴知道是否和将会
be applied first or off will be applied first in this particular case and will be applied 在这种特殊情况下首先应用或 关闭将首先应用并将应用
first even if you even if you change this even if you change this order for example, 首先即使你即使你改变这个即使 你改变这个顺序，例如，
if you even if you pick this thing and apply here still the result is and will be applied 如果你即使你选择这个东西并在 这里申请，结果仍然并将被应用
first and or will be applied after, it is always good rather than to one way is to remember 首先或将在之后应用，这总是 好的，而不是一种方法是记住
the precedents and will be applied first then or, I mean it is good to think about the precedents. 先例，然后将首先应用，或者 ，我的意思是考虑先例是好的。
Another good thing is to specify the order using parentheses. For example, now, we specify 另一个好处是使用括号指定 顺序。例如，现在，我们指定
this first our will be applied and then four and will be applied. So, it is good for readability 这首先我们将被应用，然后四个 并将被应用。所以，它有利于可读性
to always apply these parentheses and and check the order in which ands and ORS and 始终应用这些括号并 检查 ands 和 ORS 和
the combination will be applied. So, the in any way the result of these comparisons will 将应用组合。因此，无论 如何，这些比较的结果将
be bullions. Question, what will be the result here? So, not to not equal to three and true 成为金条。问题，这里会有什么结果 ？所以，不至于不等于三且为真
or false and true. See this slide for a while. Even if you want to pause the video, pause 或假与真。看一会儿这张幻灯片 。即使你想暂停视频，暂停
the video, see it? and answer the Brent will return true or false. okay with this question, 视频，看到了吗？并回答 Brent 将 返回 true 或 false。这个问题好
I end this video. In this particular video, we just saw the comparisons on Jupyter Notebook. 我结束这个视频。在这个特定的视频中， 我们刚刚看到了 Jupyter Notebook 上的比较。
Just see how the comparisons return true or true or false. We combine the different tools 看看比较如何返回真、真或 假。我们结合了不同的工具
and different Boolean values using ands and ORS. And here is a question for you. Okay, 以及使用 ands 和 ORS 的不同布尔值。 这里有一个问题要问你。好的，
I will see you in the next video with answer of this question. So I left you with a question 我将在下一个视频中看到你回​​答 这个问题。所以我给你留下了一个问题
in the last video. So that was the question if you remember. So the question really was, 在最后一个视频中。所以这就是你 是否记得的问题。所以问题是，
what's the what's the result here? So what's your answer? True or false? The result, either 这是什么结果？那么你的答案 是什么？对或错？结果，要么
will be true or false, because these are all comparisons and combination of Boolean values. 将是 true 或 false，因为这些 都是布尔值的比较和组合。
So let's see step by step. First of all, let's see this two is not equal to three The result 所以让我们一步一步来看看。首先让 我们看看这两个不等于三个的结果
is two is not equal to three Yes, it is true, two is not equal to three That's true. So 是二不等于三 是的，这是真的， 二不等于三 那是真的。所以
not true not true is false. So, this is false. So, this whole thing is false. Now false and 不是真的不是真的是假的。所以，这是错误的 。所以，这整件事都是假的。现在是假的和
true false and true that is false. So, this whole thing here till here is false. Now we 真假真假。所以，直到这里的 整个事情都是假的。现在我们
have or or and then we have false and true false and true is false. So, this whole thing have or or then we have false and true false and true is false. have or or then we have false and true false and true is false.所以，这整件事
is false this whole thing is false and or between false or false it is false. So the 是假的，这整件事都是假的，或者 介于假或假之间，它是假的。所以
result of this. So the So the answer to this question is is false. Let me let me just convince 这样做的结果。所以这个问题 的答案是错误的。让我让我说服
you by typing the statement in in Jupyter Notebook. So, if you remember we have Brent. 您可以在 Jupyter Notebook 中输入语句 。所以，如果你记得我们有布伦特。
Brent, not two is not equal to three and then we were having I guess and false and yeah, 布伦特，不是二不等于三然后 我们有我猜和假的，是的，
that was a different one. And true, sorry, that was and true. So this was and true, then 那是另一回事。真的，对不起， 那是真的。所以这是真的，然后
we were having our 我们有我们的
and then we were having these false and true. So the front ends here and the result is Oh, 然后我们有这些虚假和真实。所以 前端到这里，结果是哦，
I have some I have some parenthesis mismatch. So not true and this okay, I should have this 我有一些我有一些括号不匹配。所以 不是真的，这没关系，我应该有这个
one I guess this goes to there and this goes to there and I guess Yes. So the result is 一个我想这去那里，这去那里 ，我想是的。所以结果是
false. The result is false. The purpose of this question was not just to the purpose 错误的。结果是假的。这个问题 的目的不仅仅是为了这个目的
of this question is to appreciate actually the fact how we can combine different Boolean 这个问题实际上是为了欣赏 我们如何组合不同的布尔值
values to to to achieve the final boolean value and these kind of combinations will 值到以实现最终的布尔值 ，这些类型的组合将
become very, very helpful further in in control flow and we will see the if conditions and 在控制流程中变得非常非常有帮助 ，我们将看到 if 条件和
decision making and stuff so The answer to this question is false. Yeah, and I end this 决策和东西所以这个问题的答案是 错误的。是的，我结束了这一切
video here. In the next video, we are going to see some useful functions of Python. And 视频在这里。在下一个视频中，我们 将看到 Python 的一些有用功能。和
after seeing the some some kind of useful, there are a lot of functions, we will see 看到一些有用的，有很多 功能后，我们会看到
just a few of them very useful of them. And after seeing those functions, then we will 只是其中一些非常有用。看到 这些功能之后，我们就会
directly jump to control flow basically the if conditions and stuff where you will see 直接跳转到控制流基本上是 if条件和你会看到的东西
these comparisons, these Boolean values in a much more applicable sense, then then earlier. 这些比较，这些布尔值在更 适用的意义上，然后更早。
So hope to see you in the next video. Okay, so let's have a very quick tour over some 所以希望在下一个视频中见到你 。好的，让我们快速浏览一下
some useful functions in Python. Obviously, there are a lot of functions in Python, but Python 中的一些有用函数。显然 ，Python中有很多函数，但是
I will be covering just a few of them. That I think with the passage of time, we will 我将只介绍其中的几个。我认为 随着时间的推移，我们会
be covering more and more but let's start a function are sometimes, particularly a built 覆盖越来越多但让我们开始一 个功能有时，特别是一个内置的
in function is is basically a feature from the language that is supplied for the users in function is 基本上是为用户 提供的语言的一个功能
to achieve particular task. For example, around function. If you give round for example, around, 来完成特定的任务。例如，围绕功能 。例如，如果你给圆，围绕，
let's say 4.6. This 4.6 is a floating point number, and rounding means make it as integer. 让我们说 4.6。这个 4.6 是一个浮点数 ，四舍五入意味着把它变成整数。
And what round does is it finds the nearest integer to 4.6. And the nearest integer in 而 round 的作用是找到最接近 4.6 的整数。和最接近的整数
this case is five, because five is more closer to 4.6, then four. However, if you call round, 这种情况是五，因为五更接近于 4.6， 然后是四。但是，如果你打电话，
for example, on four point, let's say three, then the result will be four, because four 例如，在四点上，假设是三， 那么结果将是四，因为四
is more closer to 4.3, than five. So that's one use of round eight rounds, basically rounds 比 5 更接近 4.3。所以这是八 轮的一种用途，基本上是轮
a floating point number to the nearest integer. Another use of round is if you give another 一个浮点数到最接近的整数。轮的 另一个用途是如果你给另一个
argument that that is called an argument to the function. For example, when you write 被称为函数的参数的参数 。例如，当你写
Brent. Brent, let's say a, this a is called argument to a function Brent. Similarly, round 布伦特。 Brent，比方说a，这个a 被 称为函数Brent 的参数。同样，圆
is a function 4.6 is an argument round is function 4.3 is an argument, we will see functions 是一个函数 4.6 是一个参数 round 是 函数 4.3 是一个参数，我们将看到函数
in details, and we will be writing our own functions as well. But for now, just just 详细，我们也将编写我们自己 的函数。但现在，只是
bear that just bear with me that functions are these kinds of features that are available. 请耐心等待，功能就 是这些可用的功能。
However, we we will be writing our own functions later on. So this particular function accepts 但是，我们稍后将编写自己的函数 。所以这个特定的函数接受
two arguments surround has two different kind of implementation. One is when it accepts 两个参数环绕有两种不同 的实现。一是当它接受
only one input argument, it returns the nearest integer to that, if it accepts a floating 只有一个输入参数，它返回最接近的 整数，如果它接受一个浮点数
point number as well as another argument like here we have three, that means after after 点数以及像这里这样的另一个参数 我们有三个，这意味着在之后
point, after decimal, go to three places only, and then round up, then round, for example, 点，小数点后，只到三位，然后 向上舍入，然后舍入，例如，
this 4.55 and then eight will be rounded based on its next value. If the next value is larger 这个 4.55 然后是 8 将根据它的下一 个值四舍五入。如果下一个值更大
than five, then eight will go to nine and stop. If the next value is smaller than five, 比五，然后八会去九停止 。如果下一个值小于五，
then it will stay as eight and the result will be three decimal places after this. So 然后它将保持为八，并且结果将 在此之后保留三位小数。所以
let's practice this round function just on a Jupyter Notebook very quickly. Let's see. 让我们在 Jupyter Notebook 上快速练习 此轮函数。让我们来看看。
So here we are. So let's see rent around, let's say 4.556. And in this case, the result 所以我们来了。所以让我们看看租金 ，比方说 4.556。在这种情况下，结果
will be 4.5. And the reason is 4.5. And it's rounded up, it stays to five and the reason 将是 4.5。原因是4.5。它被四舍五 入，它保持为 5 和原因
is this 4.556, it is more closer to five then 这是 4.556，它更接近 5 然后
than four. However, if you if you just print round, four point, let's say 345. Let's see, 比四个。但是，如果你只是打印圆形 ，四点，比方说 345。让我们看看，
and the result will be for the reason is 4.345 is more closer to four. However, if you call 结果将是因为 4.345 更接近 于 4。但是，如果您调用
this round function with more than one argument, for example 4.556789 let's say or with argument, 这个圆形函数有多个参数，例如 4.556789 假设或有参数，
let's do that means the result should be only two decimal places after the after the decimal 让我们这样做意味着结果应该 在小数点后只有两位小数
point. So in this case, the result is 4.56. And the reason is, this five is rounded based 观点。所以在这种情况下，结果是 4.56。 原因是，这五个是基于四舍五入的
on the next digit and the next digit is larger than five. Hence it is rounded up. So 4.56 在下一个数字上并且下一个数字大于五 。因此它被四舍五入。所以 4.56
If however, I call this function for three Then what do you think what will be the result 但是，如果我将这个函数称为 三个 那么你认为结果会是什么
it will be 4.55. And the six will be rounded up based on the seven, and it will become 它将是 4.55。六将在七的基础 上四舍五入，它会变成
4.557. Yes. However, if, for example, there will be a value at at the place of seven, 4.557。是的。但是，例如，如果 在 7 的位置有一个值，
if there is a value, let's say three, then you call this function, then 4.556. And then 如果有一个值，比如说三个，那么你 调用这个函数，然后是 4.556。进而
based on the next value three, the six will stay as six rather than going to nine, and 根据下一个值三，六将保持 为六而不是九，并且
the result will be 4.556. Yeah, so that's, that's the, that's the round function. Basically, 结果将是 4.556。是的，就是这样， 就是这样，这就是圆函数。基本上，
another function is diff mode, diff mode function basically divides and returns quotient, and, 另一个函数是 diff 模式，diff 模式函数 基本上是除法并返回商，并且，
and remainder. So in the next video, we will be seeing this diff mode in detail how it 和余数。所以在下一个视频中，我们 将详细了解这种差异模式是如何
actually works and how, how it is useful. So in this particular video we saw around 实际工作以及如何，如何有用。所以 在这个特定的视频中我们看到了
function in the next video, we will see diff mode, and there are a couple of more functions 在下一个视频中，我们将看到 diff 模式，还有更多的功能
that we will see in the upcoming videos. So hope to see you in the next video. So in the 我们将在接下来的视频中看到。所以 希望在下一个视频中见到你。所以在
last video, we saw round function that sometimes accepts one argument and sometimes accept 上一个视频，我们看到有时接受一个参数 有时接受一个参数的圆形函数
two arguments and behave accordingly. In this particular video, we are going to see another 两个论点并相应地采取行动。在这个 特定的视频中，我们将看到另一个
function dev mode. And it accepts two arguments, two different arguments, but maybe same or 功能开发模式。它接受两个参数，两 个不同的参数，但可能相同或
different arguments. And it it returns two outputs, two numbers, two terms basically 不同的论点。它返回两个输出 ，两个数字，两个术语
quotient and remainder. For example, in this particular case, the quotient is five, and 商和余数。例如，在这种特殊 情况下，商为 5，并且
the remainder is two, because if five is divided by if 27 is divided by five, the result is 余数是 2，因为如果 5 除以 如果 27 除以 5，结果是
five, but then the remainder is two. And the result is returned in a kind of an ordered 五，但剩下的就是二。结果 以一种有序的形式返回
pair. And these kind of collection in which we have two or more elements, we call these 一对。这些有两个或更多元素 的集合，我们称之为
collection as tupple that we will see in detail when we will see the data structures module 集合作为元组，我们将在看到 数据结构模块时详细介绍
of this course. But right now just bear with me that it returns two numbers, two elements, 本课程的。但是现在请耐心等待 它返回两个数字，两个元素，
and the two elements are ordered in an ordered pair, which is called a tupple. A tupple is 并且这两个元素在有序对中 排序，称为元组。元组是
not just an ordered pair, it can have three more three, four, or five or seven, or maybe 不只是一个有序的对，它可以有三个更多 的三个、四个、五个或七个，或者也许
several elements. But right now we will a tupple is just an ordered list, which we will 几个要素。但是现在我们将元组 只是一个有序列表，我们将
see in detail. So let's see the working of the stiff mode function in in Jupyter. notebook. 详细看。那么让我们看看 Jupyter 中 的刚性模式函数的工作原理。笔记本。
Let's see. So let's say we have dev mode. Let's say for example, we have 34. And then 让我们来看看。所以假设我们有开发 模式。比方说，我们有 34 个。然后
we have lots of them. Or maybe let's say nine, so what do you think what will be the quotient 我们有很多。或者让我们说 九，那么你认为商数是多少
and what will be the remainder. So 918 27 So three, three is the quotient. And the remainder 剩下的会是什么。所以 918 27 所以三，三是商。而剩下的
is remainder is seven. So three is quotient and salmon is the remainder. So and if you 余数是七。所以三是商，鲑鱼 是余数。所以如果你
save the result, for example, if you save the result in a variable, let's say G. So 保存结果，例如，如果你将结果保存 在一个变量中，让我们说 G。所以
if you see the G the type of G if you if you just type the type of if you just find the 如果你看到 G 的类型 G 如果你只是 输入类型 如果你只是找到
type of ci it's a tupple, which we'll see in details, and if you see the contents of ci 的类型它是一个元组，我们 将详细了解它，如果您看到
G if you see the contents of G the contents of gr three and salmon, and if you want to G如果你看到G的内容gr三和 鲑鱼的内容，如果你想
access each element independently, then you can access the element first element, because 独立访问每个元素，然后您可以 访问该元素的第一个元素，因为
the if there are multiple elements in in a variable normally that that kind of variables 如果一个变量中有多个 元素通常是那种变量
are called collections that we will see in detail later on. And these are the indexing 被称为集合，我们将在后面 详细介绍。这些是索引
the positioning is start by zero rather than one. So g zero means the first element of 定位从零开始，而不是从一开始 。所以 g 零表示的第一个元素
G which is three in this case, and the second element of G is one G 在这种情况下是三，G 的第二 个元素是一
at one, which is seven. So, this is basically this is called the index or position of of 一，即七。所以，这基本上 就是所谓的索引或位置
elements or data in this particular collection, we will see these indexing and all these kinds 这个特定集合中的元素或数据，我们 将看到这些索引和所有这些类型
of collections in detail in in the in the data structure scores, and we will see arrays 在数据结构分数中详细收集 集合，我们将看到数组
and strains and different kinds of structures. But and default sometimes is, is basically 和应变和不同种类的结构。但是 ，默认有时是，基本上是
sometimes it is helpful. By the way you can achieve dev mode by by another by another 有时它是有帮助的。顺便说一句，您 可以通过另一个人实现开发模式
thing. For example, if you want to achieve a more 34 nine, you can do the same thing 事物。例如，如果你想达到更多的 34 个 9，你可以做同样的事情
by let's say 34 divided by double divided by nine that will give you a quotient. And 比方说 34 除以双除以 9 会给你一个商。和
the question is three and further if you write 34, remainder nine and that will give you 问题是三个，如果你写 34， 剩下的九个，那会给你
the remainder that you need. So you can call that function Dave mode. Or you can use these 您需要的剩余部分。所以你可以调用该 函数 Dave 模式。或者你可以使用这些
two there are multiple ways of doing the same stuff. Okay? So, yes, so, I mean, sometimes 两个有多种方法可以做同样的事情。好的？ 所以，是的，所以，我的意思是，有时
it's useful when you're going and knowing this kind of function that returns quotient 当您要了解这种返回商 的函数时，它很有用
and remainder. Okay, next function that is more useful is is in stance, and we will see 和余数。好的，下一个更有用 的函数是 stance，我们会看到
this function in the in the next video. So hope to see you in the next video okay, this 这个功能在下一个视频中。所以希望 在下一个视频中见到你 好吧，这个
function is in stance, it actually returns either true or false. And it just checks that 函数在 stance 中，它实际上返回 true 或 false。它只是检查
particular given data value belongs to this type or not. For example, if you want to check 特定的给定数据值是否属于这 种类型。例如，如果您想检查
whether one has type integer, so, you can check that using this function by the way, 是否有整数类型，所以，你可以 顺便检查一下使用这个函数，
you know that one is of type integer then you may think that why on earth one should 你知道一个是整数类型，那么 你可能会想为什么一个人应该
be interested in checking the type of one if somebody no it is in teacher, sometimes, 有兴趣检查一个人的类型， 如果有人不是老师，有时，
we have certain variables and certain data is stored in it, and we want to check the 我们有某些变量，某些数据 存储在其中，我们想检查
data inside it belongs to which kind of type and in several cases the value to this variable 它里面的数据属于哪种类型， 在某些情况下是这个变量的值
is not assigned by us It may be read from some file or maybe through input a user give 不是由我们分配的 它可能是从某个文件 中读取的，也可能是通过用户提供的输入
some number or something like so. So, sometimes it becomes important to check the type of 一些数字或类似的东西。因此， 有时检查类型变得很重要
a particular way if we are if we are expecting a particular type of the input and the input 如果我们期待特定类型 的输入和输入
is different than this function might be helpful. somewhere. Either way, this is a function 与此功能不同可能会有所帮助。某处。 无论哪种方式，这是一个函数
available in Python and it checks whether the given value has a particular type of not. 在 Python 中可用，它检查给定 的值是否具有特定类型的 not。
So is instance one int returns true is instance 1.0 integer that returns false maybe, because 所以实例一 int 返回 true 是实例 1.0 可能返回 false 的整数，因为
this is a floating point number, and you can check a particular value belongs to one of 这是一个浮点数，你可以 检查一个特定的值属于
the several types or not, you can give several types in a in a tupple. And you can check 无论是否为多种类型，您都可以在元组 中给出多种类型。你可以检查
whether it belongs to this, this or not. So, let's go to Jupyter Notebook and see, actually 不管它是否属于这个，这个。所以， 让我们去 Jupyter Notebook 看看，实际上
how it works. So, by the way, this is the same notebook that we have, that we are populating. 这个怎么运作。所以，顺便说一下，这 就是我们所拥有的、我们正在填充的笔记本。
So, hold on with me, at the end of the day, we'll be having one notebook complete. So, 所以，等一下，在一天结束时，我们 将完成一个笔记本。所以，
is in stance is instance, let's say three is that instance of integer The result is 立场是实例，假设三个 是整数的实例结果是
true in this particular case, if for example, we check whether is in stance 3.4 is that 在这种特殊情况下为真，例如，如果 我们检查立场 3.4 中的是否为
nmt? Is that an end user? The answer is no it does not end in Deezer. If for example, nmt？那是最终用户吗？答案是否定的 ，它不会以 Deezer 结束。例如，如果
we check if this is not in nature, then maybe it is a float? The answer is yes. Or maybe 我们检查这是否不是性质，那么也许它是 一个浮动？答案是肯定的。或者可能
we check that. For example, if that value is either float or integer, if it is one of 我们检查一下。例如，如果该值是 浮点数或整数，如果它是以下之一
these, then I mean check that particular value in this particular case 3.4 whether it belongs 这些，那么我的意思是检查这个特定 情况下的特定值 3.4 它是否属于
to one of these types, we can increase these types, for example. So, let's say we we gave 例如，对于这些类型之一，我们可以 增加这些类型。所以，假设我们给了
a complex number here and check is in stance let's say two plus three j that's a complex 这里是一个复数并检查是在立场上 让我们说二加三 j 这是一个复数
number. And let's say we asked whether it is an integer or float or not, the result 数字。假设我们问它是 整数还是浮点数，结果
is obviously false. And the reason is, it is neither integer nor float or even if we 显然是假的。原因是，它既不是整数 也不是浮点数，或者即使我们
give string there str, so, it will still say no it is not 给字符串 str，所以，它仍然会说不 ，它不是
not any of these, but maybe there is a complex data type if you see that, that says yes, 不是其中任何一个，但如果你看到它，也许有 一个复杂的数据类型，那就是，是的，
because it is complex. So sometimes this is instance becomes really useful. Next function 因为它很复杂。所以有时这个实例 变得非常有用。下一个函数
is power. So power you can you can compute power by the way using using for example, 是权力。因此，您可以通过使用 的方式计算功率，例如，
if you want to compute x raise to the power y, you can use double star and that computes 如果你想计算 x 的 y 次方 ，你可以使用双星并计算
exactly x raised to the power y or equivalently you can call the function POW x comma y and 正好 x 升到 y 次方，或者等效地， 您可以调用函数 POW x 逗号 y 和
that will give you the same result as this one. But power sometimes take three arguments 这将为您提供与此相同的结果 。但权力有时需要三个参数
as well. And in that case, it it a it performs the power function in a different behavior. 以及。在这种情况下，它以 不同的行为执行幂函数。
So for example, if you supply three arguments what it does it it raise y to equate x raise 因此，例如，如果您提供三个参数 ，它会提高 y 以等于 x raise
to the power BI whatever the result is, then it takes the remainder by z and gives the 无论结果是什么，它的幂 BI， 然后它取 z 的余数并给出
result. So let's see the functioning of this power function in Jupyter Notebook. So let's 结果。那么让我们看看这个幂函数在 Jupyter Notebook 中的作用。那么让我们
say Baba, I want to compute to raise to the power for the result is 16. No problem. To 说 Baba，我想计算结果的 乘方是 16。没问题。到
raise to the power four, I can compute the result 16 this way as well. But here is another 提高到 4 次方，我也可以这样 计算结果 16。但这里是另一个
way, how can we use this to raise to the power for whatever the result is, then I want to 方式，无论结果如何，我们如何使用 它来提升功率，那么我想
take the remainder, by let's say, I want to take the remainder by seven, or two, so we've 取余数，比方说，我想将余数 减去七或二，所以我们已经
got four is 16, then if we take the remainder by seven, the result will be two. And that's 得到 4 是 16，那么如果我们将余数 除以 7，结果将是 2。那就是
the result two. So that's how you can use this power function. I'm just introducing 结果二。这就是您如何使用此 幂函数的方法。我只是介绍
you some built in functions that are available, there are so many functions that are available, 你有一些可用的内置功能 ，有很多可用的功能，
I'm just getting you comfortable with these kinds of functions so that in future if you 我只是让您对这些功能感到 满意，以便将来如果您
see another function that he had not seen here, you'll be able to use it and apply it. 看到他在这里没有看到的另一个 功能，您将能够使用它并应用它。
So in this particular video, we saw this is in stance function and this power function. 所以在这个特定的视频中，我们 看到了站立函数和幂函数。
In the next video, we will see one more function that will allow you to take input from the 在下一个视频中，我们将看到 另一个功能，它允许您从
user. So far, we are supplying values or assigning values to variables directly, what if on the 用户。到目前为止，我们都是直接 为变量提供值或赋值，如果在
fly, we want to give the values and those values should be assigned to the variables. 飞，我们想给出值，这些 值应该分配给变量。
So in the next video, we will see the function, we will see a function that will allow you 所以在下一个视频中，我们将看到该 功能，我们将看到一个允许您
to give input from the keyboard, hope to see you in the next video. So in this video, we 从键盘输入，希望在下一个视频中见到 你。所以在这个视频中，我们
are going to see a very important function called input. This function is I mean, this 将看到一个非常重要的函数，称为 输入。这个功能是我的意思，这个
is beneficial for taking input from the keyboard from the user. And the way to call this function 有利于从用户的键盘获取输入 。以及调用这个函数的方式
is you type input. And then you type a message that actually describes the expected entry 你是输入法吗？然后输入一条 实际描述预期条目的消息
that for example, into something if you want somebody to or tell somebody to just incur 例如，如果你想要某人或 告诉某人只是招致某事
let's say, a number, you can write into a number, or any specification to help the user 比方说，一个数字，你可以写成一 个数字，或者任何规范来帮助用户
to enter whatever input the user want to interest properly. One thing is that no matter what 输入用户想要正确感兴趣的任何 输入。一件事是不管怎样
the user will enter, the variable a will be having type string, str. So even if you enter 用户将输入，变量 a 的类型为 字符串 str。所以即使你输入
a number, let's say 12, or 34, or whatever, that will be received as a string. And then 一个数字，比方说 12 或 34 或其他数字 ，它将作为字符串接收。进而
there are ways to convert string to number if that really was a number. So whatever you 如果确实是数字，则有多种方法可以 将字符串转换为数字。所以无论你
receive using input function will be a string. And then there are ways to deal with that 使用输入函数接收将是一个字符串 。然后有办法解决这个问题
string, if that was a number, how to convert that string to a number, and, and so on. So 字符串，如果是数字，如何将该字符串 转换为数字，等等。所以
for example, let's see, let's see on the Jupyter Notebook, how it works. So let's see, for 例如，让我们看看，在 Jupyter Notebook 上看看它 是如何工作的。所以让我们看看，对于
example, x is equal to input, enter a number. Let's see. And then then if I press Shift 例如，x 等于输入，输入一个数字。让 我们来看看。然后如果我按 Shift
Enter, a prompt will appear in front of you, that will require you to enter a number for 回车，你面前会出现一个提示 ，要求你输入一个数字
example, if I enter, let's say 56, and then I press enter, not Shift Enter, Enter, then 例如，如果我输入，比方说 56，然后我 按 Enter，而不是 Shift Enter，Enter，然后
x will receive 56. Now, you might be thinking this 56 is an integer, so the type of x should x 将得到 56。现在，你可能认为这个 56 是一个整数，所以 x 的类型应该
be an integer. But this is not the case the type of x will be a string. And the reason 是一个整数。但这不是 x 的类型 将是字符串的情况。和原因
is, whatever you enter is received as characters five and six, even if you have entered something 是，您输入的任何内容都会作为字符 5 和 6 接收，即使您输入了某些内容
else that would have been received as a sequence of characters. So this is no longer a five 否则将作为字符序列接收 。所以这不再是五
as a digit five, six as a digit six. These are some characters sequence of characters. 作为数字五，六作为数字六。 这些是一些字符的字符序列。
Now, if you want to, 现在，如果你愿意，
I mean, there are ways to convert this x, for example, maybe you want, let's say, y 我的意思是，有一些方法可以转换这个 x，例如，也许你想要，比方说，y
or x as int x. So this means you have now converted this string to integer and then 或 x 作为 int x。所以这意味着您现在 已将此字符串转换为整数，然后
whatever the result is, you have stored that result in x again, if you now see the type 无论结果如何，如果 您现在看到类型
of x type of x, the result is integer. And you can for example, print x minus 34. And x 类型的 x，结果是整数。例如 ，您可以打印 x 减 34。并且
the result is 22. Because X was X was 56. So this input function is I mean, it is an 结果是 22。因为 X 是 X 是 56。所以这个 输入函数是我的意思，它是一个
one way by the way, if you if you're expecting an integer or a float value, for example, 顺便说一句，如果您期望整数 或浮点值，例如，
let's say you're expecting a float value, then it is good to write input, let's say 假设你期望一个浮点值，那么 写输入是很好的，让我们说
enter a real number, maybe or any message, any message and then at this particular time 输入一个实数，可能或任何消息， 任何消息，然后在这个特定的时间
at the time of import, then it is okay to convert that thing to float and it will become 在导入的时候，那么把那个东西 转成float就可以了，它会变成
a float. Yeah, that's it. So, now, for example, you enter 12.5 if you see the type of a now, 一个浮动。是的，就是这样。因此，现在，例如 ，如果您看到现在的类型，则输入 12.5，
type of a will be float okay. But there are problems for example, if you are if you are a 的类型将是浮动的。但是有问题 ，例如，如果你是，如果你是
expecting float and somebody enters into something that is not float for example, a or let's 期待浮动并且有人进入了不浮动的 东西，例如，或者让我们
say B equals load, input enter are real number, let's say and then you press Shift Enter and 说 B 等于负载，输入 Enter 是实数 ，假设然后按 Shift Enter 和
somebody just interest let's say ABC. So, now, this is not a float ABC cannot be converted 有人只是感兴趣，让我们说 ABC。 所以，现在，这不是浮点 ABC 不能转换
to a real number no matter what. So, you will catch an error there are ways to avoid these 无论如何都是实数。所以，你会发现 一个错误，有办法避免这些
kinds of errors and programming program breaks using exception handling and there are other 使用异常处理的各种错误和 编程程序中断，还有其他
ways, but be careful I mean the user is not I mean the one who is going to enter the the 方法，但要小心我的意思是 用户不是我的意思是要进入
enter the input if that that user is not restricted enough, then you can get errors. So, I mean, 如果该用户没有受到足够的限制，请输入输入，那么您 可能会收到错误消息。所以，我的意思是，
this is not the case that whatever you will enter it will be converted to a float if it 情况并非如此，您将输入的任何 内容都将转换为浮点数，如果它
really, if whatever you have entered is really to convert it is really convertible to a float 真的，如果你输入的任何东西真的 要转换它真的可以转换为浮点数
then it can be convertible to a float, not otherwise. And at the input time, there is 然后它可以转换为浮点数， 否则不能。而在输入时，有
no restriction you cannot restrict the keyboard to enter water or whatnot, although there 没有限制，您不能限制键盘进入水 或诸如此类的东西，尽管有
are ways although there are ways to do that. So that's about the input function. So, we 是方法虽然有办法做到这一点。 这就是输入函数。所以，我们
have seen some of the functions, let me just let me just go through quickly we have seen 已经看到了一些功能，让我让 我快速浏览一下我们看到的
input we have seen is in stands, we have seen diff mode, we haven't we have seen power function, 我们见过的输入是在支架上，我们见 过差异模式，我们还没有见过幂函数，
we have seen the round function and there are several others. Yes, so from now on, we 我们已经看到了 round 函数，还有其他 几个。是的，所以从现在开始，我们
will be actually moving towards basically decision making based sometimes we will use 实际上将朝着基本基于决策的 方向发展，有时我们会使用
these kind of functions, mostly you will be using input function, but sometimes we'll 这些类型的函数，大多数情况下你 会使用输入函数，但有时我们会
be using maybe other functions like these functions. And sometimes we will be doing 可能正在使用其他功能，例如 这些功能。有时我们会做
decision making based on the ease and and stuff like so, one thing that I want to tell 基于轻松性和诸如此类的东西做出 决策，我想告诉你的一件事
you is if for example, you know the function name, some function, let's say like power, 例如，如果您知道函数名称 ，某些函数，例如功率，
you know, that POW power is a function, but you do not know how to use that function. 你知道，POW 的力量是一个函数，但 你不知道如何使用那个函数。
One way is to just type question mark in front of it, and then just press Shift Enter, 一种方法是在它前面输入问号 ，然后按 Shift Enter，
and in front of you, the documentation of the power will open up so it will tell that 在你面前，力量的文件会 打开，所以它会告诉你
this is power, that's how it should be called and then some description will be in front 这就是力量，这就是它应该被调用 的方式，然后一些描述将在前面
of you that equivalent to x raised to the power y with no arguments, the two arguments 相当于 x 的 y 次幂， 没有参数，两个参数
are equivalent to x raised to the power y remainder with z with three arguments and 等价于 x 的 y 次幂余数，z 带有三个参数，并且
so on, if you want to see implementation of this function as well. We will see the functions 依此类推，如果您还想查看此 功能的实现。我们将看到功能
later on but if you want to see more about the help, you can type the double Sam equal 稍后，但如果您想查看有关帮助的 更多信息，可以键入 double Sam equal
a double question mark and more things should be open up in front of you. So, in this particular 一个双重问号，更多的事情应该在 你面前展开。所以，在这个特殊的
case, the small function does not have an implementation in Python. So, the single question 在这种情况下，小函数在 Python 中没有实现。所以，唯一的问题
mark and double question mark are the same at one more way is to use the help function 标记和双问号相同的另一 种方法是使用帮助功能
help out and you will get a lot of information about the power how for example, help on built 提供帮助，您将获得大量有关 电源的信息，例如，帮助构建
and function power in module built in. So this is power this is equivalent to this some 和内置模块中的功能电源。 所以 这是电源这相当于这个一些
key types and stuff like so, or for example, you want to know how can I use the input function 键类型和诸如此类的东西，或者例如 ，您想知道我如何使用输入功能
for example, so you can write help on input and this is how this can be used. So sometimes 例如，您可以编写有关输入的帮助 ，这就是如何使用它。所以有时候
it is okay if you know the if you know the name of some function, and you know how to 如果您知道某个函数的 名称，并且您知道如何
use it, you can just open up the documentation right here in Jupyter Notebook by either using 使用它，您可以直接在 Jupyter Notebook 中打开文档，方法是使用
a help function or you can use just a question mark in front of the name and so on. So, that's 一个帮助功能，或者您可以只在名称 前面使用一个问号等等。所以那是
about the functions. In the next video, we will be seeing the power of comparisons and 关于功能。在下一个视频中 ，我们将看到比较的力量和
the decision making or sometimes called the control flow. So the real fun will begin from 决策或有时称为控制流 。所以真正的乐趣将从
the next video because we will be actually deciding which part of the code should run 下一个视频，因为我们将实际 决定应该运行代码的哪一部分
and which part should Not run based on based on certain conditions. So hope to see you 以及基于某些条件不应运行 的部分。所以希望见到你
in the next video. Okay, we are in control flow, the most interesting part of any programming 在下一个视频中。好的，我们在控制 流中，这是任何编程中最有趣的部分
language will assume that you have two numbers, you have taken two numbers from the user a, 语言将假设您有两个数字，您从 用户 a 处获取了两个数字，
you've taken that number from the user using input, I have not supplied the input message 您已经使用输入从用户那里获取了 该号码，但我没有提供输入消息
here, the message is optional. It's a description if you supply that that's okay, if you don't 在这里，消息是可选的。这是一个描述， 如果你提供那没关系，如果你不提供
supply even that, that's okay. So A is some number the user will supply when the code 即便如此，也没关系。所以 A 是用户 将在代码中提供的某个数字
will run B is some number the user will supply when the code will run. Now, once you have will run B 是用户将在代码运行时提供 的某个数字。现在，一旦你有
a and b in front of you, obviously the user will supply that on the fly, you don't know a 和 b 在你面前，显然用户 会即时提供，你不知道
what the value of a and b are. Because when the program will run, only at that time, the a 和 b 的值是什么。因为当程序 运行时，只有在那个时候，
A will be populated and B will be populated. Your task is whatever the value of a is that A 将被填充，B 将被填充。 你的任务是 a 的值是什么
is that you don't know whatever the value of b is that you don't know, the user will 是你不知道 b 的值是 你不知道，用户会
supply that value those values, your task is to print the value that is bigger than 提供这些值的值，您 的任务是打印大于
both. So for example, if a is bigger than B, then print a if b is bigger than a, then 两个都。例如，如果 a 大于 B， 则打印 a 如果 b 大于 a，则
print B. So whatever the bigger value is, print that value. Let's say that's your task. 打印 B. 所以无论更大的值是多少， 打印那个值。假设这是你的任务。
How can you do that? So the question is how does Python allows us does Python allow us 你怎么能这样做？所以问题是 Python 如何允许我们 Python 允许我们
to do that, for example, if a is bigger than we should print a, if b is bigger than we 要做到这一点，例如，如果 a 大于我们 应该打印 a，如果 b 大于我们
should print B, remember again, and again we are we are talking in terms of if A is 应该打印 B，再次记住，我们 再次讨论的是，如果 A 是
bigger, if so this is this is this is what if a is larger than B, then this condition 更大，如果是这样的话 这是这样 如果 a 比 B 大，那么这个条件
will be true. This is like the comparison. So this is true, but then we must have an 会是真的。这就像比较。所以这 是真的，但是我们必须有一个
F condition as well. If A is bigger than to what, so if a is bigger than B, then do certain F条件也一样。如果A比什么大 ，那么如果a比B大，那么做某些
things. Otherwise, don't do that. Those kinds of things. So this if condition is really, 事物。否则，不要这样做。那种东西 。所以这个 if 条件真的是，
really powerful, and is available in all programming languages. In here, for example, let's see 非常强大，适用于所有编程语言。 在这里，例如，让我们看看
if a is an input B is an input, writing an if condition, that's if is a keyword. That's 如果 a 是输入 B 是输入，写一个 if 条件 ，那就是 if 是一个关键字。那是
a comparison that we have done earlier as well. And then the syntax required a colon 我们之前也做过一个比较 。然后语法需要一个冒号
in front of that. So if this condition is true, if this result, if this comparison results 在那之前。所以如果这个条件为真 ，如果这个结果，如果这个比较结果
to remember the comparisons, they return Boolean values, if this comparison, if this, whatever 记住比较，他们返回布尔值，如果 这个比较，如果这个，不管
the result of this operation is if that is true, then you go into this block. And whatever 这个操作的结果是如果这是真的 ，那么你进入这个块。随便
the statement inside is do that, for example, print b is greater than a. 里面的语句是do that，例如 print b大于a。
Now my question is, is that is that done? Are we done with the task, the task was to 现在我的问题是，这已经完成了 吗？我们完成任务了吗，任务是
print the bigger number. If b is greater than a, then B will be printed then or they might 打印更大的数字。如果 b 大于 a， 那么 B 将被打印或者他们可能
have printed, for example, we might have printed rather than writing this we might have might 已经打印过，例如，我们可能已经 打印而不是写了我们可能有的
have printed, let's say just print B because b is bigger. If b is not bigger than a, what 已经打印，假设只打印 B 因为 b 更大。如果 b 不大于 a，什么
will? What we will do them. So yeah. If b is bigger than a then B will be printed? Yes. 将要？我们会怎么做。是的。如果 b 大于 a 那么 B 将被打印？是的。
Because then you will be inside here. If b is not bigger than if this condition is false. 因为那样你就会在里面。 如果 b 不大于此条件为假。
We will do what then? So that's a question. So right now I'm just coding this in Jupyter. 那我们会怎么做？所以这是一个问题。 所以现在我只是在 Jupyter 中编写代码。
notebook. And then we will see how can we deal with that if b is not bigger than a kind 笔记本。然后我们将看到如果 b 不大于 a 类，我们将如何处理
of condition? So let's first see the blessings of if condition and Jupyter Notebook. Yeah, 条件？那么我们先来看看if条件和 Jupyter Notebook的加持。是的，
so let's say a is an integer. Let's say you're expecting an integer input. input, let's say 所以让我们说 a 是一个整数。假设您期待 一个整数输入。输入，让我们说
and then you write if, let's say B is again, an integer input maybe. And let's say if a 然后你写如果，假设 B 又是一个整数 输入，也许。让我们说如果一个
is greater than b, then print a. That's it. That's your program. Remember, this indentation, 大于 b，则打印 a。就是这样。那 是你的程序。记住，这个缩进，
I have not written this print here. This is the indentation that defines the block of 我没有在这里写过这张照片 。这是定义块的缩进
a let's say if I want to print a, then I want to print, let's say, I am still inside. If a 比方说如果我想打印 a，那么我想打印 ，比方说，我还在里面。如果
condition, condition, and so whatever that starts from this, whatever that starts Form 条件，条件等等，无论从这个 开始，无论从哪个开始 Form
whatever that starts from this alignment, if I write something here, let's say x is 无论从这个对齐开始，如果我 在这里写一些东西，假设 x 是
equal to five, all that block all that block is called the body of the if condition, if 等于五，所有那个块所有那个块 被称为 if 条件的主体，如果
it starts from this alignment, If however, I I typed a statement, but I typed that statement 它从这个对齐开始，但是，如果我输入 了一个语句，但是我输入了那个语句
in that kind of alignment, the alignment like this, this is no longer inside the if condition. 在那种对齐方式中，像这样的对齐 方式，这不再在if条件之内。
So, for example, here I type I am outside the if condition. So, the purpose of writing 因此，例如，在这里我输入 I am 在 if 条件之外。所以，写作的目的
these multiple lines is just the if condition does not require to contain only one line 这些多行只是 if 条件 不需要只包含一行
of code, it can contain a whole block of code multiple lines of codes. So, this is no longer 代码，它可以包含一个完整的代码 块多行代码。所以，这不再是
inside the if condition. So, now we will take input a input B, whatever the numbers will 在 if 条件中。所以，现在我们将输入 一个输入 B，无论数字是什么
be, if the value in a will be larger than B, then this will be printed and this will 是，如果 a 中的值将大于 B， 那么这将被打印，这将
be printed. Once these two are printed, then this has to be printed regardless of the values 被打印。一旦打印了这两个， 那么无论值如何都必须打印
of a and b, because this does not this last sprint statement, it does not depend upon. a和b，因为这不是最后一个 sprint语句，所以不依赖。
This does not depend upon the values of a and b, it has the if condition has no impact 这不依赖于 a 和 b 的值， 它具有 if 条件没有影响
on that, that is just a sequence of statements. the if condition, the statement inside the 关于这一点，这只是一系列的陈述 。 if 条件，里面的语句
if are just these two. For example, if a is not bigger than B, then neither this will 如果只是这两个。例如，如果 a 不大于 B，那么这也不会
execute, nor this will execute. But this will still execute because this is this has nothing 执行，也不会执行。但这仍然 会执行，因为这是什么都没有
to do with the condition. So let's run this code and see how it works. So let's set the 与条件有关。所以让我们运行这段代码， 看看它是如何工作的。所以让我们设置
value of a see the power of descriptions. If we could have written a description, then 值一见描述的力量。如果我们 可以写一个描述，那么
the description could have been could have appeared here. But let's say this is the value 描述本来可以出现在这里 。但让我们说这是价值
of a let's say 12. The value of b let's say, let's say 10. In this particular case, because 的 a 比方说 12。 b 的值比方说，比方 说 10。在这种特殊情况下，因为
the value of b is 10, the value of a is 1212 is bigger than B if this condition is true, b 的值是 10，如果这个条件成立 ，a 的值是 1212 大于 B，
this statement becomes true. Whenever this condition becomes true, you're inside the 这个说法成立。每当此 条件成立时，您就在
prints you are inside the if condition. Now this print executes and you're you get well 打印您在 if 条件内。现在这个 打印执行，你会好起来的
this print executes and you get I am still inside the if condition, and this has to execute 这个打印执行，你得到我仍然 在 if 条件中，这必须执行
no matter what the values of NBR so now let me read on this and give other values of a 不管 NBR 的值是多少，现在让 我阅读一下并给出其他值
and b let's say the value of a is 10. And the value of b is let's say 45. Now, this b 假设 a 的值为 10。假设 b 的值为 45。现在，这个
can this condition becomes false because 10 is greater than 45 this is not true, this 这个条件会不会因为 10 大于 45 而 变为假呢？这不是真的，这
is false. So whenever this condition is false, you never land inside the if condition 是假的。所以每当这个条件为假时 ，你永远不会进入 if 条件
and you go out from the if condition. So these are the statements that are inside the if 然后你从 if 条件中退出。所以 这些是 if 中的语句
condition 健康）状况
they cannot execute because because you never visit them, they can only be executed if condition 它们无法执行，因为你从不访问 它们，它们只能在条件下执行
becomes true. So then once you're out the if condition that's the statement there is 变成真的。那么一旦你退出 if 条件，那就是语句
going to be executed anyways. So yeah, so that's the flavor of if condition on the see 无论如何都会被处决。所以是 的，这就是查看 if 条件的味道
and making and this is the comparison operator that returns a Boolean value. You may have 这是返回布尔值的比较 运算符。你可能有
different kinds of comparisons here or combination of comparisons here No, no problem depending 此处进行不同类型的比较或此处进行比较 的组合 不，没问题，具体取决于
upon your logic. But the question is, are we done we are going to print only the bigger 根据你的逻辑。但问题是，我们 完成了吗，我们将只打印更大的
number we have, we have printed the one that is if a is bigger, we have printed that what 我们有数字，我们已经打印了一个如果 a 更大的数字，我们已经打印了
if if b is bigger, we have not solved the task yet. This is the task we have not solved 如果 b 更大，我们还没有解决这个 任务。这是我们还没有解决的任务
the task yet. So how to do it. Okay. So yeah, it looks like complicated. How to print only 任务呢。那么如何去做。好的。所以是 的，它看起来很复杂。如何只打印
that number that is bigger. So if b is bigger than a, then we will print B. Maybe Maybe 那个更大的数字。所以如果 b 大于 a， 那么我们将打印 B。 也许也许
we should make maybe we should apply another if condition. If b is bigger than a then print 我们应该使也许我们应该应用另一 个 if 条件。如果 b 大于 a 则打印
B. If A is bigger than B, then print eight, maybe. Yeah, why not? So B. 如果 A 比 B 大，那么打印八，也许。是 的，为什么不呢？所以
um, 嗯，
so for example, let's go to Jupyter Notebook and, and write the following. Let me let me 例如，让我们转到 Jupyter Notebook 并编写以下内容。让我让我
write a whole new program here. A equals and import. Okay, let's do not have a message 在这里编写一个全新的程序。 A 等于 和导入。好吧，让我们不要留言
and input and then if A is bigger than B, then print a. Okay. However, if B is bigger 并输入然后如果A大于B，则打印 a。好的。但是，如果 B 更大
than a then print B, I guess we are done. If this condition becomes true, then we are 然后打印B，我想我们已经完成了 。如果这个条件成立，那么我们是
here and we know if this condition becomes true, then this condition cannot become true, 在这里，我们知道如果这个条件 成立，那么这个条件就不能成立，
because it cannot happen there is because then B as well as B is bigger than a This 因为它不可能在那里发生，因为 那么 B 和 B 都比 a 这更大
cannot happen. So, whatever the bigger number will be that will be executed further you 不可能发生。所以，无论更大的数字 是什么，你都会进一步执行
can see I have this if condition and this if condition they are aligned in a way that 可以看到我有这个 if 条件和这个 if 条件，它们以某种方式对齐
this if condition is not this the second if condition is not inside the body of the first this if 条件不是 this 第二个 if 条件不在第一个的主体内
if condition, we will see such cases such cases when this is required. But right now, 如果有条件，我们会在需要时 看到这种情况。但是现在，
I guess we are done. If A is bigger than B, then print a, if b is bigger than a then print 我想我们已经完成了。如果A大于 B，则打印a，如果b大于a则打印
B and only one of these if conditions will become true, because A is bigger than B B B 并且只有其中一个条件 成立，因为 A 大于 B B
is bigger than a, these two statements cannot be true at the same time. So, let's see. So 大于a，这两个陈述不能同时为真 。所以，让我们看看。所以
A is 10, b is 45. So the answer is 45. Well, because 45 is bigger. So let's run it again. A 是 10，b 是 45。所以答案是 45。好吧， 因为 45 更大。所以让我们再次运行它。
So A is let's say 22. b is let's say four and the result is 22. Because 32 is bigger, 所以 A 是 22。b 是 4，结果 是 22。因为 32 更大，
I guess we are done with the task, we have used this if condition twice to achieve the 我想我们已经完成了任务，我们 已经使用了两次 if 条件来实现
task to print the number that is bigger and both the numbers we we took both the numbers 打印更大的数字和两个数字的 任务我们同时取了两个数字
from the keyboard Yeah, I end this video here. And in the next video, I will tell you more 从键盘 是的，我在这里结束这个视频。 在下一个视频中，我会告诉你更多
features of this if condition particularly the L statement, whatever what we have done 这个 if 条件的特征特别是 L 语句，无论我们做了什么
recently with another if could could be achieved through an L statement that is more powerful 最近与另一个 if 可以通过 更强大的 L 语句实现
and more readable. So in the next video, I will talk about ELS statement which is a part 并且更具可读性。所以在下一个视频 中，我将讨论 ELS 声明，这是一部分
of F so hope to see you in the next video. Okay, in the last video, we saw if condition F 所以希望在下一个视频中见到你。好 的，在上一个视频中，我们看到了条件
and we actually had an example in which we wanted to know we wanted to just print the 我们实际上有一个例子， 我们想知道我们只想打印
greater number. So we input a number a we input a number B and if b is greater than 更大的数字。所以我们输入一个数字 a 我们输入一个数字 B 如果 b 大于
a we printed the is greater than eight, then we applied another if condition to check if a 我们打印了大于 8，然后我们应用 了另一个 if 条件来检查是否
a is greater than b, then paint a the else clause or the else part of f is as as the a 大于 b，然后绘制一个 else 子句或 f 的 else 部分与
name suggests, if this condition is true. So, if this condition is true, this particular 顾名思义，如果此条件为真。所以 ，如果这个条件为真，这个特殊的
condition is true, then go there. If this is not true, which means else if this is true, 条件为真，然后去那里。如果这不是 真的，这意味着 else 如果这是真的，
then go there, else go there. So if this is true, then you learned here, if this is false, 然后去那里，否则去那里。所以如果这是真的 ，那么你在这里学到了，如果这是假的，
then you learn else part for sure. And this else is I mean, if b is greater than a if 那么你肯定会学到其他部分。这就 是我的意思，如果 b 大于 a if
this condition is true, then you print this thing. Otherwise, a might be greater than 这个条件是真的，然后你打印这个 东西。否则，a 可能大于
B or A might be equal to b either way you learn in else part. So this if and else they B 或 A 可能等于 b 无论你在其他部分 学习的方式。所以这如果和否则他们
both have this alignment, but then the block of ELLs started from this particular alignment, 两者都有这种对齐方式，但是随后 ELL 块从这个特定的对齐方式开始，
maybe you have more statements here, the alignment of this if block structure from here, and 也许你在这里有更多的陈述，这个 if 块结构的对齐方式，以及
you may have more statements here. So let's go to the Jupyter Notebook and see the else 你可能在这里有更多的陈述。所以 让我们去 Jupyter Notebook 看看 else
running. So let's say a equals and input and B is 跑步。所以让我们说一个等于和输入和 B 是
B is int input and we say okay, if a is greater than b, then brand a B 是 int 输入，我们说好的，如果 a 大于 b，则标记 a
else else rent else brand be elsewhere outspent B. Now B will be printed, even if it is equal else else 租金 else 品牌在别处超出 B. 现在 B 将被打印，即使它是相等的
to A or if it is greater than a either way, B will be printed. So let's just see. Let's 到 A 或者如果它大于任何一种方式，B 将被打印。所以让我们看看。让我们
just run this and see what happens. So Shift Enter. So input a number. So A is let's say 只需运行它，看看会发生什么。所以Shift Enter。 所以输入一个数字。所以A是让我们说
10, and B is let's say, 12. So what do you think when I will press enter what will be 10，而 B 是让我们说，12。那么当 我按下回车键时你觉得会是什么
printed, B or A, B, B is printed, that's what B is printed. Now, if I run this again, and 打印，B或A，B，B打印，这就是B打印的内容 。现在，如果我再次运行它，并且
a is done, and B is done, still the 10 will be printed. So let's modify it, let's, let's a 完成，B 完成，仍然会打印 10。所以 让我们修改它，让我们，让我们
just say, print. If part. So that means we landed in if part. Otherwise, we landed in 只是说，打印。如果部分。所以这意味着 我们进入了 if 部分。否则，我们降落在
Ellsberg. So just to be more elaborated, let's say so 10 and 10. And we landed in L sport. 埃尔斯伯格。所以更详细地说，让我们 说 10 和 10。我们降落在 L 运动中。
And the reason is if a is greater than b, so 10 is greater than b 10 is greater than 原因是如果a大于b， 那么10大于b 10大于
10. False. So you got two L's, and the LS block, the whole block just executed. So that's 10. 错误。所以你有两个 L 和 LS 块，整个块刚刚执行。所以那是
what else is, it's really very nice to have an L state or whatever this whenever the, 还有什么是，无论何时，拥有 L 状态 或其他任何东西真的非常好，
if this is false, whatever that condition is, if that is false, then you learn in else. 如果这是假的，不管那个条件是什么， 如果那是假的，那么你在 else 中学习。
So yeah, that's the health part simply now, okay. So, we have this f l structure, we can 所以是的，这就是现在的健康部分，好吧 。所以，我们有这个 f l 结构，我们可以
have one more power with this F, what if we want, if a if b is greater than a, then you 用这个 F 多一个幂，如果我们想要怎么 办，如果 a 如果 b 大于 a，那么你
print B. Else, if A is equal to b, then you print they're equal. And if this is false, 打印 B。否则，如果 A 等于 b，则 打印它们相等。如果这是假的，
and this condition is false, if both these conditions are false, then you go to else 并且这个条件是假的，如果这两 个条件都是假的，那么你去 else
part. So basically, if else if else if else, if else, so, you can have really deep structure 部分。所以基本上, if else if else if else, if else, so, 你可以有很深的结构
for example, in this particular example, if b is larger than a, then you land in this 例如，在这个特定的例子中，如果 b 大于 a，那么你在这个
part else, if this L is just short form of else, else means B is not greater than a else, 部分 else，如果这个 L 只是 else 的 简写形式，else 表示 B 不大于 else，
you can have another check elsif A is equal to b, then do what? 你可以再次检查 elsif A 等于 b， 然后做什么？
l 升
l, if we can have one more check, we can have one more check, we can have several checks, l，如果我们可以多一张支票，我们可以 多一张支票，我们可以多张支票，
and then else else will only execute if all if conditions or elsif parts on top. Their 然后 else else 只会在所有 if 条件或 elsif 部分位于顶部时执行。他们的
conditions, they are false, and only then else will be execute. So let's see these l 条件，它们是假的，只有这样 else 才 会被执行。所以让我们看看这些 l
diff running on Jupyter. notebook. Okay, so let's say a is and so rather than taking inputs, 在 Jupyter 上运行的差异。笔记本。好的， 所以让我们说 a is and so 而不是接受输入，
let's say is one, B is let's say five. Let's say we have taken these inputs is one B is 让我们说是一，B 是让我们说五。假设我们 已经采取了这些输入是一个 B 是
five, if A is if a is equal to b, then the word rent equal l l F, which means else if 五、如果A是if a等于b，那么rent 这个词就等于l l F，即else if
now, because this is if you should you have to write a condition here, which will be either 现在，因为这是如果你必须 在这里写一个条件，要么
true or false. If A is larger than B, then do what? then print, let's say, a. And else, 对或错。如果 A 大于 B，那么怎么 办？然后打印，比方说，a。另外，
let's say your brain be okay. So that's it. And this statement, rent is not in if condition 假设你的大脑没事。就是这样了。 而这个声明，租金不在 if 条件下
Not, not in if this is outside complete, this is complete if condition with all its L's 不，不 in 如果这是外部完整的， 如果条件及其所有 L 是完整的
and LDAP parts, and this is no longer inside. So let's run this. What do you think what 和 LDAP 部分，这里面不再赘述。所以 让我们运行这个。你觉得什么
will be the result if A is one B is five, then else bar is going to be run because A 如果 A 是 1 B 是 5，则结果是 ，否则 bar 将运行，因为 A
is not equal to B, A is equal to b that's false is larger than B that is also false. 不等于 B，A 等于 b 是假 的大于 B 也是假的。
So you will learn in export and B will be printed and then a statement will be printed 所以你会在 export 中学习，然后 打印 B 然后打印一条语句
which is not an F. So yeah, so B is printed and not an F. If b is 10, then what will happen? 这不是 F。所以是的，所以打印的是 B 而 不是 F。如果 b 是 10，那么会发生什么？
A equals to B that is false, so you will not land here. Else if A is larger than B true. A 等于 B 是假的，所以你不会在这里着陆 。否则，如果 A 大于 B，则为真。
You will land here because you land here else will not execute. So He will be printed and 你会在这里着陆，因为你在这里着陆， 否则不会执行。所以他会被打印出来
then not enough. If A is 10 and b is also banned, let's say, then you have equal. Yeah, 然后还不够。如果 A 是 10 并且 b 也被 禁止，比方说，那么你有平等。是的，
so that's elsif. Okay, so that's about if else if else if or short form is lf l structure. 所以这就是 elsif。好的，这就是 if else if else if 或短形式是 lf l 结构。
In the next video, we will be talking more about this if else if else structure in a 在下一个视频中，我们将更多 地讨论这个 if else if else 结构
bit more detail. And we will also be giving you a short form of this this guide of ELLs 再详细一点。我们还将为您提供 这份 ELL 指南的简短形式
if elsif elberfeld of structure. So hope to see you in the next video. Okay, one way of if elsif elberfeld 的结构。所以希望在下 一个视频中见到你。好的，一种方式
writing this, if elsif else kind of structure there is a short form as well, which is written 写这个，如果 elsif else 类型的结构 也有一个简短的形式，写成
down here in a in this green color, for example. This is kind of a same code that we saw in 例如，在这个绿色的地方。这与 我们在 中看到的代码相同
the last video, but that's the short form, let's say a equals nine and B equals 10, then 最后一个视频，但那是简短的形式 ，假设 a 等于 9，B 等于 10，然后
print a if A is larger than B, else print this particular thing, if A is equal to b, 如果 A 大于 B，则打印 a，否则打印 这个特定的东西，如果 A 等于 b，
l sprint that this is exactly the same kind of structure, for example, print a, if A is l sprint 认为这是完全相同的一种 结构，例如，打印 a，如果 A 是
larger than B, so you just read that if a is larger than B, then print a else if A is 大于 B，所以你只是读到如果 a 大于 B，然后打印一个 else if A is
equal to b, then print equal, else print that. So that is kind of a short form of writing 等于 b，然后打印相等，否则打印那个 。所以这是一种简短的写作形式
this if Elif else kind of structure. But I will, I will recommend to to to use, I'm in 这种 if Elif else 结构。但我 会，我会推荐使用，我在
the structure in this particular horizontal form. Rather than writing that in this particular 这种特殊的水平形式的结构 。而不是写在这个特定的
way. Because this kind of structure, that horizontal kind of structure is much more 道路。因为这种结构，那 种横向的结构要多得多
readable, much more manageable. And this might be this structure might be confusing some 可读，更易于管理。这可能是 这个结构可能会混淆一些
time for for some kind of readers or, and also if this structure goes on and on and 是时候给某种读者了，或者 ，如果这种结构继续下去，
on, which we'll see in a in an example today. Writing that writing very deep and lengthy 上，我们将在今天的示例 中看到。写的很深很长
structures in short form is not very feasible. So although but but this feature is there 简短形式的结构不太可行。所以虽然 但是但是这个功能是存在的
if you like to write if elsif else kind of structure in this way, this is available in 如果您喜欢以这种方式编写 if elsif else 类型的结构，则可以在
Python. Okay, let's let's get a good grip on this f LS f l structure on Jupyter. notebook. Python。好的，让我们在 Jupyter 上 好好掌握这个 f LS f l 结构。笔记本。
Let's move on to Jupyter Notebook. To see an example, just an example. So let's say 让我们继续讨论 Jupyter Notebook。看一个 例子，只是一个例子。所以让我们说
the example is user will input a number, let's say int input, let's say and enter marks, 这个例子是用户将输入一个数字，假设 是 int 输入，假设是输入标记，
let's say enter marks for a particular subject, let's say user with enter some some marks. 假设输入特定主题的标记，假设 用户输入一些标记。
And our goal is if the marks are larger than 85, then we will print a grade. If the marks 我们的目标是如果分数大于 85，那么 我们将打印一个等级。如果标记
are larger than larger than 80, but smaller than smaller, so if the marks are larger equal 大于大于 80，但小于小于 80， 所以如果标记大于等于
to 85, then we will print a grade. Else if marks are larger equal to 80, but smaller 到 85，然后我们将打印一个等级。否则 ，如果标记大于等于 80，但小于
than 85, then we will print a minus grade. And if else if if marks are larger than larger 大于 85，那么我们将打印一个 减号。如果如果标记大于大于
equal to 75, but smaller than 80, we will paint we will print for example, b grade for 等于 75，但小于 80，我们将 绘制我们将打印例如，b 级为
example, b grade, and so on, let's print this whole nested structure that let's let's make 例如，b 级，等等，让我们打印这个 让我们制作的整个嵌套结构
this else. if else if elsif kind of structure a little empty, let's let's get comfortable 这个别的。 if else if elsif 那种 结构有点空，让我们舒服点
with it. So if a is larger than or equal to 85 to enhance readability, it is good to include 用它。所以如果a大于或等于 85以增强可读性，最好包括
a space is a space after the variable and space but don't actually write the space inside 空格是变量和空格之后的空格 ，但实际上不要在里面写空格
there because larger and equal to the combined without space is an operator. So if a is larger 那里因为更大和等于没有空格的组合 是一个运算符。所以如果 a 更大
than 85, then print let's say a grade rate l if A is a is larger or equal to a D and 大于 85，然后打印让我们说等级率 l 如果 A 大于或等于 D 并且
E is smaller than 85. So let me let me write this in a more readable form. Else if A is E 小于 85。所以让我以更易读的 形式来写这个。否则如果 A 是
smaller than 85 and is larger or equal to 80 then we should do what it is sometimes 小于 85 且大于或等于 80 那么 我们有时应该这样做
good to include these kind of parentheses sometimes it is good just to make these things 很好地包含这些括号有时 只是制作这些东西很好
more readable that this is one block. This is one this is one Boolean, this is one Boolean, 更具可读性，这是一个块。这是一 个这是一个布尔值 这是一个布尔值
this is one to see and this font is E and although not writing the parenthesis is also 这是一个看，这个字体 是E，虽然不写括号也是
okay. But writing the parenthesis make code a little more readable. So, for example, if 好的。但是写括号会使代码更 具可读性。所以，例如，如果
a is smaller than 85 and a is larger than 80, if that is true, So, remember and is true a 小于 85 且 a 大于 80，如果这 是真的，那么，记住并且是真的
only when the left side is true and right side both are true, then this whole condition 只有当左侧为真而右侧 都为真时，则整个条件
becomes true. And I promised you that I will show you the power of comparisons and actually 变成真的。我向你保证，我会 向你展示比较的力量，实际上
combining the Boolean variables using ands and ORS and stuff like so. So here you're 使用 ands 和 ORS 以及诸如此类的东西 组合布尔变量。所以你来了
seeing the one. In that case, let's say brand. Let's say a binary sprayed and Elif if he 看到一个。在这种情况下，让我们说品牌。让 我们说一个二进制喷洒和 Elif 如果他
is if he is smaller than if he is smaller than 80. And a is bigger or equal to 75. If 是如果他小于如果他小于 80。 并且 a 大于或等于 75。如果
that's the case, then what should we do? Let me omit the parentheses just to show that 既然如此，那我们该怎么办呢？ 让我省略括号只是为了表明
whether writing parenthesis or not writing parentheses is perfectly okay. I just recommend 无论写括号还是不写括号 都可以。我只是推荐
right parenthesis, so the code becomes much more readable than otherwise. Okay, then we 右括号，因此代码变得比其他方式 更具可读性。好的，那我们
have Brent, let's say, b grade. And let's say one more lF lF. If A is smaller than 75. 有布伦特，比方说，b 级。让我们 再说一个 lF lF。如果 A 小于 75。
And a is larger or equal to let's say 并且 a 大于或等于让我们说
70. samedi, then Brent b minus grade, let's say. And let's just finish this let's else 70.samedi，然后布伦特 b 减去等级，让我们 说。让我们完成这个让我们其他
print. below. Average, for example, let's say that's it, that's our, that's our record. 打印。以下。例如，平均而言，假设就是 这样，那是我们的，这就是我们的记录。
So, we will we will enter numbers, if the number is greater than 85, then a grade if, 所以，我们将我们将输入数字，如果 数字大于 85，那么一个等级，如果，
when this condition becomes true, then this print will execute. And we will out of the 当此条件为真时，将执行 此打印。我们将走出
structure right there. If this condition is false, then this condition will be checked. 结构就在那里。如果此条件 为假，则将检查此条件。
If this condition becomes true, then this print will execute. And we will be out of 如果此条件为真，则将执行 此打印。我们将离开
this structure. If this is false, and this is false, then this will be checked. If this 这种结构。如果这是假的，并且这 是假的，那么这将被检查。如果这
is true, then we print degrade and we are out. But if this is false, then this will 是真的，然后我们打印降级，我们就 出局了。但如果这是假的，那么这将
be checked. And if this is true, then we'll print b minus grade. And we will be out. If 被检查。如果这是真的，那么我们将 打印 b 减级。我们会出去的。如果
this is also false, then we will dive into L sport and we will say okay, below average. 这也是错误的，然后我们将深入到 L 运动 ，我们会说好的，低于平均水平。
So let's see, for example, let's say the marks are at two. So a minus grade. That, that that 因此，让我们看看，例如，假设标记 为 2。所以减分。那个那个那个
that makes sense, a minus grade because the marks are smaller than 85 and larger than 这是有道理的，一个负分， 因为分数小于 85 并且大于
larger or equal to 80. So a minus grade. Let's, let's run this again. And we have let's say 大于或等于 80。所以减分。让我们， 让我们再次运行它。我们可以说
marks let's say 64 below average. Okay, great. So you see this if Elif, Elif Elif else this 分数比平均水平低 64 分。好的，太好了。 所以你看到这个 if Elif, Elif Elif else this
can go as long as you want, depending upon your logic. So great. And further, you can 可以随心所欲，具体取决于您的 逻辑。很好。更进一步，你可以
combine several comparisons several billions, together with ands and ORS, and nots, whatever 结合几个比较几十亿，加上 ands和ORS，和nots，不管
you whatever you like to like to do. Let me give you one more or one more beautiful thing. 你喜欢做什么就做什么。让我 再给你一件或一件更美的事。
let's let's let's create an L without writing an else or let's let's just let's just write 让我们创建一个 L 而不写 else 或者让我们只写
lF and implement ELS completely so we are not going to write ELS explicitly, but we lF 并完全实现 ELS，所以我们 不会明确地编写 ELS，但我们
are going to write a program that actually simulates ELS So let's see, if a equals let's 将要编写一个实际模拟 ELS 的程序 所以 让我们看看，如果 a 等于让我们
say, three. If A is larger than 10, then Brent let's say larger than that. Now, we are not 说，三个。如果 A 大于 10，那么 Brent 比这更大。现在，我们不是
going to write else, but we are going to achieve the aerosport. 打算写别的，但我们要实现航空 运动。
Tell If 告诉如果
not, 不是，
a is bigger than 10. To see, then print you see that I mean, that's beautiful. If this a 大于 10。看，然后打印你看，我 的意思是，这很漂亮。如果这
condition is true, then go there. If this condition is false, then not have false is 条件为真，然后去那里。如果这个 条件是假的，那么没有假是
true, then you learn here. And you need not to write an expert if you want just I've implemented 真的，那么你在这里学习。如果你 想要我已经实现了，你不需要写一个专家
I have implemented l spark using l f. So see that. So l sparks so we are right now Spark. 我已经使用 l f 实现了 l spark。所以看到了 。所以我火花，所以我们现在是火花。
If A is let's say 13, then we will think okay, rather than just for fun, just for fun, okay. 如果 A 是 13，那么我们会认为还好，而不 只是为了好玩，只是为了好玩，好吧。
Okay, great. So, we saw if condition it's shorthand and LDAP structure in in a bit more, 好的，太好了。所以，我们看到如果 条件它是速记和 LDAP 结构在更多一点，
lengthy way. So in the next video, we will see if condition inside or in the body of 漫长的道路。所以在下一 个视频中，我们将看到
another if condition, which is called a nested F. So hope to see you in the in the next video. 另一个 if 条件，称为嵌套 F。所以 希望在下一个视频中见到您。
In the last video we saw if lF structure, in this particular video, we will see nested 在上一个视频中我们看到了 if 结构， 在这个特定的视频中，我们将看到嵌套
F, or are simply called if inside the body of another F. So let's take an example to F，或者在另一个 F 的主体内被简单 地调用。 所以让我们举个例子
understand what nested if condition is simply we can understand if condition inside another 理解嵌套 if 条件是什么我们可以 理解 if 条件在另一个内部
if condition, that's all rest of the story is same. The way it works, it works even if 如果条件成立，那么故事的其余部分 都是相同的。它的工作方式，即使
it is inside the body of another if or or anywhere, actually. So let's say we have input 实际上，它在另一个人的身体内，如果 或或在任何地方。所以假设我们有输入
a number, and then we check if x is larger than 10, then you move inside the if condition. 一个数字，然后我们检查 x 是否 大于 10，然后您进入 if 条件。
If that is true. If that is false, then you are here, whatever you write here, it will 如果这是真的。如果那是假的，那么你在 这里，无论你在这里写什么，它都会
work from here. But let's say x is greater than 10, then you print your number is greater 从这里开始工作。但是假设 x 大于 10，那么您打印的数字更大
than 10, your number is above 10. Let's say let's see Brent that now after this, after 比 10，你的数字在 10 以上。假设让我们 看看布伦特，在这之后，之后
this statement, you move to the statement, and you just make another check if x is larger 这个语句，你移动到这个语句， 然后你再做一次检查 x 是否更大
than 20. Now you see this if condition. This particular statement is inside this particular 比 20. 现在你看到这个 if 条件。这个 特别的陈述在这个特别的里面
if condition, if this, this condition becomes true only then you dive in, otherwise you're 如果条件，如果这个，这个条件 才成立，然后你潜入，否则你
not. So here you're checking if x is larger than 10, then you move inside and inside you're 不是。所以在这里你要检查 x 是否 大于 10，然后你在里面和里面移动
making more checks. So for example, if x is larger than 10, then you print or do some 做更多的检查。例如，如果 x 大于 10，那么你打印或做一些
stuff here, then you apply Further more, more checks more graduality more, whatever your 这里的东西，然后你应用更多， 更多检查更多渐进性，无论你
logic is. So let's say here you're checking if x is larger than 20. Now, if this condition 逻辑是。所以让我们在这里说你正在检查 x 是否大于 20。 现在，如果这个条件
is true, then you move here else now this else is of this if if x is not larger than 是真的，那么你移到这里 else now this else is of this if 如果 x 不大于
20, then you move to this else l squat and you're here. So and we can have another if 20，然后你移动到这个 else l 蹲下，你就 在这里。所以我们可以有另一个如果
inside this particular F or an F inside this L sport and so on. So if inside an F is called 在这个特定的 F 或在这个 L 运动中的 F 等等。所以如果在 F 内部被调用
nested if and we can have I mean deep structures, for example, if then something then if then 嵌套如果，我们可以让我的意思是深层结构 ，例如，如果那么某事那么如果那么
something then if so maybe we can have a very lengthy structure if nested if structure depending 如果是这样的话，如果嵌套 if 结构取决于 ，也许我们可以有一个非常冗长的结构
upon the logic. So let's get ourselves comfortable. As always, by writing the code on Jupyter 在逻辑上。所以让我们让自己舒服点。一如既往 ，通过在 Jupyter 上编写代码
Notebook because that makes much more sense. When we see things running on, on on the notebook. 笔记本，因为这更有意义。当我们 看到在笔记本上运行的东西时。
So let's say a is let's say again, and let's say we take some number and if a is larger 所以让我们说 a 是让我们再说一遍， 假设我们取一些数字，如果 a 更大
than 10, then we say okay, Brent, larger than 10 and do more stuff, Brent. That's inside. 大于 10，然后我们说好的，布伦特，大于 10 并做更多的事情，布伦特。那是里面。
If condition, okay, then then maybe we have another check if A is larger than 20 then 如果条件好，那么也许我们再 检查一次 A 是否大于 20 那么
say rent greater than 20 Yeah, greater than 20. And you can rent 说租金大于 20 是的，大于 20。你可以租
now rent inside the nested if, okay. Else rent l sprint, smaller or equal to 20, smaller 现在租里面嵌套如果，好吧。 else 租 l sprint，小于等于 20，更小
equal to 20. And then brand, for example, inside the L spark of nested if that's it, 等于 20。然后品牌，例如，在嵌套 的 L 火花内，如果是这样，
and you can print here, brand outside all it's fine. So that's it that's that that's 你可以在这里打印，品牌外面一切 都很好。所以就是这样就是那样
the structure. So let's see, let's give an input which is larger than, by the way, if 结构。所以让我们看看，让我们给出 一个大于，顺便说一下，如果
input is not larger than 10, this if condition is false, then you directly dive to this print 输入不大于10，这个如果条件为 假，那么你直接跳到这个打印
statement and all this structure is not going to be executed, this is this complete thing 语句，所有这些结构都不会被 执行，这就是完整的东西
is called the body of this if condition, and the body will only execute if the condition 被称为此 if 条件的主体，并且 主体仅在满足条件时才会执行
becomes true, whether that condition is just a single condition, or you have a combination 变为真，无论该条件只是 一个条件，还是您有组合
of a lot of comparisons and a lot of Booleans whatever, if this condition becomes true, 很多比较和很多布尔值， 如果这个条件成立，
whatever that condition takes form of, then Then and only then you dive into this part. 无论该条件以何种形式出现，然后， 只有这样您才能深入到这一部分。
And when you are in this part, then that's a whole new universe, then you're on its own 当你在这个部分时，那就是一个 全新的宇宙，然后你就靠自己了
in the new part, in the new part, for example, if this condition becomes true, then you are 在新的部分，在新的部分，例如， 如果这个条件成立，那么你是
in this part, that's the body of this particular if condition, and that's the body of the else 在这一部分，这是这个特定 if 条件 的主体，那是 else 的主体
part, see the the body of the top if condition has this kind of alignment, all the statements 部分，如果条件有这种对齐方式 ，请查看顶部的主体，所有语句
that are in the body of if condition, they start the same alignment, and all the conditions 在 if 条件的主体中，它们开始 相同的对齐方式，并且所有条件
all the statements that are in the body of this particular if condition, they have their 在这个特定 if 条件的主体中 的所有语句，它们都有自己的
own alignment, and this indentation is necessity just to define, for example, which statement 自己的对齐方式，这个缩进是必要的， 只是为了定义，例如，哪个语句
is in what kind of block for example, if I just press a tab, then another tab, then this 例如，在什么样的块中，如果我只是按一 个选项卡，然后按另一个选项卡，那么这个
print statement is in this L sport and this is the indentation that is defining the placement 打印语句在这个 L 运动 中，这是定义位置的缩进
of this print, if for example, I press I align this with this, this particular structure 这张印刷品，例如，如果我按下我将 它与这个对齐，这个特殊的结构
here, then this print statement is inside this if condition, this is the indentation 在这里，那么这个打印语句在 这个 if 条件中，这是缩进
that is defining the placement of different statements. And if the print starts from here, 即定义不同语句的位置。 如果打印从这里开始，
then it is completely outside of all if conditions it is like this way. So let's run this board 那么它完全在所有 if 条件之外 。所以让我们运行这个板
and see what happens. Let's say we brand let's say we just cried a equals let's say 12. So, 看看会发生什么。比方说我们打品牌比方 说我们刚刚哭了 比方说 12。所以，
what do you think what should be printed, if A is 12 then first of all this condition 你认为应该打印什么，如果 A 是 12 那么首先这个条件
is true. So greater than 10 will be printed inside the top if that will be printed, then 是真的。所以大于 10 将被打印 在顶部如果要打印，那么
this check will be executed and this condition will become false because 12 is not larger 将执行此检查并且此条件将 变为假，因为 12 不大于
than 20 then you will go to the else part and less or equal to 20 this number this string 小于 20 那么你将转到 else 部分并且 小于或等于 20 这个数字这个字符串
will be printed and then inside the else part of nested if that will be printed and then 将被打印，然后在嵌套 if 的 else 部分内被打印，然后
you will be out of all if condition then outside of all F's that will be printed. So let's 如果条件然后在将打印的所有 F 之外， 您将被排除在外。那么让我们
see whether whatever we have said is correct or not. So yes, greater than 10 inside the 看看我们说的对不对。所以 是的，里面大于 10
top if less than or equal to 20 inside the else part of the nested f outside all F's 如果在所有 F 之外的嵌套 f 的 else 部分内小于或等于 20，则为 top
Yeah. So that's what the nested F is. And by the way, you can have you can have for 是的。这就是嵌套 F 的含义。顺便 说一句，你可以拥有你可以拥有的
example, more if conditions inside the nested ifs for example, you can have one more condition 例如，嵌套 ifs 中的更多 if 条件 ，例如，您可以多一个条件
here, if A is larger than 30 for example, then do what then print it is larger than 在这里，例如，如果 A 大于 30， 那么执行然后打印它大于
30 as well. And for the brand, maybe not necessarily that you always write print statements you 30 也是。而对于品牌来说，也许不 一定你总是写印刷声明你
can do any interesting stuff 可以做任何有趣的事情
inside inside the nested if of nested if find and then you can write the else part of this 在嵌套 if 的嵌套 if 里面找到然后 你可以写这个的 else 部分
particular if condition here if you want to or or whatever I mean you can have as hilarious 特别是如果您愿意或我的意思 是这里的条件，您可以很有趣
structure as you want, but that completely depends upon the logic or you may have an 你想要的结构，但这完全取决于 逻辑，或者你可能有一个
if condition inside that l spot here for example, You can write an if condition here, if whatever 例如，如果条件在那个 l 点这里，你可以 在这里写一个 if 条件，如果有的话
that is also, that is also perfectly fine. So, if a is larger than 20, then you print 那也是，那也完全没问题。所以 ，如果 a 大于 20，那么你打印
this if A is larger than 30, then this, for example, and literally write the else part this 如果 A 大于 30，那么 this， 例如，直接写 else 部分
here else, print less than or equal to 30. And we can print inside the nested inside 否则，打印小于或等于 30。 我们可以在嵌套里面打印
the else for all of nested if of nested if, okay, so, while you see that program, let 嵌套 if 的所有嵌套 if 的 else，好吧， 所以，当你看到那个程序时，让
me let me just scale it down so that you can see that completely see that program. I mean, 我让我把它缩小，这样你就可以看到 完全看到那个程序。我的意思是，
yeah, it makes perfectly sense to me, for example, you take an input, if that is larger 是的，这对我来说很有意义，例如 ，你接受一个输入，如果它更大
than 10, then you're here. If it is larger than 20, then you are here. If it is not larger 超过 10，那么你就在这里。如果它大于 20，那么你就在这里。如果不是更大
than 20, then you're here. Okay. So let's say it is larger than 20. If it is larger 超过20，那么你就在这里。好的。 所以假设它大于 20。如果它更大
than 20, then you are here further, if it is larger than 30, then you are here. Otherwise, 比20，那么你在这里更远，如果它 大于30，那么你就在这里。除此以外，
you are here. And once and by the way, if A is not larger than 10, then you are directly 你在这里。顺便说一句， 如果A不大于10，那么你直接
here. Wow. So let's run this code. Let me just scale it down so that you can see it 这里。哇。所以让我们运行这段代码。 让我把它缩小，这样你就可以看到它
more. You can see more text. Let's see. So let's run this. No errors. Great. So let's 更多的。你可以看到更多的文字。让我们来看看。所以 让我们运行这个。没有错误。伟大的。那么让我们
say the number is let's say 25. So, what do you expect the result. So the number is 25 假设数字是 25。那么，你期望 结果如何。所以数字是25
is greater than 10 inside the top if it is greater than 20 inside the nested if it is 如果在嵌套内部大于 20，则 在顶部内部大于 10，如果是
smaller than or equal to 30. So inside the else part of nested if off nested if and then 小于或等于 30。所以在嵌套 if off 的 else 部分内嵌套 if and then
outside all the hips conditions. Great. Yeah. You enjoyed that. I enjoyed that. rate. Okay, 在所有臀部条件之外。伟大的。是的。 你喜欢那个。我很喜欢。速度。好的，
so that's about the nested if one more thing that I have already told you, but just let 所以这就是关于嵌套的，如果我已经 告诉过你的另一件事，但只是让
me tell you the power of indentation. You are here for example, in this particular if 我告诉你缩进的力量。例如，您 在这里，在这种情况下，如果
condition, that's the if condition and that's the nested if, and that's the else part of 条件，那是 if 条件，那是嵌套 的 if，那是 else 部分
this if if you move this L sport in in the indentation or the alignment with this if 如果您将这个 L 运动移入 缩进或与此对齐，如果
then this is else part of this if and this is not the else part of this If so, remember 那么这就是这个 if 的 else 部分，这不是 这个 if 的 else 部分 如果是这样，记住
the power of indentation the this is the indentation that defines which part belongs to what what 缩进的力量 this 是定义哪个 部分属于什么的缩进
kind of block or structure in Python. In other languages. Sometimes, for example, in c++, Python 中的一种块或结构。在其他语言 中。有时，例如，在 c++ 中，
they they normally use to write these curly brackets to define a block and their indentation 他们通常用来写这些大括号 来定义一个块和它们的缩进
doesn't really matter. But in Python, this is the indentation that actually defines each 真的没有关系。但是在 Python 中 ，这是实际定义每个的缩进
and everything. So, for example, this is a crucial example if this else just moves backwards 和所有。因此，例如，如果 else 只是 向后移动，则这是一个关键示例
and aligned with this f you get this else with this if these two if an L structures, 并与此对齐 如果这两个如果是 L 结构，则您将得到此 else，
this is still nested if without an L sport. And if this else move somewhere in between 如果没有 L 运动，这仍然是嵌套 的。如果这在两者之间移动
I mean this is not aligned with this if this not aligned with this if you get a syntax 我的意思是如果你得到一个语法，这与 this 不一致，如果 this 与 this 不一致
error because that is not a proper indentation. So focus on indentation that is really really 错误，因为这不是正确的缩进。 所以专注于缩进，这是真的
important. Yeah, so although i have i've told you that the indentation has already told 重要的。是的，所以虽然我已经 告诉过你缩进已经告诉你了
you but I just I just found to make a slide over this elsewhere because that's important. 你，但我只是我刚刚发现在其他地方 制作幻灯片，因为这很重要。
Sometimes you may get confused whether this else belongs to this F or that F Well, the 有时你可能会困惑这个 else 是属于这个 F 还是那个 F
indentation defines this LS belong to what? Okay, I end this 缩进定义了这个LS属于什么？好的， 我结束这个
control flow indentation here. So from next video we are jumping toward loops. But before 控制流缩进在这里。因此，从下一个 视频开始，我们将跳向循环。但之前
loops, I just want to I just want to write a lengthy program in F LS f there are combinations. 循环，我只想我只想在 F LS 中 编写一个冗长的程序 f 有组合。
I just want to write a Jupiter program for you to to get comfortable with F nested f 我只想写一个 Jupiter 程序 让你熟悉 F 嵌套 f
the conditions that are ands and ORS and nots are stuff like so. So So in the next video ands 和 ORS 和 nots 的条件是这样 的。所以在下一个视频中
we will be practicing more on Jupiter for if conditions and then from the next to next 我们将在木星上练习更多的 if 条件，然后从下一个到下一个
video. We'll be jumping toward loops, the very very powerful structure. Okay. Hope to 视频。我们将跳向循环，这是 非常强大的结构。好的。希望
see you in the next video. Okay, so let's just practice this if condition a little bit 下个视频见。好的，让我们 稍微练习一下 if 条件
more in this particular video and we are going to achieve particular tasks. So let's design 更多在这个特定的视频中，我们将完成 特定的任务。所以让我们设计
some task here. By the way, this has comment, comment, comment is, it starts from a hash 这里有一些任务。顺便说一句，这有评论 ，评论，评论是，它从哈希开始
symbol. And that's a statement that will never be executed. This just describes your code, 象征。这是一个永远不会被执行的 语句。这只是描述你的代码，
for example. So like it, like, it is not there. But it is there as a text, but not as a code 例如。所以喜欢它，就像，它不存在。但 它作为文本存在，而不是作为代码
file. Like hash sometimes represents. Comment or description with a single line. If your 文件。像哈希有时代表。单行 注释或描述。如果你的
comment goes on multiple lines, it is good to write a multi line comment. So that's single 注释是多行的，最好写 多行注释。所以是单身
line comment, for example, single line comment, the multi line comments, they start with three 行注释，例如单行注释，多 行注释，它们以三个开头
quotes, and then end with three chords. So whatever you write inside, in these, in this 引号，然后以三个和弦结束。所以无论 你在里面写什么，在这些，在这个
particular block, that's a multi line comment. So let's describe our problem in this modal 特定块，这是一个多行注释。所以让我们 用这个模态来描述我们的问题
line comments, because that's the problem in form of text. And then we will be solving 行注释，因为这是文本形式 的问题。然后我们将解决
that problem using using the code. So that's just description of the problem, let's say 使用代码的问题。所以这只 是问题的描述，让我们说
user will enter of loading point number. Number, let's say 230 8.915. Let's see. Okay, your 用户将输入装载点编号。数字，比方说 230 8.915。让我们来看看。好的，你的
task is, is to so let's just adjust more readable, your task is to 任务是，所以让我们调整更具可读性， 你的任务是
find out the teacher integer, portion, integer portion, before the decimal before the point, 找出老师整数，部分，整数 部分，小数点之前，
let's say for the for the point, in this case, in this case, it is 238. And then, 让我们说对于这个点，在这种情况下，在这 种情况下，它是 238。然后，
and 和
and then check whether if that teacher portion is and even number or not. So just print yes 然后检查那个老师部分是否 是偶数。所以只需打印 yes
or no. So print even if it is even number, otherwise, print odd. So that's the that's 或没有。所以即使是偶数也打印， 否则打印奇数。所以这就是那个
the problem statement. That's the problem that we are going to solve. And this is just 问题陈述。这就是我们要 解决的问题。而这只是
to commit now we are outside the command that's a multi line comment. Yeah, so how to how 现在提交我们在多行注释的命令 之外。是的，所以如何如何
to solve that problem? How to solve that problem? So let's start solving this problem. I'm going 解决那个问题？如何解决这个问题？那么 让我们开始解决这个问题。我要去
to spend some time on this program just to get comfortable with the if conditions, let's 花一些时间在这个程序上只 是为了适应 if 条件，让我们
say let's say that number is x is input, let me convert that input 假设数字是 x 是输入，让我 转换该输入
into our 进入我们的
real number. That's it. Okay, we're just assuming that the user will enter a real number. It's 实数。就是这样。好的，我们只是假设 用户将输入一个实数。它是
real number. real number might be I mean to 38.0, that's a real number or 238 itself, 实数。实数可能是我的意思是 38.0， 那是一个实数或 238 本身，
that's also real number. That's okay. But we're not assuming that the user will enter, 这也是实数。没关系。但 我们不假设用户会进入，
let's say some characters like ABC or stuff like sort of just just assuming that. Okay, 让我们说一些像 ABC 这样的字符或 类似的东西只是假设。好的，
now, assume that x contains real number, it may be an integer. By default, maybe user 现在，假设 x 包含实数，它可能是一 个整数。默认情况下，也许用户
just enters 10. And that's it. So it may be already an integer, then we have to check 只需输入 10。就是这样。所以它可能已经 是一个整数，那么我们必须检查
whether that 10 is whether that 10 is even or not, or the user may enter 11.7, or the 无论那个10是那个10是偶数还是不 是，或者用户可以输入11.7，或者
user may enter minus 34.7. Or the user may enter just zero or user may enter just zero 用户可以输入负 34.7。或者用户可以 只输入零或者用户可以只输入零
point 30 535. There are a lot of possibilities that a user come up with this exe can contain 点 30 535. 用户想出的这个 exe 可以包含很多可能性
any kind of number, and we have to check according to. So how can we move let us just see, whether 任何一种数字，我们都要根据它来检查。 那么我们如何移动让我们看看，是否
that number let us just extract the decimal portion, the portion before point. Let's just 这个数字让我们只提取小数部分 ，即点之前的部分。让我们只是
extract that how can we extract that there are two conditions First of all, let's see 提取那个我们怎么提取 有两个条件首先我们看
if x is positive, then do what else do what? So let's try this structure first. The facts 如果 x 是正数，那么还做什么做什么 ？所以让我们先试试这个结构。事实
is positive, then what we have to do? And if x is negative, then what we have to do? 是积极的，那我们该怎么办？如果 x 是负数，那我们该怎么办？
So if x is positive, then what we do? We, we just so, what should we do? I'm just stuck 那么如果 x 是正数，那么我们该怎么办？我们 ，我们就是这样，我们该怎么办？我只是卡住了
here. How can we extract the, the decimal portion, the portion without this particular 这里。我们如何提取小数部分 ，没有这个特殊的部分
thing? How can we extract that? That's, that's tricky. That's kind of tricky. Yeah. So any, 事物？我们如何提取它？也就是说，这很 棘手。这有点棘手。是的。所以任何，
any ideas? I guess this? The the structure I have, I'm using the let us just first think 有任何想法吗？我猜这个？我拥有 的结构，我正在使用让我们先想想
that x is positive, just make our life easier. And then if x is positive, it's a positive x 是正数，只是让我们的生活更轻松。 然后如果 x 是正数，它就是正数
number. How can we extract this portion out? Just the number that is below? That is before 数字。我们怎样才能把这部分提取 出来？只是下面的数字？那是之前
the decimal point, but what should we do? can we can we can we apply apply around function? 小数点，但我们该怎么办？我们可以 我们可以在函数周围应用应用吗？
Will that help? x? Will that help? helps. Yes. But no round function? So let's say y 那会有帮助吗？ X？那会有帮助吗？有帮助 。是的。但是没有圆函数？所以让我们说 y
contains the rounded value of x then, so what? Then how can extract How can we extract the 那么包含 x 的舍入值，那又怎样 ？那么如何提取我们如何提取
the the decimal portion, the portion the integer portion? Or maybe there is a function that 小数部分，整数部分？或者 也许有一个函数
actually round down? Let me check whether there is a function float or not? No, float 实际上四舍五入？让我检查一下 是否有函数 float ？不，漂浮
is not a function, I guess. So let's say round x. Okay, now y contains the rounded vol value 不是一个函数，我猜。所以让我们说第x轮 。好的，现在 y 包含四舍五入的 vol 值
forever the Xs we are now assuming that x is positive, okay, then what? Now, if, if 永远是我们现在假设 x 为正的 X，好 吧，然后呢？现在，如果，如果
y is larger than x, that means we moved up. Okay, we moved up, the round goes up. In that y 大于 x，这意味着我们向上移动。好 的，我们上升了，回合上升。在那里面
case, what we do is we just subtract. So the let me so we just subtract the integer portion. 情况下，我们所做的只是减去。所以 让我所以我们只减去整数部分。
So the let me in teacher portion, let's say that's our variable name, then the integer 所以让我在老师部分，假设这是 我们的变量名，然后是整数
portion is simply y minus one is that correct? Is that correct? If y is larger than x, then 部分只是 y 减 1 是正确的吗？那 是对的吗？如果 y 大于 x，则
integer portion is simply y minus one. For example, for example, just Just think about 整数部分只是 y 减一。 例如，例如，只是想想
it, if When, when, for example, if the value was 29.6, and the rounded value will become 它，如果当，当，例如，如果值 为 29.6，则四舍五入的值将变为
30, so 30 minus one will be 29. There is what we are what we are interested in. So, yeah, 30，所以 30 减 1 就是 29。这就是我们 感兴趣的东西。所以，是的，
so otherwise, if for example, else, else, if y is not larger than x, then y itself is 所以否则，如果例如，else，else， 如果 y 不大于 x，那么 y 本身就是
an integer portion. 整数部分。
Y itself is an integer portion. Is that correct? I mean, is that making sense to you? That Y 本身是一个整数部分。那是对的吗？我 的意思是，这对你有意义吗？那
if for example, if if x is larger than effects, larger than if the rounded value of x is larger 例如，如果 x 大于效果，则 大于如果 x 的舍入值更大
than larger than x itself, then we just subtract one and we get the proportion. Otherwise, 比大于 x 本身，那么我们只需减去 1 就可以得到比例。除此以外，
the rounded value itself is the portion, just just let's just run this, run this code for 舍入后的值本身就是部分，只是 让我们运行它，运行此代码
now and check whether what whatever we have done so far is correct or not. So after that, 现在检查我们到目前为止所做的 一切是否正确。所以在那之后，
just print, let's say the integer portion. And teacher portion, let's just print that. 只是打印，让我们说整数部分。 和老师部分，让我们打印出来。
Okay. So enter a number. Let's say the number is, let's say 25.3 45.367. Let's say, obviously, 好的。所以输入一个数字。假设数字 是 25.3 45.367。让我们说，显然，
the integer portion here is 25. So let's say let's see our program returns 25. And now 这里的整数部分是 25。所以让我们 看看我们的程序返回 25。现在
Oh, the result is 25. magically Oh my god. We found 25. Let's run it again. Let's run 哦，结果是 25。神奇地哦，我的天啊。我们 找到了 25。让我们再次运行它。让我们跑
it again. Just to see. Okay, let's run this again. And order this time let's give it to 再说一遍。只是看看。好的，让我们再运行 一​​次。这次下令让我们把它交给
45.8. Okay, the integer portion is 45. But when we will round We will get to 46 and 46 45.8.好的，整数部分是 45。但是当我们 四舍五入时，我们将得到 46 和 46
minus one, we will dive into this particular if condition. Let's see. All the result is 减一，我们将深入研究这个特殊的 if 条件 。让我们来看看。所有的结果都是
45. We are we are still moving very bill. Great. That's, that's great. So, okay, let's 45.我们是我们仍然非常法案。伟大的 。那个，太好了。所以，好吧，让我们
play with it. Let's, let's give, let's give 0.2 the result should be zero, it is zero, 玩它。让我们，让我们给，让我们 给 0.2 结果应该是零，它是零，
right? Let's run it again and give it let's see, let's say four. That's it, the result 对？让我们再次运行它，让我们看看 ，让我们说四个。就是这样，结果
should be four now, it is four. Great. So, we are working very well we have extracted 现在应该是四个，它是四个。伟大的。所以 ，我们工作得很好，我们已经提取了
the integer portion as long as the number was positive. Okay, right. What if the number 整数部分，只要数字是正数 。好吧，对了。如果数怎么办
will be negative? Let's say that was true, if that was true, so, that whole logic works, 会是负的吗？假设那是真的，如果 那是真的，那么整个逻辑都有效，
if x was positive, so if x is positive, then whole this logic just works okay, then else 如果 x 是正数，那么如果 x 是正数，那么 整个逻辑就可以正常工作，否则
What should we do? If x is positive, then this logic works effects is not positive, 我们应该做什么？如果 x 是正的，那么 这个逻辑的作用效果不是正的，
then what will happen? Then how can we find out the integer portion because first we have 那么会发生什么呢？那么我们如何 找出整数部分，因为首先我们有
to find out the integer portion and then we have to find out whether they are integer 找出整数部分，然后我们必须 找出它们是否是整数
portion is even or not finding out whether they are indeed a portion is even or not might 部分是偶数或不知道它们是否 确实是 部分是偶数 可能
be simpler. But first, we have to find out the integer portion. So for example, let's 简单点。但首先，我们必须找出 整数部分。例如，让我们
check the behavior of round function on negative numbers, let's say around minus 9.3. So the 检查圆形函数对负数的行为， 假设在负 9.3 左右。所以
result is minus nine. Okay? If we say okay, round, minus 9.6, the result will be minus 结果是负九。好的？如果我们说 好，圆，负 9.6，结果将是负
10. So it looks like the same as working in the positive numbers. So round function is 10. 所以它看起来和在正数下 工作一样。所以圆函数是
actually working roughly the same way it should work in the positive numbers. Okay. So what 实际上的工作方式与它在正数下的工作 方式大致相同。好的。所以呢
should we do here? Any idea? Maybe, maybe we first convert? Maybe you first convert, 我们应该在这里做什么？任何的想法？也许 ，也许我们先转换？也许你首先转换，
by the way? Yeah, maybe first convert the number, let's say y equals around x again, 顺便一提？是的，也许首先转换 数字，假设 y 再次等于 x 左右，
like before, but then what? Then what? So maybe this rounding helps the same way? Maybe 像以前一样，但是然后呢？然后呢？所以 也许这个四舍五入有同样的帮助？也许
the rounding helps the same way. We should extract this out from this here, because it 四舍五入也有同样的帮助。我们 应该从这里提取出来，因为它
is going to work in the else part as well, why to compute it, why white write this redundant 也将在其他部分工作，为什么 要计算它，为什么要写这个多余的
code? So why is round x let's say then if y is greater than x, what should we do? If 代码？那么为什么是轮 x 比方说如果 y 大于 x，我们应该怎么做？如果
it is negative y is greater than then what would what will be the portion? It will be 它是负 y 大于那么什么 将是什么部分？这将是
the integer portion will be portion will be what? 整数部分将是什么？
y minus one or one? y plus one? Yes, you got the answer? That's y plus one. Great. And y 减一还是一？你加一？是的，你得到答案 了吗？那就是你加一。伟大的。和
else I guess we have in future portion. Equals Whitesell, I guess, yes, I guess that's the 否则我想我们在未来的部分。等于 Whitesell， 我猜，是的，我猜这就是
that's the good. That's cool. I guess that's checked, by the way, but I guess that's the 这就是好处。这很酷。顺便说一下， 我想这是检查过的，但我想这就是
code. By the way, this else part is, this else part is same in both of these conditions. 代码。顺便说一下，这个 else 部分是， 这个 else 部分在这两个条件下都是相同的。
So maybe, maybe we can combine this code and write a more elegant code, but I guess this 所以也许，也许我们可以结合这段代码 ，写一个更优雅的代码，但我猜这个
would work. Let us just print the integer portion, just to check whether we are working 会工作。让我们打印整数部分 ，只是为了检查我们是否在工作
well, so far or not. So let's enter let's see 12.3 The result is 12th grade. So it did 好吧，到目前为止与否。所以让我们进入让 我们看看12.3 结果是12年级。所以它做到了
not change our previous I guess our previous logic. So let's say there is minus 9.8. Now 不改变我们以前的我猜我们以前的 逻辑。所以假设有负 9.8。现在
the integer portion should be minus nine, oh, it is returning 10 Why is that? Why is 整数部分应该是负九，哦，是返回 10，这是为什么呢？为什么是
that? Oh my God, this should be changed when it is round. It may go that way or when it 那？哦，天哪，这应该是圆的时候 改变的。它可能会这样或当它
rounds it actually becomes lesser than 10. Because when it rounds it goes up and it becomes rounds 它实际上变得小于 10。 因为当它舍入时它会上升并变成
lesser than a negative word. This condition should flip. Yeah. So we are making an error 小于一个否定词。这种情况应该翻转 。是的。所以我们犯了一个错误
here. Let's fix that. Okay, let's run this again. And see Let's say minus nine point 这里。让我们解决这个问题。好的，让我们 再运行一​​次。看看让我们说减去九分
minus nine d 3.2. Minus 93. Great. So then we have let's see, let's run it again. Minus 减九 d 3.2。减去 93。太好了。那么我们 让我们看看，让我们再次运行它。减
8.9. minus eight. Yes, we are working perfectly fine. Once we have integer portion with us, 8.9.减八。是的，我们工作得很好 。一旦我们有了整数部分，
we just right here. At the very end if integer portion is your portion, remainder with two, 我们就在这里。最后，如果整数 部分是你的部分，余数为二，
if that equals to zero, if that equals to zero, Brent, even, otherwise, else, brand. 如果等于零，如果等于零，布伦特 ，甚至，否则，否则，品牌。
Art. That's it. That's the whole program. Let's see. And let's see, how is it running? 艺术。就是这样。这就是整个程序。让我们 来看看。让我们看看，它是如何运行的？
Let's say 22.6. It's even, let's say minus 87.3. That's odd rate. So you see the power, 假设 22.6。它是偶数，比方说负 87.3。 那是奇数。所以你看到了力量，
if condition and, and how can we think in writing these programs and stuff like so? 如果条件和，以及我们如何在编写这些 程序和诸如此类的东西时进行思考？
That was a lengthier video, I know. But I guess you get a very good look and feel of, 那是一个更长的视频，我知道。但我 想你会得到一个很好的外观和感觉，
of if conditions and thinking and building logic and all that stuff. So in the next video, if 条件、思考和构建逻辑等等 。所以在下一个视频中，
we will start loops. So that's a beautiful structure, hope to see you in the next video, 我们将开始循环。所以这是一个美丽 的结构，希望在下一个视频中见到你，
the best way to understand loops is to think about in a repetitive structure or repeating 理解循环的最好方法是在 重复的结构中思考或重复
structure. Let me let me give you an example. And they will, we will dive into this code 结构体。让我给你举个例子。他们 会，我们将深入研究这段代码
in a while. The example is let's say a user gives you a number, let's say integer number. 等一下。这个例子是假设用户给 了你一个数字，假设是整数。
And you want to print all the numbers till that number, let's say you start from one, 你想打印所有数字直到那个 数字，假设你从一个开始，
and you keep on moving and printing all the numbers, as long as you reach that number. 只要你达到那个数字，你就会 继续移动并打印所有数字。
So for example, if user enters, let's say, five, your goal is to print one, then print 例如，如果用户输入，比方说，五 ，您的目标是打印一个，然后打印
two, then print three, then print four, and then stops, then stop just or, let's say if 二，然后打印三，然后打印四，然后 停止，然后停止，或者，假设
user print, if user enter, let's say, three, then you print one, you print two, and then 用户打印，如果用户输入，比方说，三个 ，那么你打印一个，你打印两个，然后
you stop. This is easy. If user enters in n, we can just print, we could have written 你停下来。这很简单。如果用户输入 n，我们就可以打印，我们可以写
this thing, print. Brent, I, let's initialize a variable by with one, Brent I, and then 这个东西，打印。 Brent, I，让我们用一 个 Brent I 初始化一个变量，然后
I equals two i plus one, or in Python, we can write this quickly as i plus equals to I 等于 2 i 加 1，或者在 Python 中，我们 可以快速编写它，因为 i plus 等于
one that means I 一个意味着我
that means in I store a plus one, this is the short form of writing this. And then after 这意味着在我存储一个加一，这 是写这个的简短形式。然后之后
that, you just apply an if condition. For example, here, you can apply an if condition 那，你只需应用一个 if 条件。例如 ，在这里，您可以应用 if 条件
and say, Okay, if I is smaller than n, you keep on printing, and after printing, you 然后说，好吧，如果我小于 n， 你继续打印，打印后，你
just increment again this, then check the if condition and keep on moving. Well, that 只需再次增加这个，然后检查 if 条件并继续前进。那么，那个
is visible if n is five, or n is three, what if if n is let's say, if t 1000. In I mean, 如果 n 是 5，或者 n 是 3，那么是可见的，如果 n 是比方说，如果 t 1000。我的意思是，
you're writing all that structure again, and again. And again. I mean, that's a lot of 你一遍又一遍地编写所有这些结构。然后 再次。我的意思是，这是很多
code. Well, the loops are just a solution for this kind of structure when you want to 代码。好吧，当您想要时，循环 只是这种结构的解决方案
perform the same kind of task again, and again, the loop gives you the facility to do that. 再次执行相同类型的任务，循环再次 为您提供执行此操作的便利。
For example, let's just consider the VI loop. This is again a condition similar like a condition 例如，让我们只考虑 VI 循环。 这又是一个类似于条件的条件
in if condition like an if condition, you evaluate this Boolean expression, then that's 在像 if 条件一样的 if 条件中， 你计算这个布尔表达式，然后就是
an expression that results a boolean value. While this condition is true, you will stay 结果为布尔值的表达式。当 此条件成立时，您将留下
in this block and after executing whole block once you check this condition again, if this 在这个块中，一旦你再次检查这个条件 ，在执行整个块之后，如果这个
condition is again true, you will dive into this block again. Then check the condition 条件再次为真，您将再次潜入 此块。然后检查条件
dive into the block then check the condition dive into the block. As long as this condition 潜入块然后检查条件潜入 块。只要这个条件
stays true, you stay in the block you you move inside the block. Once this condition 保持真实，你留在块中，你 在块内移动。一旦这个条件
is false, then you exit this while loop then the loop terminates and you move on to the 为假，然后退出此 while 循环，然后 循环终止，然后继续执行
further processing just like an if condition just like if conditions if if the condition 进一步处理就像 if 条件 一样 if 条件 if if
becomes false, you accept that if condition and you can move on, moved on. So in this 变为假，您接受如果条件并且您可以 继续前进，继续前进。所以在这个
particular case, for example, if n is five, let's say if n is five, user give an integer 特殊情况，例如，如果 n 是 5， 假设 n 是 5，用户给出一个整数
number that is five I is equal to one, now one is smaller than five, the condition is 5 的数 I 等于 1，现在 1 小于 5，条件是
true, we move inside, you print I, the value of i is one. So that's what you print, you 真的，我们往里面移动，你打印 I，i 的 值是 1。所以这就是你打印的，你
print one, then you change a, you increment i with one, that means i equals i plus one, 打印一个，然后你改变一个，你用 1 增加 i，这意味着 i 等于 i 加 1，
so I becomes two. Now the body of the loop finishes, that's whole body of the loop, the 所以我变成了两个。现在循环的主体 完成了，这就是循环的整个主体，
body of the loop can have many, many statements, a whole block of code. Once I becomes two, 循环体可以有很多很多语句，一整块 代码。一旦我变成两个，
you move on and you check, okay? Two is smaller than five, yes, it is true, you move inside 你继续检查，好吗？二小于五， 是的，是真的，你往里走
the block again, you print two, then you update I, the loop body finishes. Once the loop body 再次块，打印两个，然后更新 I， 循环体完成。一旦循环体
finishes, you go and check the condition again, whether that condition is still true or not, 完成后，您再去检查条件， 该条件是否仍然为真，
it is still true i is three i is three is smaller than five, yes, you move inside, you 我是三我是三比五小， 是的，你搬进去，你
print three, you update, I, you check the condition four is smaller than five, yes, 打印三，你更新，我，你检查 条件四小于五，是的，
you move inside you print four, and then you update I and then you move on now five is 你在里面移动你打印四，然后你 更新 I 然后你继续现在五是
smaller than five false. Once the condition is false, you will not dive into the body 小于五假。一旦条件为假 ，你就不会潜入体内
of the loop, you will exit the loop and you will print done. And that's it done. So this 在循环中，您将退出循环并打印 完成。就这样完成了。所以这
loop becomes very, very, very handy. In in, in, in applications that have representative 循环变得非常、非常、非常方便 。在具有代表性的应用程序中
structures. And in most of the interesting programs, most of the interesting problems, 结构。而在大多数有趣的程序 中，大多数有趣的问题，
these are the loops that play a very huge role. So let's go to Jupiter just to get our 这些是发挥非常重要作用的循环。所以 让我们去木星只是为了得到我们的
hands, get our hands on this loop. For example, let's say x is again, that's the end or n, 手，把我们的手放在这个循环上。例如 ，假设 x 又是，那是结束或 n，
let's take n and is in input. Let me make this a little bigger, just do. Let's say that 让我们取 n 并输入。让我把它 弄大一点，就去做吧。让我们说
input and input is a number, let's say n i is your surgeon, let's say let's say one, input 和 input 是一个数字，假设 n 我是 你的外科医生，假设我们说一个，
while I is smaller than n, you may have written this parenthesis just to just to create the 当 I 小于 n 时，您可能已经写 了这个括号只是为了创建
readability just to make readability. And otherwise I mean, this is also Okay, that's 可读性只是为了提高可读性。否则 我的意思是，这也可以，那就是
perfectly fine. If as long as I is smaller than n, keep doing the following you what 完全没问题。如果只要我小于 n，继续做下面的你什么
you do is bring, for example, the square of I paint the square of I, that the square of 你做的是带来，例如，我的正方 形画了我的正方形，那个正方形
it, let's say, and then you say, Grant, for example. This is a question number. And then 它，让我们说，然后你说，格兰特 ，例如。这是一个问题编号。进而
you just print I, that's the iteration number I have the loop. 你只要打印 I，那是我有循环的 迭代数。
That's the equation number I this is just the spring, this is just a string. And that's 那是方程式编号我这只是弹簧 ，这只是一个字符串。那就是
our variable, its value will be printed. This print function takes as many arguments as 我们的变量，它的值将被打印出来。这个 打印函数接受尽可能多的参数
you pass. So you can you can write a comma here and continue whatever you want to print. 你过关了。所以你可以在这里写一个 逗号，然后继续你想打印的任何内容。
That's very flexible function. Okay, then what you do you say, Okay, I plus equals to 这是非常灵活的功能。好吧， 那你说什么，好吧，我加等于
one. By the way, this i plus equals to one is the same as i equals i plus one. You see, 一。顺便说一下，这个 i 加等于 1 和 i 等于 i 加 1 是一样的。你看，
I have just commented here just to explain what this is doing. If I just write i equals 我刚刚在这里发表评论只是为了解释 这是在做什么。如果我只写 i 等于
i plus one that is also that is also correct in Python, but that's kind of shorthand. Okay. 我加上一个在 Python 中也是正确 的，但这是一种速记。好的。
And that's it. Now, again, when I de indent, I'm outside the loop, let's say sprint. Loop 就是这样。现在，再一次，当我缩进时 ，我在循环之外，比如说冲刺。环形
done, for example. So that's the code for example. So let's run this code. Let's run 完成，例如。这就是例如代码。所以 让我们运行这段代码。让我们跑
this code. For example. Let's say n is equal to five, then we have five. So this is one, 这段代码。例如。假设 n 等于 5， 那么我们有 5。所以这是一个，
this is the aggression number one, then two square is four, this is the aggression number 这是侵略数字一，然后二个 正方形是四，这是侵略数字
two, then three squared is nine, the aggression number three, then four square is 16. This 二，然后三的平方是九，侵略数字 三，然后四的平方是 16。这个
is the iteration number four, and then the loop finishes. That's it. That's the first 是第四次迭代，然后循环结束 。就是这样。这是第一个
snapshot of the loop. We will continue from here onwards in the next video and I will 循环的快照。我们将在下一个 视频中从这里开始，我会
show you more and more flavors of this loop. So hold on and wait for the next video. Okay, 向您展示这个循环越来越多的味道。所以 请稍等，等待下一个视频。好的，
in the previous video, we saw a while loop and we saw one. One program related to while 在上一个视频中，我们看到了一个 while 循环 ，我们看到了一个。一个与 while 相关的程序
loop, just printing Just printing a bunch of numbers till a particular number. Well, 循环，只是打印 只是打印一堆数字 直到一个特定的数字。好，
when you are inside the body of the loop, that's a whole new you can write whatever 当你在循环体内时，这是一 个全新的你可以写任何东西
you want to write, for example, you can you can apply an if condition inside the body 你想写，例如，你可以在 正文中应用一个 if 条件
and check that an at each iteration a particular decision should be made or not. For example, 并检查在每次迭代中是否应该 做出特定决定。例如，
in this particular case, I'm going to print I whenever I is an even number, so, I is some 在这种特殊情况下，只要我是偶数 ，我就会打印 I，所以，我是一些
number if it is even then printed, else pass this pass statement for example, is just a number 如果它是偶数然后打印，否则通过 这个 pass 语句，例如，只是一个
statement of saying that do nothing It is just a shortcut of writing do nothing we could 什么都不做的声明这只是写作 的捷径，我们什么都不做
have we could have omitted the whole else part along with this pass and still the code 我们是否可以省略整个 else 部分 以及这个 pass 并且仍然是代码
is equivalent but sometimes writing this past make the code readable just so so writing 是等价的，但有时写过去 会使代码可读，所以写
this boss statement just means do nothing and just move on. If we omit else statement, 这个老板的声明只是意味着什么都不做 ，继续前进。如果我们省略 else 语句，
and we omit this boss, that's perfectly okay. So, for example, let's try it on the score. 我们省略了这个老板，这完全没问题。因此 ，例如，让我们在乐谱上尝试一下。
Let's say n is let's say n is five i equals one one is less than five Yes, one is not 假设 n 是假设 n 是 5 i 等于 1 小于 5 是的，1 不是
an even number. So go to the else part else means boss, which means go on and then increment 偶数。所以转到 else 部分 else 意味 着老板，这意味着继续然后递增
i this print statement is outside the loop this is this is aligned with this while it's 我这个打印语句在循环之外 这是与这个对齐的，而它是
not inside the body of the loop otherwise, it should have been intent indented inside 否则不在循环体内， 它应该在内部缩进
now i is incremented I becomes to now move back to is smaller than five years. Two remainder 现在我增加了我变成现在 回到小于五年。二余
two is zero Yes. So brand two, so two will be printed. Because if executed else will 二是零 是的。所以品牌二，所以两个 将被印刷。因为如果执行 else 会
not execute and I will increment because I is not inside the if condition it is inside 不执行，我将递增，因为 我不在 if 条件内
the body of the loop. So I incremented I becomes three you go back, three is smaller than five 循环体。所以我增加了我变成 三你回去，三比五小
years. Three, remainder with two is zero false. So pass i i plus one, so I becomes four, four 年。三、余数为二为零假。所以通过 我我加一，所以我变成四，四
is smaller than five years for remainder two is zero, yes, so Brent four. So else will 小于五年，余数二为零，是的， 所以布伦特四。所以否则会
not execute now increment i, once you increment i you get, for example, I equals five, now 现在不执行增量 i，一旦你增加 i，你 就会得到，例如，I 等于 5，现在
five is smaller than five false, so you go out of the loop and you print down. And that's 五小于五假，所以你退出 循环并打印下来。那就是
what this code is. So, you can have if condition inside the loop, you can have nested if inside 这段代码是什么。因此，您可以在循环 内使用 if 条件，也可以在 if 内嵌套
the loop 循环
you can have loop inside the loop nested loops, we will see examples of nested loops as well. 您可以在循环嵌套循环中使用循环， 我们还将看到嵌套循环的示例。
I mean, that's that's all allowed are sometimes rarely required. Okay. So, next there are 我的意思是，这就是允许的，有时很少 需要。好的。那么，接下来有
two important statements that are there, one is break one is continue, I want to focus 有两个重要的声明，一个是中断， 一个是继续，我想集中注意力
these statements because they have a deep link with loops. A break statement where ever 这些语句是因为它们与循环有很 深的联系。任何地方的 break 语句
written inside the body of the loop tells that exit the loop immediately whenever this 写在循环体内部告诉我们， 每当这个时候立即退出循环
brake is encountered, whenever this brake executes, it exits the loop immediately and 遇到刹车，每当执行此刹车 时，它立即退出循环并
brings you outside the body of the loop. That's what it does break. So for example, if I becomes 将您带到循环体之外。这就是 它的破坏。例如，如果我变成
if I becomes divisible by 17 and the remainder becomes zero, you will print a break and then 如果 I 可以被 17 整除而余数变 为 0，您将打印一个 break 然后
when this break statement will execute you will exit the loop immediately regardless 当这个 break 语句执行时 ，你将立即退出循环
of what is the value of AI What are other states wherever break exits the loop Okay AI 的价值是什么 中断退出循环 的其他状态是什么 好的
great. Now, the continue continue statements continue statement wherever encountered continue 伟大的。现在，在任何遇到 continue 的 地方， continue continue 语句 continue 语句
brings the next iteration loaded regardless of the remaining remaining statements in the 无论剩余的剩余语句如何 ，都会加载下一次迭代
loop for example, when this continue will be executed, no matter how many statements 循环例如，当这个 continue 将 被执行时，无论有多少语句
are there onwards that are there, in the body of the loop, the loop will not finish its 有没有在那里，在循环体 中，循环不会完成它的
iterations iteration by going through all the remaining statements, but it will start 迭代通过遍历所有剩余的语句 进行迭代，但它将开始
another iteration immediately. So continue basically skips the remaining body of the 立即进行另一次迭代。所以 continue 基本上跳过了剩余的正文
loop and starts another iteration. Here I have written this. true true means while true 循环并开始另一个迭代。我在这里 写了这个。 true true 意思是 true
means always run. You might be thinking always run it's an infinite loop will it will it 意味着总是运行。你可能会想总是 运行它是一个无限循环会吗
when we will exit the loop because this true statement will always stay true. We're not 当我们退出循环时，因为这个 true 语句将始终保持 true。不是
changing this true anymore. There is no condition here. That's true. While true means always 改变这真的了。这里没有条件。确实 如此。虽然 true 意味着总是
go inside the loop but once where whenever this Break his encounter, you're outside the 进入循环，但是一旦遇到这个 Break 他，你就在循环之外
loop right away. And this break exists, the loop does continue skips the remaining remaining 立即循环。并且此中断存在，循环 确实继续跳过剩余的剩余部分
portion of the loop body and starts the new iteration starts another iteration. So this 循环体的一部分并开始新的迭代 开始另一个迭代。所以这
continue means start another iteration immediately skip the rest of the stress of the statements. continue 意味着立即开始另一个迭代 ，跳过语句的其余部分。
So the rest of the statements inside the loop body. Okay, so let's just practice this break 所以循环体内的其余语句。好的 ，让我们练习一下这个休息时间
and continue with just just in Jupyter Notebook to get a better look and feel of the loop. 并仅在 Jupyter Notebook 中继续，以获得 更好的循环外观和感觉。
So let's say we have, let's say again, let's say n equals let's say 10. Or we might have 所以假设我们有，让我们再说一次， 假设 n 等于 10。或者我们可能有
taken that as an input, let's say n is equal to 10. While true, which means keep moving, 将其作为输入，假设 n 等于 10。虽然 为真，这意味着继续前进，
it might have taken some value here, I equals, let's say one, while true, if I remainder 它可能在这里取得了一些价值，我等于，让 我们说一个，而真实的，如果我余数
with, let's say, nine, if that is equal to zero, then just break the loop tells ELS. 比方说，九，如果它等于零， 那么只需打破循环告诉 ELS。
Else, what you do is really you increment a else what you do is, if I is if I is not 否则，你所做的实际上是你增加一个 else 你所做的是，如果我是，如果我不是
divisible by nine, then what you do is i equals i plus one, that's true. By the way, previously, 能被九整除，那么你所做的就是 i 等于 i 加 1，这是真的。顺便说一下，以前，
we we have written this way. So either way is fine, whether you write a short form or 我们是这样写的。所以无论 你写一个简短的表格还是
this form, so else this okay. And that's, that's it, the loop finishes. That's the loop. 这种形式，所以其他这没关系。就 是这样，循环结束。这就是循环。
After the loop, you just write Okay, print, the loop is done. So let's see, what's the 循环后，你只要写好，打印，循环就 完成了。那么让我们看看是什么
output? The output is done straightaway. And the reason is, why it is Oh, one is not one 输出？输出是直接完成的。原因是 ，为什么是 哦，一个不是一个
is divisible by nine, only then you could have break. While true. Why? Why the loop? 可以被九整除，只有这样你才能打破。 虽然是真的。为什么？为什么是循环？
Oh, it does not print anything, we could have printed some statements so that we know that 哦，它不打印任何东西，我们可以 打印一些语句，以便我们知道
we went inside the loop or not. Okay, so inside, if so, for example, Brent. 我们是否进入了循环。好的，所以在里面，如果 是这样，例如，布伦特。
Inside else. So let's run this again. Oh, okay, great, inside sales, inside sales inside 别的里面。所以让我们再次运行它。 哦，好的，很好，内部销售，内部销售
sales inside rails, the first time it go inside, if that time it breaks, and it goes out and 铁路内的销售，第一次进去，如果 那个时候坏了，它出去了
pants down. That's what this break statement does. So let's see an application of continuous 裤子下来。这就是这个 break 语句的 作用。那么让我们看看连续的应用
statement. That's for example, just copy and paste that code into another cell and see 陈述。例如，只需将该代码复制并粘贴 到另一个单元格中，然后查看
how this continue works. So, let's say we have a loop like so. So, what we say is like 这是如何继续工作的。所以，假设我们 有一个这样的循环。所以，我们说的是
this, if I is nine is not equal to zero. If this is the case, if I is not divisible by 这，如果我是九不等于零。如果是 这种情况，如果 I 不能被整除
nine, what you do is you get take i plus equals to one and then continue continue to the next 九，你做的是你得到i plus等于 1然后继续继续下一个
statement. And whatever else you write here for example, brand something brand something 陈述。无论你在这里写什么 ，例如，给某物贴上烙印
else something else whatever that is going to be printed and what wants to continue will 其他任何东西，无论将要打印的 内容以及想要继续的内容都将
will be encountered whenever this eye is whenever this I divisible by nine is not true. If I 每当这个眼睛被 9 整除时，就 会遇到这种情况。如果我
is then you continue once this AI is divisible by nine for example, then you will not follow 例如，一旦这个 AI 被九整除， 你就继续，那么你就不会跟随
then you will not dive into this if condition only then these two statements will be printed. 那么你不会深入研究这个 if 条件， 只有这两个语句才会被打印出来。
Because this this continue will not allow anything further that should happen. And once 因为这个继续将不允许任何应该 发生的事情发生。还有一次
these are printed, let's say we break our loop right there, let's say so if for example 这些被打印出来，假设我们在那里 打破了我们的循环，假设例如
for the very first time one is not divisible by nine, so I equals two. So continue these 第一次不能被九整除，所以 我等于二。所以继续这些
three statements will not be executed the next loop the next loop. The next one If condition 下一个循环下一个循环不会 执行三个语句。下一个 If 条件
becomes false, this continue will not operate, and then we print this statement, then only 变为false，这个continue就不会运行了， 然后我们打印这个语句，那么只有
then we will print this statement, and only then we will break and we'll exit the loop 然后我们将打印此语句，然后 我们才会中断并退出循环
and print the data. So let's print here. Brent inside, if so, let's run this code, let's 并打印数据。所以让我们在这里打印。布伦特里面，如果 是这样，让我们​​运行这段代码，让我们
run this code and see what happens. That's the good 运行这段代码，看看会发生什么。这就 是好处
I should I should just yeah, NASA better font, let's run this code. So, when the code is 我应该我应该只是是的，NASA 更好的字体，让 我们运行这段代码。所以，当代码是
run inside if inside if you see when you when you are inside if when you continue when when 跑进去如果在里面如果你看到你什么时候 你在里面如果当你继续当什么时候
this is the body of if condition when if condition completes, it should print these two things, 这是 if 条件的主体，当 if 条件完成 时，它应该打印这两件事，
but continue is telling the cursor to go back to the next iteration and move on. And once 但是 continue 是告诉光标返回到下一 次迭代并继续前进。还有一次
this if condition becomes false, only then you get this distinct printed this thing printed 这如果条件变为假，只有这样你 才能得到这个独特的打印这个东西
if this break was not there, you do you then again was going to the while loop and you 如果这个中断不在那里，你做你 然后再次进入while循环，你
will be running an infinite loop and then you have done so that's what this continue 将运行一个无限循环，然后 你已经完成了，这就是继续
and break does. So, in the in the in the very next video we will see another kind of loop 和休息。所以，在下一个视频 中，我们将看到另一种循环
here we saw the while loop in the next video we will see a for loop very powerful and very 在这里，我们在下一个视频中看到了 while 循环， 我们将看到一个非常强大且非常强大的 for 循环
famous kind of loop for it does almost the same stuff as while loop while the while loop 一种著名的循环，它与 while 循环几乎相同，而 while 循环
runs based on a condition they fire the for loop it runs based on contracts a counter 根据条件运行它们触发 for 循环 它根据合同运行一个计数器
loop that many times it should run and so on. So we will see the details of for loop 循环多次它应该运行等等。所以 我们会看到for循环的细节
and the application The for loop in the next video hope to see you in the next one. Okay 和应用程序下一个视频中的 for 循环 希望在下一个视频中见到你。好的
in this video we are going to discuss for loop and other kind of loop in the previous 在本视频中，我们将讨论前面 的 for 循环和其他类型的循环
video we saw while loop although most of the stuff almost all of the stuff can be achievable 我们看到的视频 while 循环虽然大多数 东西几乎所有东西都可以实现
through while loop and sometimes it becomes handy to apply for loop. In this particular 通过 while 循环，有时应用 for 循环 变得很方便。在这个特殊的
example, I'm going to populate a list. So before actually moving towards for loop let's 例如，我要填充一个列表。所以 在真正转向 for 循环之前，让我们
see very shortly what a list is, although we are going to be or we are going to explore 很快就会看到列表是什么 ，尽管我们将要或要探索
this lesson in much more detail when we will discuss the data structures module but just 当我们将讨论数据结构模块时 ，本课会更详细，但只是
for the sake of example, a list is a collection of different kinds of elements for example 例如，列表是不同类型 元素的集合，例如
234, that's a list of three elements. So two three and four the list can contains different 234，这是三个元素的列表。所以两 个三和四个列表可以包含不同的
type values, for example two 3.4 and stuff like so, we can access different elements 类型值，例如两个 3.4 之类的东西 ，我们可以访问不同的元素
for example, L of zero means the very first element the indexing This is called the index, 例如，零的 L 表示索引的 第一个元素 这称为索引，
the index starts from zero then index one is so if we print for example, Brent Elif 索引从零开始，然后索引一就是这样 ，如果我们打印，例如，Brent Elif
zero the result will the result that will be printed will be two similarly we can append 零结果将打印的结果将是 两个类似的我们可以追加
more values inside a list append let's say 53 and list after this append operation, the 列表中的更多值追加比方说 53 并在此追加操作后列出
list will be having these values 234 53 we can remove delete, update and do a lot of 列表将有这些值 234 53 我们可以 删除删除、更新和做很多事情
stuff we will see lists in detail, but just for this example, just think that list is 东西我们会详细看到列表，但就这个 例子来说，只是认为列表是
collection of a lot of elements and we can add insert more elements we can delete elements, 很多元素的集合，我们可以添加 插入更多元素，我们可以删除元素，
we can change elements and so on. Or we can just initialize the list with just an empty 我们可以改变元素等等。或者我们 可以只用一个空的列表初始化列表
list and start inserting elements one by one and expanding that list. Okay. Now, this is list 并开始一个一个地插入元素并 扩展该列表。好的。现在，这是
an empty list for example, and four is just a variable for i in this range isn't it greater 例如，一个空列表，而四只是这个 范围内 i 的一个变量，不是更大吗
range then means sequentially give a number one by one starting from zero start from zero range then 表示从零开始，从 零开始，依次给出一个数字
a gift num give numbers one by one for example, first time give zero I will contain zero second 例如，一个礼物 num 给数字一个一 个，第一次给零我将包含零秒
time give 1/3 time give two and so on after every equation the range will give another 时间给 1/3 时间给两个，依此类推，在 每个方程之后，范围将给出另一个
number as long as the numbers they are smaller than 10. So, the last number that this range 数字只要他们小于 10 的数字。所以 ，这个范围的最后一个数字
will return will be nine. So whatever this is written inside is not included and it starts 将返回将九。所以里面写的任何 东西都不包括在内，它开始
from zero. So as long as I is in this range is lower than 10 as long as that you that 从零开始。所以只要我在这个 范围内低于10只要你那个
the body of the loop just like the body of the while loop. So first time I will be zero 循环体就像 while 循环体一样 。所以第一次我将是零
and zero is smaller than 10 Okay, you print i i plus one and abandon the square of that 零小于 10 好吧，你打印 i i 加一并放弃它的平方
in a list. Then next time this range will automatically return the next number into 在一个列表中。那么下次这个 范围将自动返回下一个数字
I. Now next time I will contain one next time I will contain two Next time I will continue 一、现在下一次我会包含一个 下一 次我会包含两个 下次我会继续
In three, four or 5678 and nine, once the value of AI becomes nine, that's the last 三、四或5678加九，一旦AI 的值变成九，那就是最后
iteration of this body of the loop. And after that the loop finishes. So let's just write 循环体的迭代。之后循环 结束。所以让我们写
on this very very first time I will be zero when the loop enters its body very first time 在这非常第一次当循环第一 次进入它的主体时我将为零
I will be zero and one will be printed because we are printing i plus one, at that time the I 将为零，将打印 1，因为我们 正在打印 i 加 1，那时
list and the empty list will be having one number which is zero square. So list will 列表和空列表将有一个数字 为零平方。所以列表将
be having just one number zero, because zero square, so, next time I will be one and we 只有一个数字零，因为零平方， 所以，下次我将是一，我们
will print two and the list will contain one square which is one, next time I will be three 将打印两个，列表将包含一个正方形 ，它是一，下次我将是三
we will I will be two we will print three and we will be having a square of two which 我们将我将是两个我们将打印 三个我们将有一个二的正方形
is four, and so on till so until 10 here, when I will be nine we will print print 10. 是 4，依此类推，直到 10 在这里 ，当我 9 岁时，我们将打印 10。
And in this list, we will be having nine square which is 81, I guess, and after that the loop 在这个列表中，我们将有 9 个正 方形，我猜是 81，然后是循环
finishes and we will be out of this loop. 完成，我们将退出这个循环。
Okay, let's see this. Let's see example of this in, in Jupiter just to get more comfortable 好的，让我们看看这个。让我们看看这个 例子，在木星中只是为了让自己更舒服
with with list as well as the for loop. So let's see, let's say we have an empty list, with with list 以及 for 循环。让我们 看看，假设我们有一个空列表，
let's say an empty list. Just to consider a list like this L is just a variable, you 让我们说一个空列表。仅仅考虑 这样的列表 L 只是一个变量，你
can write another variable a name, that's a variable name L. Okay. So for i in range, 可以给另一个变量写一个名字，那就是 变量名L。好吧。所以对于 i 在范围内，
in is a keyword range is a function in is a keyword, i in range. For example, let's in 是一个关键字范围是一个函数 in 是一 个关键字，i 在范围内。例如，让我们
say then, what you do is you brand, your brand i plus one or whatever you want to do, that's 那么说，你做的就是你的品牌，你的品牌我 加一个或者你想做的任何事情，那就是
the body of the loop, and Eldad a band, that's a function of the lists, we will see that 循环体和 Eldad 带，这是列表 的函数，我们将看到
in detail in the data structure sessions. Okay, and that's it, the loop finishes. When 在数据结构会话中详细说明。好的 ，就是这样，循环结束。什么时候
you finish the loop, just print the whole list. So let's print the list. And you can 你完成循环，只需打印整个列表 。所以让我们打印列表。你可以
see the result 1-234-567-8910. And that's the these are the values in the list. As as 查看结果 1-234-567-8910。这 就是列表中的值。作为
I mentioned earlier, all the little the values. By the way, this range function actually, 我之前提到过，所有的小价值。顺便说 一句，这个范围函数实际上，
if What if we want it to jump more than just one, for example, b we want it to start from 如果我们想让它跳不止一个怎么 办，例如，我们想让它从
zero, it reaches 10. And let's say we want two jumps to be taken as two rather than one 零，它达到 10。假设我们希望将 两次跳跃视为两次而不是一次
and one. So the very first time so that's the start location. That's the end location 和一个。所以这是第一次，所以 这是开始位置。那是终点位置
which is not included start location is included and location is not included. And that's a 不包括的起始位置包括在内，位置 不包括在内。这是一个
step size. So very first time I will be one you move inside, then a jump of two will be 一步的大小。所以第一次我会 是一个你搬进去，然后跳两个
taken the next time I will be so very first time the AI will be zero, then you move inside 下次我会这么第一次AI 为零，然后你搬进去
then the jump of two, then you move inside then a jump of two then you move inside as 然后跳两个，然后你向内移动 然后跳两个然后你向内移动
long as you stay smaller than 10 you will move inside the loop body of the loop. So 只要您保持小于 10，您就会在 循环的循环体内移动。所以
let's see what now printed let's print just I rather than i plus one there was an error 让我们看看现在打印了什么让我们 只打印 I 而不是我加一个有错误
was the error 00 the range function does not have colons, it has actually commas. Sorry, 是错误 00 范围函数没有冒号， 它实际上有逗号。对不起，
my mistake. I was just a MATLAB user one. So MATLAB actually has this colon things. 我的错。我只是一个 MATLAB 用户。所以 MATLAB实际上有这个冒号的东西。
So I was just confusing MATLAB notation with this. Okay, great. So so first time i was 所以我只是混淆了 MATLAB 符号。好 的，太好了。所以我第一次是
zero, next time a jump of two, I becomes two. Next aim to jump off to AI becomes four, then 零，下次跳两个，我变成两个。下一 个跳到 AI 的目标变成了四个，然后
I become six, then I becomes eight. And next time I becomes 10. But 10 is not included. 我变成六，然后我变成八。下次 我变成10。但不包括10。
So you're out of the loop. And that's the squares that you got. It is not necessary 所以你已经脱离了循环。这就是 你得到的方块。这不是必要的
that you always start from zero, you can start from one and you can j take a jump for example 你总是从零开始，你可以从 一开始，你可以跳跃，例如
the jump of three. And it's not necessary that you just reach them you can reach for 三人跳。并且没有必要你只是 接触到你可以接触到的
example 20 it's up to you it's completely your choice. And in that case, you have this 示例 20 完全由您决定。 在那种情况下，你有这个
kind of vibrations. So this range function really is helpful for creating over over a 一种振动。所以这个范围 函数真的有助于创建一个
loop body or a structure. Okay, great. So that was introduction of for loop and we have 循环体或结构。好的，太好了。 这就是 for 循环的介绍，我们有
iterated here on on our list we just have actually populated a list using for loops. 在我们的列表上迭代这里，我们实际上 只是使用 for 循环填充了一个列表。
Okay In the next video we will see more details of this for loop and more fun stuff. Okay, 好的，在下一个视频中，我们将看到有关此 for 循环 的更多细节和更多有趣的东西。好的，
hope to see you in the next video. Last time, we saw four In the last video, and magically 希望在下一个视频中见到你。上次，我们 在上个视频中看到了四个，而且神奇
this else has something to do with for loop in Python. Well this else clause makes sense 这与 Python 中的 for 循环有关。 那么这个 else 子句是有道理的
for F. But in for loop it hardly makes sense. But let me let me let me try to make sense for F. 但在 for 循环中它几乎没有意义 。但让我让我让我试着弄明白
of else clause for follow there is an else part of for loop as well in Python, not in 用于 follow 的 else 子句在 Python 中也 有 for 循环的 else 部分，而不是在
other languages. I don't know any other language that has this L spark maybe there is some 其他语言。我不知道有这种 L 火花 的任何其他语言也许有一些
but I don't know. 但我不知道。
So this else part in Python, particularly in follow, this else part or else that was 所以 Python 中的这个 else 部分，特别是 在后面，这个 else 部分或者 else 是
blocked will only execute if four completes its iterations. For example, this is a set 只有当四个完成其迭代时，blocked 才 会执行。例如，这是一个集合
a set like a list is is a collection list is defined by square brackets set is defined 像列表一样的集合是一个 集合列表由方括号定义
by curly brackets, the set is just similar like the set in mathematics, we will see the 用大括号表示，这个集合就像数学 中的集合一样，我们会看到
set lists tuples dictionaries and many of these data structures in detail in data structures set 在数据结构中详细列出 元组字典和许多这些数据结构
portion, but just I have introduced this, just consider this set has three elements 部分，但只是我介绍过这个， 只考虑这个集合有三个元素
Apple 4.9, and Jerry. Apple is one object or one data. 4.9 is one data, which is a floating 苹果 4.9 和杰瑞。苹果是一个对象或 一个数据。 4.9 是一个数据，是一个浮动
point data and Jerry is one data which is a string data. Okay, so this S has three elements, 点数据和 Jerry 是一种数据，它是一个字符串 数据。好的，所以这个 S 有三个元素，
three different elements. So now for x in this set, as long as x is in the set, the 三个不同的元素。所以现在对于这个 集合中的 x，只要 x 在这个集合中，
very first time the x will be Apple, so it will print Apple, next time x will contain 第一次 x 将是 Apple，所以它 会打印 Apple，下次 x 将包含
a 4.9 as long as so I create over this set, as long as x is inside the set big elements a 4.9 只要这样我就创建了这个集合 ，只要 x 在集合大元素里面
one by one, and just print them all. Okay, we expect that when x is Apple, when the very 一张一张，然后全部打印出来。 好的，我们期望当 x 是 Apple 时
first time x will be Apple, it will print Apple next time x will be 4.9 it will print 第一次 x 将是 Apple，它会打印 Apple 下次 x 将是 4.9 它会打印
4.9. Next time x will be cherry it will print cherry, and the loop ends because there is 4.9.下次 x 是cherry 时，它会打印 cherry，循环结束，因为有
no item in sets to iterate over. Because the loop finishes it's complete iteration there 集合中没有要迭代的项目。因为循环 在那里完成了它的完整迭代
are expected three iterations and the loop finishes those now the else part will execute 预计进行 3 次迭代，循环完成 ，现在 else 部分将执行
and you will say okay, loop completed. So iterations. Well, you will be wondering in 你会说好的，循环完成。所以 迭代。好吧，你会想知道
what case the else will not else will not execute. If you apply any brake statement 什么情况下else不会else不会执行 。如果您应用任何刹车声明
inside the loop body, which means you forcefully you forcefully remove some of the iterations 在循环体内，这意味着您 强行删除了一些迭代
that were going to be executed but the loop did not complete it did not complete citations, 将要执行但循环没有完成 它没有完成引用，
then the L spot will not run. So let's see an example in in in Jupiter to get a good 那么L点将不会运行。所以让我们在木星 中看一个例子来获得一个好的
grip on this else. Okay, let's define a set S. S is a variable name. You can have any 抓住这个其他。好的，让我们定义一个集合 S。S 是一个变量名。你可以有任何
variable name that say it Apple, or let's say 4.9 I guess and then we was having, let's 变量名称说它 Apple，或者让我们 说 4.9 我猜然后我们有，让我们
say, Sherry, if if these Spelling's are correct, I guess jelly. Okay, then for x in PES, as 说，雪莉，如果这些拼写是正确的，我猜是 果冻。好的，那么对于 PES 中的 x，如
long as x is ns Brand X. Fine ELLs rant, when you finish the law terminates with success, 只要 x 是 ns 品牌 X. Fine ELLs 咆哮 ，当你完成法律终止成功，
or all iterations it completed all its iterations. And this is a statement that is completely 或所有迭代 它完成了所有迭代 。这是一个完全是
outside the loop. side the loop, so let's run this. So you can see Apple 4.9 cherry 在循环之外。一边循环，让我们运行 这个。所以你可以看到苹果4.9樱桃
loop terminates with success outside the loop. Okay. Now you might be thinking in what case 循环在循环外成功终止。好的。 现在你可能会想在什么情况下
this else will not execute. Okay, if, for example, as long as x is an N, if I say okay, this else 不会执行。好的，如果， 例如，只要 x 是 N，如果我说好的，
let's say I take a counter here, I equals one, that's a counter, let's say, and every 假设我在这里拿了一个计数器，我等于 一个，那是一个计数器，比方说，每个
time I just increment i, i plus equals one, and then I check if i is equal to three. If 时间我只是增​​加我，我加等于一 ，然后我检查我是否等于三。如果
y is equal to three, then just break. Let's say y 等于 3，然后就断了。让我们说
else just for readability else was now this else is else of this four. And this else is else 只是为了可读性 else 现在这个 else 是这四个中的 else。还有这个
else of this if and this POS statement is just a statement for doing nothing. Now what 这个 if 和这个 POS 语句的 else 只 是一个什么都不做的语句。怎么办
you do when is equal to one you Brent this i plus equals I becomes two two is equal to 你做当等于一你布伦特这个 我加等于我变成两个二等于
three false, so you pass you move on. Next time, x will print 4.9, I will become three 三假，让你传你继续前进。 下次x会打印4.9，我会变成3
and three is equal to three, that's correct, the break will execute, which means the loop 并且三等于三，没错，break 会执行，这意味着循环
should have one more iteration, but the break just disrupt that one more iteration that 应该再有一次迭代，但中断 只会破坏另一次迭代
should be there, because the loop could not complete its iteration due to this certain 应该在那里，因为循环无法完成 它的迭代，因为这个特定的
condition, this else part of the loop will not execute, and you will go directly outside 条件，循环的这个else部分 不会执行，你会直接到外面
this loop. So let's run this code and see the result. So you can see this apple four 这个循环。因此，让我们运行此代码并 查看结果。所以你可以看到这个苹果四
by nine outside the loop. I would recommend although this else is there for for loop, 由九外循环。我会推荐虽然 这还有 for 循环，
but I would recommend to avoid using ELS in the beginning, I mean, you may be confusing 但我建议在开始时避免使用 ELS， 我的意思是，您可能会感到困惑
this else By the way, there is a there is a mistake here, this l should be ended with this else 顺便说一句，这里有 一个错误，这个 l 应该以
a colon here, okay. So I would recommend to not use LS clause for a for loop in the beginning 这里有一个冒号，好吧。所以我建议 不要在开始时将 LS 子句用于 for 循环
until you you really need it. Because you may confuse this else with the with the L 直到你真的需要它。因为 您可能会将 else 与 L 混淆
of F condition. And you may think something else and the program behave in a different F 条件。你可能会想到别的东西 ，程序的行为方式不同
way. So either way, if you want to use LS LS for a for loop is there in Python. Okay, 道路。因此，无论哪种方式，如果您想将 LS LS 用于 for 循环，Python 中都有。好的，
just one more example of for loop. And here we use dictionary, I'm introducing some data 再举一个 for 循环的例子。在这里我们 使用字典，我正在介绍一些数据
structures here just for fun, we will see these data structures in detail later on. 这里的结构只是为了好玩，我们 稍后会详细介绍这些数据结构。
So dictionary, that's a key value period like set, but one item is consists of two numbers, 所以字典，这是一个键值周期，就像 set， 但是一个项目由两个数字组成，
that's called a key. And that is called a value. That's a key. And that's a value like 这叫做钥匙。这就是所谓的价值 。那是一把钥匙。这是一个像
a dictionary, we have key and values. So now as long as x is an X, X represents two key 字典，我们有键和值。所以现在 只要x是一个X，X就代表两个key
and d is our dictionary and D off x represents to whatever value that x points to, for example, d 是我们的字典，D off x 表示 x 指向的任何值，例如，
Apple is a key that points to 44. Cherry is a key that points to gain. For example, if Apple 是指向 44 的键。Cherry 是 指向增益的键。例如，如果
we're ID, apples, apple, the result will be 44. Similarly, d of Jerry, the result will 我们是 ID，苹果，苹果，结果将是 44。同样，杰瑞的 d，结果将是
be game. Okay, so let's I create over this dictionary using this for loop. All am I showing 成为游戏。好的，让我们使用这个 for 循环来创建这个字典。我都在展示
you that this for loop is very, very handy of creating over different data structures 你认为这个 for 循环非常非常 方便地创建不同的数据结构
and a lot of data and stuff. Whereas file while loop is more handy and checking the 以及大量的数据和东西。而文件 while 循环更方便并检查
conditions and stuff. Although you can do all the stuff using while loop you can always 条件和东西。虽然你可以使用 while 循环做所有的事情，但你总是可以
stuff using for loop but one is better over the other insert in certain situations. So 使用 for 循环的东西，但在某些情况 下，一个比另一个插入更好。所以
that's let's let's just run this for a dictionary. Let's say I have a dictionary D. It's defined 那让我们为字典运行它。假设我 有一本字典 D。它是定义的
like a set, let's say my key is a and my value is 10. Let's say my key is B and value is 就像一个集合，假设我的键是 a，我的 值是 10。假设我的键是 B，值是
minus 19. And let's say my key is C and my value is let's say ABC, let's say that's my 负 19。假设我的键是 C，我的 值是假设 ABC，假设那是我的
dictionary. So for x in the Brent the key as well as the value of that key. So now you 字典。所以对于 Brent 中的 x 键 以及该键的值。所以现在你
can see the key is a the value of Stan The key is B the value is minus 90 in the key 可以看到key是一个Stan的值key 是B这个key里面的值是负90
of C the values ABC. So this far loop is really really handy and iterated over a lot of data C的值ABC。所以这个远循环真的 很方便并且迭代了很多数据
structures and stuff although it has other applications as well but this is handy. Okay 结构和东西虽然它也有其他应用 程序，但这很方便。好的
great. So that's about loops for loops. And while loops These are two kinds of loops in 伟大的。这就是循环的循环。 和 while 循环 这是两种循环
important loop these are two important kind of loops and they are in 重要循环这是两种重要的 循环，它们在
Python, in the next video I will directly go to Jupiter and Jupiter notebook and we Python，在下一个视频中我将直接转到 Jupiter 和 Jupiter notebook，我们
will be practicing for this for loops or while loops. We will be practicing the loops we 将为此练习 for 循环或 while 循环 。我们将练习我们的循环
will be doing actually examples of nested loops we will be actually solving a problem 将做嵌套循环的实际示例 我们将实际解决一个问题
like we did in the if conditions we solve the problem Previously, we wrote a code for 就像我们在 if 条件中所做的那样 ，我们解决了问题 以前，我们为
it. Here we will also write a code and we will be get a good grip on the loops. So hope 它。在这里，我们还将编写代码， 我们将很好地掌握循环。所以希望
to see you in the next video we will solve a problem in Jupyter Notebook directly. Okay, 在下一个视频中，我们将直接在 Jupyter Notebook 中解决一个问题。好的，
hope to see you in the next video. Okay, welcome back. In this particular video we are going 希望在下一个视频中见到你。好的，欢迎 回来。在这个特定的视频中，我们将
to practice for loops are basically loops. So let's have a problem statement. First, 练习 for 循环基本上是循环。所以让 我们有一个问题陈述。第一的，
what problem we are going to solve let's have comments. And the problem we are going to 我们要解决什么问题让我们发表 评论。而我们要解决的问题
solve is let's define given a list of of numbers, numbers. For example, I II, let's say 124 解决是让我们定义给定的数字列表，数字 。例如，I II，让我们说 124
minus five, a 7932, like this, make another list making another list that contains all 减五，一个 7932，像这样，制作另一个列表 ，制作另一个包含所有内容的列表
the items in sorted order from minimum to maximum, ie, your result will be another list. 从最小到最大排序的项目，即 ，您的结果将是另一个列表。
Like, in this particular case, we will be having minus five, which is smallest, then 就像，在这种特殊情况下，我们 将有负五，这是最小的，然后
we will be having one, then we'll be having two, then we'll be having two, then we will 我们会有一个，然后我们会有两个 ，然后我们会有两个，然后我们会
be having two, then we'll be having three. So all items, but in minimum to maximum sorted 有两个，然后我们将有三个。所以 所有项目，但从最小到最大排序
order, then we having I guess, four, then we'll be having seven, and then we'll be having 订购，然后我们有我猜，四个， 然后我们将有七个，然后我们将有
nine. So that's your, that should be your output in another list. So assuming this list 九。这就是你的，那应该是你在另一 个列表中的输出。所以假设这个列表
is available to you, or any list is available to you assume this list is available to you. 可供您使用，或者任何列表可供您 使用，假设此列表可供您使用。
So how to solve that problem? Let's start. Okay, let's assume that the list is available. 那么如何解决这个问题呢？开始吧 。好的，让我们假设该列表可用。
That's it, this is the list we are going to sort. Let's say this is available. Okay. Okay. 就是这样，这是我们要排序的列表 。假设这是可用的。好的。好的。
So, what should be the logic? What should be the logic? How can we solve that problem? 那么，逻辑应该是怎样的呢？应该是什么 逻辑？我们怎样才能解决这个问题？
This is, this is an easy looking problem, but it is not so easy. Let us first right. 这是，这是一个看起来很容易的问题， 但它并不那么容易。让我们先说对。
Let us just simplify this problem to just finding out a minimum from the list. Let's 让我们将这个问题简化为从 列表中找出最小值。让我们
say we are given a list and we just want to find out minimum number one a minimum from 假设我们得到了一个 列表，我们只想从
the list. So how can we move that. So let's say M is some number. So M is the very first 列表。那么我们如何才能移动它。所以 让我们说 M 是一些数字。所以M是第一个
value of the list, let's MSP our variable, let's say that's the first value. And what 列表的值，让我们 MSP 我们的变量 ，假设这是第一个值。还有什么
we do is for i in the for i n L, as long as I is an L, if I AI is smaller than m, then 我们做的是for i in the for i n L，只要 I是L，如果I AI小于m，那么
if AI is smaller than m, then m should contain AI. Otherwise do nothing. That's it. So at 如果 AI 小于 m，则 m 应包含 AI。否则 什么都不做。就是这样。所以在
the end, rentas m, then this m at the end. So, Brent, the minimum number, that's great. 最后，租金为 m，然后是最后的 m。所以 ，布伦特，最小的数字，太好了。
So so that's the nasty, basically. So yeah, that's the that's how we will find out just 所以这很糟糕，基本上。所以是 的，这就是我们将发现的方式
the minimum value. So let's run this code. And the minimum is minus five available to 最小值。所以让我们运行这段 代码。并且最小值是负五可用
us. What if we want to store the minimum value as well as the position of that value? For 我们。如果我们想存储最小值以及 该值的位置怎么办？为了
example, we not only want to just find out what is the minimum number, we also want to 例如，我们不仅想找出最小数 是多少，我们还想知道
find out at what index for example, here 012, and three, at the third index, we found the 找出在什么索引处，例如，这里是 012，以及 三个，在第三个索引处，我们找到了
minimum, what if we're interested in the index as well. So let's say for the very beginning, 最低限度，如果我们也对索引感兴趣 怎么办。所以让我们一开始就说，
the index is zero. And then what we do is 指数为零。然后我们要做的是
we moved on and we say, okay, we maintain a counter, let's say a counter is C equals 我们继续前进，我们说，好吧，我们维护 一个计数器，假设一个计数器是 C 等于
c equals zero, for example, right now, and C, just plus equals to one, that's a counter c 等于 0，例如，现在，而 C，只是 加等于 1，这是一个计数器
and then this ID x is just that C, whatever that c is. So whatever that index is, when 然后这个 ID x 就是那个 C，不管那个 c 是 什么。所以无论那个索引是什么，当
we find this C, that index is also there. So let's print the index as well as the minimum 我们找到了这个 C，那个索引也在那里 。所以让我们打印索引以及最小值
value. So okay, so at the position three, at index three, we found the minimum value, 价值。好吧，所以在位置三，在 索引三，我们找到了最小值，
okay, now we have written kind of a code block that helps us finding out the minimum value. 好的，现在我们已经编写了一个代码块 来帮助我们找出最小值。
How can we actually how can we actually do how can we act? So the basic logic is you 我们怎样才能真正怎样我们怎样才 能怎样行动？所以基本逻辑是你
find the minimum value and swap the that value with the very first value, okay, great. And 找到最小值并将该值与第一个 值交换，好的，太好了。和
then move the loop next time find out the minimum value from the remaining list and 然后移动循环下次从剩余 列表中找出最小值并
swap that minimum value with the second value. Next time you find the minimum value, as long 将该最小值与第二个值交换。 下次找到最小值时，只要
as the position and swap that with the third value and so on. So do that stuff and just 作为位置并将其与第三个值交换， 依此类推。所以做那些事，只是
rearrange the same list using this but, but how can the so that's the logic find out the 使用这个但是重新排列相同的列表 ，但是这样的逻辑怎么能找出
minimum value. So happened with the first value and then start from two till end start 最小值。所以发生了第一个值， 然后从两个开始直到结束开始
from start from the remaining values, find the minimum so appid with the first value 从剩余的值开始，用第一 个值找到最小值 so appid
of the remaining list, then reduce the list step by step and you will be having a sorted 的剩余列表，然后逐步减少 列表，您将有一个排序
order, but how to start with how to find out like this how to how to do that. So, any idea 订单，但如何开始，如何找到 这样的方法。所以，任何想法
and we are going to so for example, in this particular case, if I want to swap the list, 例如，在这种特殊情况下 ，如果我想交换列表，
what I will do is I will say okay, swap with zero at the at the at the zero, so, I will 我会做的是我会说好的，在零处 与零交换，所以，我会
contain a temporary variable, temporary variable will contain the value of zero, this zero, 包含一个临时变量，临时变量 将包含零值，这个零，
so what I will do is at least zero, right the minimum value and the minimum value. So 所以我要做的至少是零，正确 的最小值和最小值。所以
at zero you write the minimum value, but at this particular index, from there, we found 在零处你写出最小值，但在这个特定 的索引处，从那里，我们发现
the minimum value, just place the just place the the value at the very beginning. So in 最小值，只需将值放在最 开始的位置。所以在
after that, after that operation, the minimum will be at the first position, or the zeroeth 之后，在该操作之后，最小值 将位于第一个位置，或第零个
index, and that value will be some minimum value will be swapped with the very first 索引，该值将是某个最 小值将与第一个交换
value. So let's run this code and see what a list looks like after that good. So you 价值。所以让我们运行这段代码，看看在 那个好之后列表是什么样的。那么你
see, for example, the minimum value is swept by the first value, whatever the first value 看，例如，最小值被第一个 值扫过，无论第一个值如何
was, but we want to do that progressively for for the rest of the list, we want to find 是，但我们希望对列表的其余部分 逐步执行此操作，我们希望找到
out the minimum and follow up with the first one for the rest of the list and keep on moving. 找出最低限度并跟进列表其余 部分的第一个，并继续前进。
How can we do that? So yeah, that's, that's, so let me define four. So let me first in 我们怎么做？所以是的，那是，那是， 让我定义四个。所以让我先进去
depth a bit, let's say control right bases that will indent all my code. So for j in 深入一点，让我们说控制将缩进我所有 代码的正确基础。所以对于 j
range, length of the list, whatever the length of list, let's say for G is that so what I 范围，列表的长度，无论列表的长度如何 ，让我们说 G 就是这样，所以我
do is M is the gf value the index right now is J and the C is also C is also the Convert do is M 是 gf 值，索引现在 是 J，C 也是 C 也是 Convert
C is also starts from J, okay, great. Now, we want it to start with two now we want this C也是从J开始的，好吧，太好了。现在，我们 希望它以两个开始，现在我们想要这个
I to start from J and move onwards here. So let's say i in range, start from G and go 我从 J 开始，然后在这里继续前进。所以 让我们说 i 在范围内，从 G 开始然后去
till length of L, one by one, take the step of one. Okay, great. So what next? Now the 直到长度L，一一，一步一步。好的 ，太好了。那么接下来呢？现在
value will be L of I, rather than simply L of I rather than simply I in that case, you 在那种情况下，值将是 I 的 L，而不是 I 的 L，而不是 I
do this. 做这个。
Okay, and the index is just C. Okay, great. Keep on keep on introducing this index again, 好的，索引只是 C。好的，太好 了。继续继续介绍这个索引，
after this loop, what you do is you pick the gf value, you slap the gf value with the minimum. 在这个循环之后，你要做的是选择 gf 值，用最小值拍打 gf 值。
And you do that. And that's it, you keep on moving and offer after the outer loop finishes. 你这样做。就是这样，您在外 循环完成后继续前进并提供。
If you branch your list, you will be having the list sorted or at least we hope so. So 如果您对列表进行分支，您将对列表进行 排序，或者至少我们希望如此。所以
maybe there is a bug in the code or maybe there is a problem in the code. But we hope 也许代码中存在错误，或者代码 中存在问题。但我们希望
this will work. What we are doing progressively By the way, this is a nested loop. This is 这会起作用。我们正在逐步做的事情 顺便 说一下，这是一个嵌套循环。这是
a loop inside the loop and that's and then we have an if condition inside the nested 循环内的循环，然后我们 在嵌套内有一个 if 条件
loop. Loop inside the loop. Great. Let's see how it how it works. If there is no Oh there 环形。在循环内循环。伟大的。让我们 看看它是如何工作的。如果没有哦那里
is an error length of range. Oh, we haven't write a colon there. Don't forget this colon. 是范围的错误长度。哦，我们还没有 在那里写冒号。不要忘记这个冒号。
That's a problem. Oh, we have a sorted order. Oh my god. We have a result with us. You see 这是个问题。哦，我们有一个排序的顺序 。我的天啊。我们有一个结果。你看
the applications of this. Oh, one three is missing. We were is three, we have two threes 这个的应用。哦，一三不见了。 我们是三个，我们有两个三分球
Oh, the output we have written here is wrong, there is no two threes there is only one three. 哦，我们这里写的输出是错误的 ，没有两个三，只有一个三。
So you have sorted a list. If you remember, we have written a similar kind of code in 所以你已经对一个列表进行了排序 。如果你还记得，我们已经在
the problem. So problem solving session very earlier, where we solve this problem using 问题。所以问题解决会议很早 ，我们在那里解决这个问题
selection sort, but they are we just wrote a pseudocode. And here we have a code much 选择排序，但它们是我们刚刚写的 伪代码。在这里我们有一个代码
simpler than actually the Python code. If the problem was just sorting there are built 比实际的 Python 代码更简单 。如果问题只是排序有内置
in functions to do that, but I'm just telling you how these loops and if conditions and 在函数中做到这一点，但我只是 告诉你这些循环和 if 条件和
all that stuff can be used to communicate with each other to match with each other to 所有这些东西都可以用来 相互交流以相互匹配
to actually perform a problem solving task when given a problem. Although we will see 在遇到问题时实际执行解决问题 的任务。虽然我们会看到
later on in Python, most of the problem solving tasks, I mean many more of them, there are 后来在 Python 中，大部分问题解决 任务，我的意思是更多，有
a built in function for those that are available functions for those you need not write all 一个内置函数，用于那些你不需要 编写所有可用函数的函数
that stuff, but to mastering to to master any programming language, you have to go through 那些东西，但要掌握到掌握 任何编程语言，你必须经历
these constructs. So that for a new problem, or for a very large, complicated kind of problem, 这些构造。所以对于一个新问题， 或者对于一个非常大、复杂的问题，
eventually you you may need these kind of structures with you. So mastering these structures 最终你可能需要这些结构 。所以掌握这些结构
is really essential for problem solving and programming in general. So okay, that's about 通常对于解决问题和编程非常 重要。好吧，就是这样
the loops and if conditions and control. So, all of that, in the next video, I will I will 循环和 if 条件和控制。所以，所有 这些，在下一个视频中，我会我会
start talking about functions. So you have seen this L e m data function, you have seen 开始谈论功能。所以你已经看到了 这个 L e m 数据函数，你已经看到了
this range, that's that's function idolater. Although you have seen around function, you 这个范围，那就是函数偶像崇拜者。虽然 你已经看到了周围的功能，但你
have seen def mode, you have seen print function, what if we want to write our own function? 看过def模式，看过print函数，如果 我们想自己写函数怎么办？
How can we do that? From the next video, I'm going to show you how can we write our own 我们怎么做？在下一个视频中，我 将向您展示我们如何编写自己的
function? Wow, isn't that great? That's great. So hope to see you in the next video. In this 功能？哇，是不是很棒？那太棒了。所以 希望在下一个视频中见到你。在这
video, I will talk about functions. A very powerful construct in almost every programming 视频，我来谈谈功能。几乎所有 编程中的一个非常强大的构造
language. Python also supports functions. What a function is, let me let me describe 语。 Python 也支持函数。什么 是功能，让我来描述一下
the let me describe the need of the function by a scenario. Let me give you a scenario. 让我通过一个场景来描述该功能 的需求。让我给你一个场景。
The scenario is let's say you are writing a very lengthy program, the program requires 假设您正在编写一个非常 冗长的程序，该程序需要
to print particular messages whenever needed, for example, you need to print this particular 在需要时打印特定消息，例如 ，您需要打印此特定消息
message the task, the task was successful, let's say you need to print this. And then 消息任务，任务成功，假设 你需要打印这个。进而
you have to print moving to the next task maybe to to inform somebody maybe in to inform 你必须打印移动到下一个任务也许 是为了通知某人也许是为了通知
your client. And then you have to ask, okay, send me the next task. Because I am done with 你的客户。然后你要问，好吧，把下 一个任务发给我。因为我已经完成了
the previous task, let's say you want to print this, or maybe you want to print more or do 上一个任务，假设你想打印这个 ，或者你想打印更多或做
some more stuff. And let's say you want to do this again. And again, whenever needed. 还有一些东西。假设您想再次执行 此操作。再次，在需要时。
Somewhere, whenever you complete a particular task or something, you want to print all these 在某个地方，每当您完成特定任务 或某事时，您都想打印所有这些
messages, and then somewhere else, whenever a particular event occurs, you need to print 消息，然后在其他地方，每当发生 特定事件时，您都需要打印
all these messages again. Now one way to do that is to write just these print statements 再次所有这些消息。现在一种 方法是只编写这些打印语句
whenever needed in the program. One way is if you want to perform a task and the task 在程序中需要时。一种方法是，如果 您想执行一项任务并且该任务
has a lot of coding, maybe maybe maybe a very small amount of coding or maybe a very large 有很多编码，也许可能是非常少量 的编码，也可能是非常大的编码
amount or magnitude of the coding. In this case, we have just three statements, but maybe 编码的数量或幅度。在这种情况 下，我们只有三个语句，但也许
we have a task that we want to perform again and again and it is really a very lengthy 我们有一项要一次又一次执行的任务 ，这确实是一个非常漫长的过程
task in terms of the coding. 编码方面的任务。
So, one way to do that is to just write all the coding in coding somewhere and define 因此，一种方法是在某处 编写所有编码并定义
a function and that function means the function contain all the tasks that you need to perform, 一个函数，该函数意味着该函数 包含您需要执行的所有任务，
whenever you need to perform that particular task. Just in your coding, just call this 每当您需要执行该特定任务时。 就在您的编码中，只需调用它
one statement, just this one statement, and the whole task that is written under this 一项声明，仅此一项声明，以及 在此之下编写的整个任务
under this content maintaining this as a heading that will execute automatically I mean, however, 在此内容下，将此作为将自动 执行的标题，但我的意思是，
I mean, that task that is under this heading may be very lengthy may be short, may may 我的意思是，这个标题下的任务 可能很长，也可能很短，可能
be complicated, may be simple one or anything, but the need is we want to perform this task 复杂，可能很简单，但需要 的是我们要执行此任务
whenever we need. And we do not write to code this again and again we do not write to code 每当我们需要。我们不会一次又一 次地写代码，我们不会写代码
we do not write to we do not want to write the same lines of codes again and again and 我们不想写我们不想一次 又一次地写相同的代码行
again. And again in our program. Just write this particular lines of code once define 再次。再次在我们的程序中。一旦 定义，只需编写此特定代码行
a function, just like a task. Whenever you need to perform that task, just call the heading 一个函数，就像一个任务。每当 您需要执行该任务时，只需调用标题
or the name of the function. And the whole task under that function will execute functions 或函数的名称。并且该函数 下的整个任务将执行函数
in almost all programming languages. They do that even in mathematics. They do that 在几乎所有的编程语言中。他们甚至 在数学中也这样做。他们这样做
In Python, the syntax of defining function is you if you want to define a function, you 在 Python 中，定义函数的语法是 你，如果你想定义一个函数，你
have to first start with D E F meaning definition or defining, then you need to write the name 必须先以D E F开头的意思是定义 或定义，然后你需要写名字
of that function the name of that function name a function and name a variable has resemblance, 该函数的名称 该函数的名称 函数名称和变量名称 相似，
I mean, the name of functions should be descriptive, it should, it should portray what the function 我的意思是，函数的名称应该是描述性的 ，它应该，它应该描述函数的内容
actually is doing. So, it is good to write it is good to suggest the names of the functions 其实是在做。所以，最好 写好建议函数的名称
that are very descriptive to make the code readable and manageable. So, here I have written 这些描述性很强，使代码可读 和可管理。所以，我在这里写了
the function name is sprint success, you can write any name, then you start parenthesis 函数名是sprint success，你可以写 任何名字，然后你开始括号
then you end parenthesis and then you write a colon like you have written the colon for 然后你结束括号，然后你写一 个冒号，就像你写的冒号一样
if conditions are for loops or any other constructs. And then you do indent like the body of the if 条件是 for 循环或任何其他结构 。然后你像身体一样缩进
for loop like the body of the if condition, this is the body of the function, body of for 循环就像 if 条件的主体 ，这是函数的主体，
the function is all should all be aligned, then you write all the tasks, all the coding 功能都应该全部对齐，然后你 写所有的任务，所有的编码
that you need to be performed whenever this function is invoked or called, this body can 每当调用或调用此函数时 都需要执行，此主体可以
contain if conditions for loops inside, I mean, this can have a whole lot of coding 包含内部循环的 if 条件，我的 意思是，这可以有很多编码
inside it. And whenever you will call this function, whenever you will type this command, 在里面。每当你调用这个函数 时，每当你输入这个命令时，
wherever in your coding, the whole task under this will be executed automatically again 在你编码的任何地方，这下的 整个任务将再次自动执行
and again whenever you like. So, let's take a look of defining our first function in Jupyter. 并在您喜欢时再次使用。那么，让我们 来看看在 Jupyter 中定义我们的第一个函数。
notebook. Let's just I guess, yes. So, yeah, so, that's our notebook, we were populating 笔记本。让我们只是猜测，是的。所以，是 的，那是我们的笔记本，我们正在填充
that notebook. So by the way, if you if you want to know where this notebook is located, 那个笔记本。顺便说一句，如果 你想知道这个笔记本的位置，
if I want to, for example, invoke that notebook again, when you will run your Jupyter Notebook 例如，如果我想再次调用该笔记本 ，则何时运行 Jupyter Notebook
from the Anaconda prompt, you will be having all the files that you are working on. And 从 Anaconda 提示符处，您将拥有 您正在处理的所有文件。和
one file is for example, this you just click on that, and your file one or more files, 例如，一个文件，您只需单击该文件， 您的文件就是一个或多个文件，
whatever you want to open up that will open up in the Jupyter. notebook. Yes, so it is 无论你想打开什么，都会在 Jupyter 中 打开。笔记本。是的，原来如此
opening up, it's a lengthy file, so it may take may take a second. Okay. Let me just 打开，这是一个很长的文件，所以可能 需要一秒钟。好的。让我只要
take a better zoom level, just to Okay, so we were working on that notebook, let's define 采取更好的缩放级别，只是为了 好的，所以 我们正在处理那个笔记本，让我们定义
our first function, let's say D, F, define. Let's say the function name is Brent. Success. 我们的第一个函数，假设 D，F，定义 。假设函数名称是 Brent。成功。
That's a, that's a syntax, then press enter, Brent, I am done. Then Brent, send me another 那是一个，那是一个语法，然后按回车，Brent， 我完成了。然后布伦特，再给我寄一个
task. Let's see. And that's it. Let's say that's the, that's the body of the function, 任务。让我们来看看。就是 这样。假设这就是函数体，
the body of the function here contains only two statements, okay, then you run this, you 这里的函数体只包含两条​​语句 ，好吧，那么你运行这个，你
run this command, just like Shift Enter, you run this. So that 运行这个命令，就像 Shift Enter 一样，你运行 这个。以便
it is it is reported in the symbol table, there is a symbol table inside the Python 是在符号表里报的，Python 里面有一个符号表
maintaining Python is maintaining all the variables all the function information inside. 维护Python就是维护所有变量 里面的所有函数信息。
So once you run this cell, then the then this print success function will be registered 所以一旦你运行这个单元格，那么 这个打印成功函数就会被注册
to Python. So that whenever you want to call this function, again, it will be available. 到 Python。这样无论何时你想调用 这个函数，它都会再次可用。
Now if you want to perform this task, let's say you want to perform, let's say you want 现在如果你想执行这个任务， 假设你想执行，假设你想要
to perform this task whenever you want. So you just call this function, this is called 随时执行此任务。所以你只要 调用这个函数，这就是调用
calling of the function. whatever I'm doing now, when success and that's it, you press 函数的调用。无论我现在在做什么 ，当成功就是这样，你按下
Shift Enter, and the all the statements that are under this will be executed. And you do Shift 回车，这下的所有语句 都会被执行。你也是
some other stuff, let's say three plus eight that is that is 11 do some other stuff. And 一些其他的东西，让我们说三加八， 也就是 11 做一些其他的事情。和
afterwards, if you want to do the same process again, then you call this function again and 之后，如果您想再次执行相同的 过程，则再次调用此函数并
all the coding inside the function will be executed it is very, very handy. If a particular 函数内部的所有编码都会被执行 ，非常非常方便。如果一个特定的
task if you want to perform that task repeatedly, it is good to just write one code for that task 如果你想重复执行那个任务， 最好只为此编写一个代码
task in a function and then just invoke function whenever you need. It supplies a lot of managing 函数中的任务，然后在需要时调用 函数。它提供了很多管理
power, a lot of debugging power if you have an error for example, inside the function, 电源，如果您有错误，例如在 函数内部有很多调试功能，
you just go to the code we just go to the code of the function itself and fix the error 您只需转到代码我们只需转到 函数本身的代码并修复错误
and come back You need not to you need not to go all over the code if you have not defined 然后回来如果你还没有定义，你 不需要你不需要遍历所有的代码
the function and you have called these lines of codes everywhere inside your main code, 函数，并且您在主代码中的任何 地方都调用了这些代码行，
then it will become very difficult to handle And function actually provides a lot of a 那么它会变得很难处理而且 函数实际上提供了很多
lot of simplicity of managing and readability and, and a modular approach in that sense. 许多管理和可读性的简单性，以及 从这个意义上说的模块化方法。
So that was our first. That was our first function. We will be talking about more, we'll 所以那是我们的第一次。那是我们的 第一个功能。我们将谈论更多，我们将
be talking more about this functions in the next video. So hope to see you in the next 在下一个视频中更多地讨论这个 功能。所以希望下次再见
video. The function name should be descriptive, that's okay. But it is further important sometimes 视频。函数名应该是描述性 的，没关系。但有时更重要
to have a documentation of the function sometimes called the doc string, the doc string allows 有一个有时称为文档字符串的函数 文档，文档字符串允许
you to write the description of the function. But that description will never be executed, 你来写函数的描述。但是那个 描述永远不会被执行，
it will be available whenever you need help. Or you need to know what this function does. 只要您需要帮助，它就会随时可用。或者 你需要知道这个函数是做什么的。
Sometimes it happens your function can contain a lot of code, for example, you have a particular 有时你的函数可能包含很多代码 ，例如，你有一个特定的
function, let's say, fun, let's say it contains def, fun, and it does a lot of a lot of complicated 函数，比方说，有趣，比方说它包含 def，fun，它做了很多很多复杂的事情
stuff inside. And it is sometimes required to know what this function actually is doing. 里面的东西。有时需要知道 这个函数实际上在做什么。
So this document string is one way of describing what the function is doing. You might be thinking 所以这个文档字符串是描述函数正在 做什么的一种方式。你可能在想
that if you're writing this document string inside the where the where the coding of the 如果你在编码的 where 里面 写这个文档字符串
function should be written, we should open up that the coding file and see what the function 函数应该是写出来的，我们应该 打开那个编码文件，看看是什么函数
is doing, or should we actually open up this function implementation where the function 正在做，或者我们应该真正 打开这个函数实现的地方
code is written. And then we have to read what the function is doing. Actually, Python 代码写好了。然后我们必须阅读函数 在做什么。实际上，Python
gives you another power. If you have written the document string inside, that should be 给你另一种力量。如果你在里面 写了文档字符串，那应该是
a top statement before the first coding statement. Whatever description you want, as a document 在第一个编码语句之前的 top 语句。无论 您想要什么描述，都可以作为文档
string, it will be available without actually opening up with without actually seeing what's 字符串，它将在不实际打开的 情况下可用而不实际看到什么
inside the funk without actually opening up the file that contains the implementation 在 funk 中，而无需实际 打开包含实现的文件
of this function. Let's see, let's see. Two in Jupyter, notebook imore, completely whatever 这个功能的。让我们看看，让我们看看。 Jupyter 中的两个，笔记本 imore，完全无所谓
I'm saying right now. So for example, let's define a function. def print success. to let's 我现在就说。例如，让我们定义 一个函数。 def 打印成功。让我们
say the function name, this function is print success to the function name is print success 说函数名，这个函数是打印 成功到函数名是打印成功
two, although it's not a very descriptive name, but the specimens are also not correct, 二、虽然不是很形象的名字 ，但是标本也是不对的，
but that's fine. Print success to here I just define a document Strank. The document string 不过没关系。打印成功到这里我只是 定义了一个文件 Strank。文档字符串
may contain maybe just in one line, or it may be a multi line, it is like a multi line 可能只包含一行，也可能 是多行，就像多行
comment, or maybe a single line comment if you want. But it starts with the three quotes 评论，或者如果你愿意，也可以 单行评论。但它以三个引号开头
and ends with three quotes. Let's say I write here this function is doing nothing except 并以三个引号结尾。假设我 在这里写这个函数除了
renting. message, printing a message, let's say full stop. And then I further define let's 出租。消息，打印消息，让我们说 句号。然后我进一步定义让我们
say I define more in saying that that message is 说我的定义更多是说该消息是
Hello, let's say, let's say are any description you want for this function. Now, this is a 你好，让我们说，让我们说你想要这个 功能的任何描述。现在，这是一个
document string, and it will be available whenever you need. Now here are the coding 文档字符串，您可以随时 使用。现在这里是编码
starts, let's say you, right according here, and again, hello, let's and you run this code. 开始，让我们说你，就在这里，再次 ，你好，让我们运行这段代码。
Now, let's say we are not seeing this function we are we are not available with this function. 现在，假设我们没有看到此功能 ，因为我们无法使用此功能。
We are not available with the code of this function. And we want to know what this function 我们无法提供此功能的代码 。我们想知道这个函数是什么
actually does. First of all, we can just write if we write pri, and just press tab, the tab 实际上确实如此。首先，如果我们写pri， 我们就可以直接写，然后按tab，tab
will allow us to access all the functions that are available with prefix pri. So let's 将允许我们访问所有可用前缀 pri 的函数。那么让我们
say we go to print success, brand success. Brain success here brain success, as should 说我们去印刷成功，品牌成功。大脑 成功在这里大脑成功，应该如此
be capital, Brent success, let's say so print success to let's say and we write a question 成为资本，布伦特成功，让我们说打印 成功让我们说，我们写一个问题
mark in front of it, and then just press Shift Enter, it will pull the document string it 在它前面打上记号，然后直接按Shift Enter，它会拉出文档字符串它
will pull the document strength whatever we have written and we will get to know what 无论我们写了什么，都会拉动 文档强度，我们将了解什么
actually this this is doing. So this document string actually does a lot of job further 其实这是这样做的。所以这个文档 字符串实际上做了很多工作
if we I mean this is this is kind of whenever we need to know what a function is doing. 如果我的意思是这就是当我们需要知道 一个函数在做什么的时候。
The document string is one way to just go and check what is what is happening. Right 文档字符串是一种检查正在 发生的事情的方法。对
now this function implementation is in front of us But in several times, the function implementation 现在这个函数实现就摆在我们 面前了 但是在几次之后，函数实现
will not be in front of us several times, we will be accessing functions that other 不会在我们面前多次出现 ，我们将访问其他功能
people have written in their libraries. And we need to know what those functions are doing. 人们在他们的图书馆里写过。我们 需要知道这些函数在做什么。
So document string is one very, very healthy way of describing our function. And I will 所以文档字符串是一种非常非常健康 的描述我们函数的方式。我会的
recommend to make your habit writing document strings, every time you write a function. 建议养成每次编写函数时编写 文档字符串的习惯。
I was telling you that if you write a double question mark, then it will not only pull 我告诉你，如果你写一个双 问号，那么它不仅会拉
the document string for you, it will pull the whole implementation as well. So now if 您的文档字符串，它也会拉出 整个实现。所以现在如果
you see you, they said the document string, and that's the implementation. So whole implementation 你看你，他们说的是文档字符串 ，这就是实现。所以整个实现
will be available, if you want. And this is true for the functions that are that are, 如果您愿意，将可用。这对于那些 是的功能来说是正确的，
that are the functions that are third party functions, or some other person have written 第三方函数或其他 人编写的函数
that function and so on. For example, you know, a function length, we call that function 那个功能等等。例如，你知道， 一个函数长度，我们称之为函数
several times. So let's let let's, let's see, also the document string is returned, the 几次。所以让我们让我们看看 ，还返回了文档字符串，
number of items in our container, that length function is not written by us, somebody has 我们容器中的项目数，长度函数 不是我们写的，有人有
written that function that's a built in function, by the way. And we can, this document string 顺便说一下，写了一个内置函数的 函数。我们可以，这个文件串
tells us, okay, what this function is doing, we don't have the implementation of that function, 告诉我们，好吧，这个函数在做 什么，我们没有那个函数的实现，
obviously, somebody have written that function. And, and if we write the double, then we should 显然，有人写了那个函数。而且， 如果我们写双倍，那么我们应该
get an implementation as long as the implementation is not in c++, I haven't told you that a lot 只要实现不是在 c++ 中就得到一个 实现，我没有告诉你很多
of a lot of implementation of Python itself has been done in C and some other languages Python 本身的很多实现都是用 C 和其他一些语言完成的
have C mostly. So several built in functions, because of because of their speed, they are 主要有C。所以几个内置函数， 因为它们的速度，它们是
implemented in C, and if you, if you want to get their implementation, they get their 用 C 实现，如果你想得到他们 的实现，他们会得到他们的
code, the code will not be available for most of the functions. So that's so whenever you 代码，该代码将不适用于大多数 功能。所以每当你
write a double question mark, and the answer is the same as a single question mark, that's 写一个双问号，答案 和单问号一样，就是
an indication that this particular function is not written in plain Python, it is written 表明此特定函数不是用纯 Python 编写的，而是编写的
in some other language and is used in Python. That's, in other words, the diversity or flexibility 在其他一些语言中，并在 Python 中使用 。换句话说，就是多样性或灵活性
of Python, you can engage multiple languages inside, Okay, one more thing, I can write Python的，里面可以搞多种语言， 好吧，还有一件事，我可以写
Help, help command and I can get this Brent success 帮助，帮助命令，我可以得到这个布伦特的 成功
success too. And the help of print success to by just typing this help command. So, this 也成功。只需键入此帮助命令 即可帮助打印成功。所以这
help will tell us, you see the Help is telling us the document strike I mean, this help on 帮助会告诉我们，你看到帮助是告诉我们 文件罢工我的意思是，这个帮助
this function, if and this and this is the function we have written, this is the function 这个函数，如果和这个，这 是我们写的函数，这就是函数
we have written, this function is doing nothing except whatever description we are giving 我们已经写过，这个函数除了我们给出 的任何描述之外什么都不做
there. If, at some time, if we are supplying this function to somebody, or making a package 那里。如果在某个时候，如果我们向 某人提供此功能，或者制作一个包
of a lot of functions, that we are writing these documents, strings will help to get 很多功能，我们正在编写这些 文件，字符串将有助于获得
to know how to use these functions. By just knowing the function name, we can, this document 了解如何使用这些功能。只要知道 函数名，我们就可以，这个文件
string actually tells us how the what the function is doing. While great Oh, by the string 实际上告诉我们函数在 做什么。虽然很棒哦，由
way, we haven't called this function yet, we are just playing with the document string, 方式，我们还没有调用这个函数 ，我们只是在玩文档字符串，
let's call the function print. Now we know what the function is doing. let's print, let's 让我们调用函数print。现在我们知道 函数在做什么了。让我们打印，让我们
call this function. And whatever written inside the function will be called See, this is only 调用这个函数。并且在函数里面写的 任何东西都会被称为 See，这只是
called this is just acting as a comment and it is basically a comment. Yeah. Okay, great. 称之为这只是作为一个评论，它基本上 是一个评论。是的。好的，太好了。
Stay with us. There is much more about function that we are going to tell you. Hope to see 和我们在一起。我们将告诉您更多 关于函数的内容。希望看到
you in the next video. Okay, in the last video, we saw document strength. Or you might be 你在下一个视频中。好的，在上一个视频中， 我们看到了文档强度。或者你可能是
thinking, what is power of this function, if it is doing some static task? Well, in 想一想，如果它正在做一些静态任务 ，这个功能的力量是什么？那么，在
this video, I'm going to tell you that the function can the coding or the behavior of 这个视频，我要告诉你这个 函数可以编码或行为
the function can be dynamic, based on based on the arguments based on some properties 函数可以是动态的，基于 基于某些属性的参数
that you will be defining at the call time. For example, the function has in almost all 您将在通话时间定义。例如 ，该功能几乎在所有
programming languages, the functions, the most interesting functions are the function 编程语言，函数，最 有趣的函数是函数
that receives an argument. And an argument is just considered an argument just as a variable 接收一个参数。并且一个参数只是 作为一个变量被认为是一个参数
and performs its task according to that to that arguments. argument. Just take a single 并根据该参数执行其任务 。争论。只拿一个
simple example. Let's say rather than having a function print success, we have a function 简单的例子。假设我们有一 个函数而不是函数打印成功
print message, and it it prints whatever message it receives. And at the call time, for example, 打印消息，它打印它收到的任何 消息。例如，在通话时间，
we call this function like so print message. And let's say we call this as, let's say, 我们像这样调用这个函数打印消息。 假设我们称之为，让我们说，
success. Let's say now success will be printed. Next time we call the function and we give 成功。假设现在将打印成功。下次 我们调用该函数时，我们给出
another argument maybe in a string, let's say so 74 errors, let's see, that will be 另一个参数可能在一个字符串中，假设 有 74 个错误，让我们看看，那将是
that will be printed or anything, I mean, anything that you supply will be printed. 将被打印或任何东西，我的意思是 ，你提供的任何东西都将被打印。
Wow, isn't that great? I mean one function. And you might be thinking the plain print 哇，是不是很棒？我的意思是一种功能 。你可能会想到普通的印刷品
function does that what's the power of this? Well, I'm just telling you the function of 功能不，这是什么力量？嗯 ，我只是告诉你的功能
the function does not only contain one line, I mean, it can be a whole task depending upon 该函数不仅包含一行，我的意思是，它 可以是一项完整的任务，具体取决于
this input argument. And the whole task will perform dynamically based on based on what 这个输入参数。整个任务 将根据什么动态执行
input argument you are supplying there. You are noticing one one thing that I that I just 您在那里提供的输入参数。 你注意到一件事，我只是
forgot, what is that thing I define this function? I guess everything is fine. I just have just 忘了，我定义的这个函数是什么东西 ？我想一切都很好。我刚刚
missed something Oh, document string, I should have written document string. Although document 漏了东西哦，文件串，我 应该写文件串。虽然文件
string is not essential. If you do not write document string, it's perfectly okay. The 字符串不是必需的。如果你不写文档 字符串，那完全没问题。这
function will run but it's a good practice. It's an it's a good habit to always write 函数将运行，但这是一个很好的 做法。经常写作是一个好习惯
a document string. Okay, let's see the power of input arguments by again, going to our 一个文档字符串。好的，让我们再次看看 输入参数的威力，转到我们的
good friend Jupyter Notebook. Okay, so let's see. Let's say we define a function define 好朋友 Jupyter 笔记本。好的，让我们 看看。假设我们定义了一个函数
Brent grant message, let's say, edit receives an argument message. And this argument is Brent grant 消息，比方说，edit 收到 一个参数消息。而这个论点是
just a variable, it's just a variable. And let's say we say okay, print message or further, 只是一个变量，它只是一个变量。 假设我们说好的，打印消息或进一步，
let's say you say, if is in stance message spraying, if this is spraying, then simply 假设你说，如果是立场信息喷洒 ，如果这是喷洒，那么简单地
then simply branded. If this is not a string, then just say okay, brand, your input argument 然后简单地打上烙印。如果这不是一个字符串 ，那么就说好的，品牌，你的输入参数
is not a string. And then you say, Okay, here is what you have, slide. And then you say, 不是字符串。然后你说，好的，这是你 所拥有的，幻灯片。然后你说，
okay, whatever you have slide, just see, okay, message. And that's it, that's it, that's 好的，无论你有什么幻灯片，请看，好的，留言 。就是这样，就是这样，就是这样
the function, we might have written a document screen for it. The function rents the message 函数，我们可能已经为它编写了 一个文档屏幕。功能租用消息
supplied by the user, or brains, that message is not in the form of strength. While Don't 由用户或大脑提供的信息不 是强度的形式。虽然不要
worry, we have to see the strings in detail, we will see the sprint function in detail 担心，我们必须详细查看字符串 ，我们将详细查看 sprint 函数
as well, because the sprint has a lot of lot to do with strings. So so just for now, I 同样，因为冲刺与字符串有很多 关系。所以就目前而言，我
mean, that's our function print message, let's say if the message is of string type, this 意思是，这就是我们的函数打印消息， 假设消息是字符串类型的，这个
string does not good, this is this should be simply str this should not be that is instant 字符串不好，这应该是简单 的 str 这不应该是即时的
steak like this, your input argument is not a string here is what you have supplied. Here 像这样的牛排，您的输入参数 不是您提供的字符串。这里
is what you have. So here, we can, we can say here is here is here is the type 就是你所拥有的。所以在这里，我们可以， 我们可以说这里是这里是这里是类型
of what 什么的
you have supplied. And then we can just print the Type, Type MSC. So the goal here is to 你已经提供了。然后我们可以只打印类型 ，类型 MSC。所以这里的目标是
just create a function that prints a message if that message is in plain string form. If 如果该消息是纯字符串形式，只需 创建一个打印消息的函数。如果
it is not a string, then it prints that okay, you're the whatever you have signed is not 它不是一个字符串，然后它会打印 出来，好吧，你是你签署的不是
a string, it is not a proper message in string form. Let's say this print message function 一个字符串，它不是字符串形式的正确 消息。假设这个打印消息功能
receives a string, let's say that's our logic or something. So let's run this. First of 接收一个字符串，假设这是我们的逻辑或其他 东西。所以让我们运行这个。首先
all, let's see what it does help rent message. So the function prints the message supplied 所有，让我们看看它对租用消息有什么 帮助。因此该函数打印提供的消息
by the user. We can access the same help by question mark if you want and it gives us 由用户。如果您愿意，我们可以通过问号 访问相同的帮助，它为我们提供
the document string If however, we want The implementation as well, then we write readable 文档字符串如果然而，我们也 想要实现，那么我们写可读
code and implementation is also available. While grade Python is really great. Okay, 代码和实现也是可用的。虽然 Python 年级真的很棒。好的，
let's call this function. Let's call this function, Brent, message. And whatever you 让我们调用这个函数。让我们调用 这个函数，Brent，消息。不管你
want to print, let's say, this is the message. This is the message, let's say you want to 想要打印，比方说，这是消息 。这是消息，假设您想要
print this. And this is the message that's printed. Okay, now, let's say you call this 打印这个。这是打印的消息。 好的，现在，假设你称之为
function again some time, and you supply 23. And it will say your input argument is not 过一段时间再运行一次，你提供 23。它会说你的输入参数不是
a string, here is the type of what you have supplied, it's an integer type rate, you can 一个字符串，这里是你提供的类型， 它是一个整数类型的比率，你可以
you can have, you can have, you can call this function in the following way, let's say you 你可以拥有，你可以拥有，你可以通过 以下方式调用这个函数，假设你
define a variable y, and the variable y contains 定义一个变量 y，变量 y 包含
Hello. 你好。
Hello there. 你好呀。
That's it, that's your, and then you called, then you call this function on y. And it will 就是这样，那是你的，然后你调用， 然后你在 y 上调用这个函数。它会
print hello there, because y is also a string. Great. So that's how you can you can you can, 在那里打印 hello，因为 y 也是一个字符串。伟大 的。所以这就是你能你能你能的方式，
you can pass different arguments and instruct the function, how should it behave without 您可以传递不同的参数并指示函数 ，它应该如何在没有
actually writing the whole logic of the task again, and again, if written all the logic, 实际上把整个任务的逻辑写一遍，再 写一遍，如果写了所有的逻辑，
once, actually, this is actually the logic starts from here. That's what the task is 曾经，实际上，这实际上是从这里 开始的逻辑。这就是任务
to, that's what the task you want to perform. And you need not write this again. And again, 到，这就是您要执行的任务。你 不需要再写这个。然后再次，
whenever you need this kind of stuff, you just call that function supplied arguments, 每当您需要此类东西时，您只 需调用该函数提供的参数，
and it will behave accordingly you want. Great. So you might be thinking, the function only 它会按照你想要的方式表现。伟大的 。所以你可能会想，函数只有
receives one argument, maybe we want to supply more than one arguments, maybe, maybe two 接收一个参数，也许我们想要提供 多个参数，也许，也许两个
arguments, maybe three, maybe four, maybe five, and maybe we want to supply several 争论，也许三个，也许四个，也许 五个，也许我们想提供几个
arguments. And we want to do some task based on the values of those arguments, or those 论据。我们想根据这些参数的 值来做一些任务，或者那些
variables. So in the next video, I'm going to show you multiple arguments. Okay. Hope 变量。所以在下一个视频中，我将 向您展示多个参数。好的。希望
to see you in the next video. So in the previous video, we saw we can define a function, and 下个视频见。所以在上一个视频中，我们 看到我们可以定义一个函数，并且
we can supply input argument to it. And in this video, we are going to see that we can 我们可以为它提供输入参数。在这个 视频中，我们将看到我们可以
actually send more than one arguments to the function these arguments are just variables, 实际上向函数发送多个参数 ，这些参数只是变量，
these are just variables, whatever value we will supply to these dynamically, because 这些只是变量，无论我们将动态 提供给它们什么值，因为
Python is dynamic dynamically typed dynamically they are type will be defined. And for example, Python 是动态动态类型的，它们 的类型将被定义。例如，
here we have supplied just two variables, and we just printed them, but based based 这里我们只提供了两个变量，我们 只是打印了它们，但是基于
on supplying more than one input arguments, and based on what logic we are going to perform, 提供多个输入参数，并基于 我们将要执行的逻辑，
we can do anything, we can do anything. So guess by thumbs, allows us to supply multiple 我们可以做任何事情，我们可以做任何事情 。所以凭经验猜测，允许我们提供多个
input arguments to a function and and we can, we can just perform all the tasks according 函数的输入参数，我们 可以，我们可以根据
to whatever logic we are going to do with that. So let's go to our friend Jupyter Notebook 无论我们要处理什么逻辑。那么让 我们去看看我们的朋友 Jupyter Notebook
and see an example of a function with multiple input arguments. Let's say the function the 并查看具有多个输入参数的 函数示例。让我们说函数
B define a function, let's say, my power, let's say, my power, my power, let's say, B 定义一个函数，比方说，我的权力，比方 说，我的权力，我的权力，比方说，
you remember there is a POW function in in Python that's a built in function. I'm going 你还记得 Python 中有一个 POW 函数 ，它是一个内置函数。我要去
to write my own function, let's say it contains a and b. Well, document string. My, this function 要编写我自己的函数，假设它包含 a 和 b。好吧，文档字符串。我的这个功能
computes 计算
power 力量
just like built built in power function. Great. That's the document screen. Okay. Now what 就像内置的电源功能一样。伟大的。 那是文档屏幕。好的。怎么办
we want to do is we want to print Okay, let's let's, let's create another variable, see, 我们想要做的是我们想要打印好的，让我们 ，让我们创建另一个变量，看，
that is a power B. Okay, then we print this C, and we are done. That's it. That's our 那是一个幂 B。好的，然后我们打印这个 C， 我们就完成了。就是这样。那是我们的
goal. So we register that function by just just calling the job by just pressing the 目标。因此， 我们只需按
shift enter in Jupyter Notebook. And now we check what this function does. Well, this 在 Jupyter Notebook 中 shift 输入。现在我们 检查这个函数的作用。嗯，这个
function can be horsepower, just like built in power function. Okay, just to Just to remind 函数可以是马力，就像内置的功率 函数一样。好的，只是为了提醒
you again and again, the importance of document strength, I'm writing this again and again, 你一次又一次，文件强度的重要性 ，我一次又一次地写这个，
let's run this function, my power, let's say three ways to recover for illness. So the 让我们运行这个功能，我的力量，让我们 说三种治愈疾病的方法。所以
result is 81. Oh my god. So whenever, by the way, if you don't have POW function with you, 结果是 81。天哪。所以，顺便说一句 ，如果你没有随身携带 POW 功能，
although you have, you can you can create your function and whenever you want to use, 虽然你有，你可以创建你 的函数，只要你想使用，
you can use your function, not a big deal. By the way, what if you? What if you What 你可以使用你的功能，没什么大不了的。 顺便说一句，如果你呢？如果你怎么办
if, let's say, you can, you can define a function with more than two arguments to find, let's 如果，让我们说，你可以，你可以定义一个有 两个以上参数的函数来查找，让我们
say, display types. That's it, that's your function display types. And all you know, 说，显示类型。就是这样，这就是您 的功能显示类型。而你所知道的，
is our check arguments, let's say, check our x. That's it, that's your function, and A, 是我们的检查参数，比方说，检查我们的 x。就是这样，这就是你的功能，A，
B, C, D, let's say E, these are the input arguments. And let's say, at some tasks, you B、C、D，让我们说 E，这些是输入 参数。比方说，在某些任务中，你
want to know whether all the five variables that you're working in somewhere, whether 想知道您在某处工作的 所有五个变量是否
all of them are numeric values or not. If they're not numeric values, you're not moving 它们都是数值与否。如果它们 不是数值，则您不会移动
on, and you're doing something because you were extra, let's say you're, let's say you're 在，你正在做一些事情，因为你 是多余的，假设你是，假设你是
taking input from somewhere reading from a file or whatever. And you need to, you need 从某处读取文件或其他内容 获取输入。你需要，你需要
to check before moving on whether A, B, C, D, and E, whether they are in sore floats. 在继续之前检查 A、B、C、D 和 E 是否处于疼痛漂浮状态。
Otherwise, if if if any of them is not into float, then you're not processing, then you're 否则，如果它们中的任何一个不是浮动 的，那么你就没有处理，那么你就是
not moving on, and you're going to check the input arguments again, and so on. These kind 不继续，您将再次检查输入 参数，依此类推。这些种类
of functions are there because whenever you call certain, whenever you want to do processing 有很多函数是因为每当你调用某个 函数时，无论何时你想要进行处理
on data, sometimes it is required to check the type of the data whether the data is supplied 在数据上，有时需要检查 数据的类型是否提供了数据
in a way that you were expecting and so on. So let's have this function check Oryx. I'm 以您期望的方式等等。所以让我们 让这个函数检查 Oryx。我是
not writing document string here, I guess, I've told you enough to write document string 不在这里写文档字符串，我想， 我已经告诉你足够写文档字符串了
again and again. So let's see. If is instance. A, if is instance int float? If that is true? 一次又一次。所以让我们看看。如果是实例。 A、instance int是否是浮点数？如果这是真的？
And 和
is it let's just have three variables just to just to focus on if is instance, a then 是不是让我们只有三个变量只是 为了专注于 if 是实例，然后
B. and is instance see if all of them are? If all B. 并且 是实例查看是否所有这些都是？我摔倒
of them are? If all of them are integers or floats, then do something then let's say Brent, 他们是？如果它们都是整数或浮点数， 那么做一些事情然后让我们说布伦特，
a plus b, plus C, maybe, or a plus b plus c, raised to the power to just print their a 加 b，加 C，也许，或 a 加 b 加 c，提升到只打印它们的能力
square, let's say else are if they are if they are all integers or floats, then do some 正方形，假设它们都是整数 或浮点数，那么做一些
interesting task here some task. Otherwise, you can say okay, print, 有趣的任务这里有一些任务。否则，你 可以说好的，打印，
air. The input arguments are not of the expected. But it's fine. You have this function, let's 空气。输入参数不符合预期。但是没 关系。你有这个功能，让我们
say, let's call this function. 说，让我们调用这个函数。
The function was check arcs. So let's check arcs, check. arcs, check arcs, let's say three, 功能是检查圆弧。所以让我们检查弧线， 检查。弧线，检查弧线，让我们说三个，
four, or five. So now you have all of them are great. Let's say you have jet arcs. And 四个或五个。所以现在你拥有所有 这些都很棒。假设您有喷射弧。和
you call this check ARDS. 你称之为检查ARDS。
On, 在，
let's say, three, four, but this five is a string, let's say, Gee. Now we'll be having 比方说，三，四，但是这五是一个字符串 ，比方说，哎呀。现在我们将有
an error. The input arguments are not all of the expected types. One of them or more 一个错误。输入参数并非所有 预期类型。其中一个或多个
of them or whatever. Yeah one more thing the this function is expecting three arguments 他们或其他什么。是的，还有一 件事这个函数需要三个参数
if you call this function by less than three or more than three arguments you'll be getting 如果你用少于三个或多于三个的 参数调用这个函数，你会得到
an error for example three four although this function is accepting three arguments, you're 一个错误，例如三四虽然这个 函数接受三个参数，你
calling it with just two you're getting an error because you have not specified all the 只用两个调用它你会得到一个 错误，因为你没有指定所有的
arguments that the function is requiring although the the arguments that you have supplied they 函数需要的参数，尽管 您提供的参数
are of the type that it is expecting, but you have not supplied the the number of arguments 是它所期望的类型，但 您没有提供参数的数量
that the function is expecting. Similarly, if you call this function by more than three 该功能正在期待。同样，如果你 调用这个函数的次数超过三个
arguments, although it requires three arguments, you again will get an error, because it is 参数，虽然它需要三个参数，但你会 再次得到一个错误，因为它是
expecting three arguments and you have not supplied three arguments. later on. In later 期望三个参数，而您没有提供 三个参数。稍后的。在以后
on, we will see how to write a function that accepts a variable number of arguments, we 接下来，我们将看到如何编写一个 接受可变数量参数的函数，我们
will see that but right now, in this particular way, if you write the function, if you define 会看到，但现在，以这种特殊的方式 ，如果你编写函数，如果你定义
the function in this particular way, you have to define the arguments the number of whatever 以这种特殊方式的函数， 你必须定义参数的数量
the number of arguments it is expecting, you have to supply exactly as many. Otherwise 它期望的参数数量，您必须提供 完全相同的数量。除此以外
you are getting an error. Okay, so that's about the multiple arguments. Okay, what next? 你得到一个错误。好的，这就是关于 多个参数。好的，接下来怎么办？
Well, next time, in the next video, we will see that what is the what's the importance 好吧，下次，在下一个视频中 ，我们将看到什么是重要的
of order of these input arguments? What will happen if I just swapped message to win message 这些输入参数的顺序？如果我只是 交换消息以赢得消息会发生什么
one? Will that will that change the behavior? Or is there any order? With the first mess? 一？这会改变行为吗？或者有什么 顺序吗？与第一次混乱？
The first variable, the second variable, third variable? Is there any ordering inside the 第一个变量，第二个变量，第三 个变量？里面有没有下单
input arguments? Yeah, there is. So let's see in the next video, in the last video, 输入参数？是的，有。让我们在下 一个视频中，在上一个视频中，
we saw, how can we pass multiple How can we define a function with more than one input 我们看到，我们如何传递多个如何 定义一个具有多个输入的函数
arguments, it is important to know that the order of the input argument is really, really 参数，重要的是要知道输入 参数的顺序是真的，真的
important. So whatever argument at the call time, for example, if you call this particular 重要的。因此，无论调用时的任何 参数，例如，如果您调用此特定
function, the name of the function is f, that's not a great name, you should have a name that 函数，函数的名字是 f，这不是一 个好名字，你应该有一个名字
a descriptive but I recommend write good names, let's say this is f, that's a function and 一个描述性的，但我建议写好名字， 假设这是 f，那是一个函数，
the very first variable is C to the second variable c one, the third variable is C three. 第一个变量是C到第二个变量 c一个，第三个变量是C三个。
Now you let's say call this function like like this, let's say two, four and nine, what 现在你让我们说像这样调用这个 函数，让我们说二、四和九，什么
will happen is this too will be copied in C two, this four will be copied in this C 会发生的是 this too 将在 C 中复制 两个，这四个将在这个 C 中复制
one and this nine will be copied in this C three. Now, C two has a value two, c one has 一和这九会被复制到这三中。 现在，C two 的值是 2，c one 有
a value four and C three has a value of nine. If you change the symbols or the variables 值四和 C 三的值是九。如果 您更改符号或变量
order here, whatever order you have written there, the first value that is passed at the 在这里排序，无论你在那里写 了什么顺序，第一个传递的值
call time will be passed to the first variable whatever the name of the first variable is, 无论第一个变量的名称是什么，调用 时间都将传递给第一个变量，
the second value at the call time is copied in the second symbol, whatever the name of 调用时的第二个值被复制到第二 个符号中，无论名称是什么
the symbol is. So, this ordering is really really important. One way to work one workaround 符号是。所以，这个顺序 真的很重要。一种解决方法
for this is at the call time, you actually define the variable names and their values. 因为这是在调用时，您实际上 定义了变量名称及其值。
For example, you call you call F and you say okay c one has this particular value, but 例如，您称您为 F 并且您说好 的 c 具有此特定值，但是
this way you need to know that there is the symbol name in definition is exactly c one. 这样您就需要知道定义中的 符号名称恰好是 c 之一。
So, C one has this value, C two has this value, C three has this value, once you at the call 所以，C一有这个值，C二有这个值 ，C三有这个值，一旦你在调用
time, if you have defined your variable names along with their values, then you are order 时间，如果您已经定义了变量 名称及其值，那么您就可以
free. Now you change whatever whatever if for example, you call this way c two is b, 自由。现在你改变任何东西， 例如，你这样称呼 c 2 是 b，
c one is a now no matter in what order you have called these, c one is a now 不管你以什么顺序 调用这些，
this C one is going to be copied in C one, the C two is going to be copied in C two and 这个 C 一将被复制到 C 一中，C 二将被复制到 C 二中，并且
C three is going to be copied in C three for the functions that has many more arguments, 对于具有更多参数的函数，C 3 将被复制到 C 3 中，
it is it is good to it is good to call the function in this particular way. If there 以这种特殊方式调用函数 是好的。如果有
is a chance that calling a function in a different order may may may become confusing and stuff 以不同的顺序调用函数可能 会变得混乱和东西
like so. This actually gives you more grip on this ordering issue. if if if you're if 像这样。这实际上可以让您更好地解决 这个排序问题。如果如果如果你是如果
you're happy with if you're very smart and When you say Ok, I will always supply in a 如果你很聪明，你会很高兴， 当你说好的时，我会一直提供
particular order, I will always read the document string first, and then I will call that function, 特定的顺序，我总是先读取文档字符串 ，然后我会调用那个函数，
that's okay. Otherwise, this is also a feature that is available at the call time, you assign 没关系。否则，这也是通话 时可用的功能，您分配
the values of the functions that are there at the definition time. And now no matter 定义时存在的函数 值。现在不管
in what order you are calling that function, see one occurs at third position c two occurs 您调用该函数的顺序是，看到一个 出现在第三个位置 c 出现了两个
at first position, the relative values will be copied according to their names. So and 在第一个位置，相对值将根据它们 的名称进行复制。所以和
that's a good feature. That's a very good feature. Let's see, for example, a running 这是一个很好的功能。这是一个非常好的功能 。让我们看看，例如，一个正在运行的
example of this in Python. In Jupyter, notebook, okay, define, let's say function f, let's Python 中的示例。在 Jupyter 中，笔记本，好吧 ，定义，让我们说函数 f，让我们
say it receives a, b, and c, let's say three values. And let's say prints. A, is that's 假设它接收 a、b 和 c，让我们说三个值 。让我们说印刷品。 A，是这样吗
it, Sprint, a, is a. And you'll say okay, B is B. And then it prints Okay. See, C, C 它，冲刺，一个，是一个。你会说好的 ，B 是 B。然后它打印好的。见，C，C
is, whatever the value of c is, that's the C, okay? Now, let's call this function f, 是，无论 c 的值是多少，这就是 C，好 吗？现在，让我们调用这个函数 f，
with, let's say, two, three, and game. So, they will say, okay, a is to B is three, C 比方说，二、三和游戏。所以， 他们会说，好吧，A 对 B 是三，C
is game, fine, great. Now, this tool will be copied in a no matter what if we if we 是游戏，很好，很棒。现在，这个工具 将被复制到一个无论如何如果我们
change this, if we change this calling order, for example, if we if we change this order, 改变这个，如果我们改变这个调用顺序 ，例如，如果我们改变这个顺序，
we just we just moved to we just moved to this particular order, we just say okay, this 我们只是我们刚刚搬到我们刚刚搬到这个 特定的顺序，我们只是说好的，这个
is three, this is game, this is to be called like, so now three will be copied in a game 是三，这是游戏，这就是所谓的 like，所以现在在游戏中复制三
will be copied in B and two will be competency. And that, if if if that is the behavior you 将被复制到 B 和两个将是能力。而且 ，如果如果那是你的行为
want, then you are good to go. Otherwise, it is it is handy to call the function in 想要，那你就可以走了。 否则，调用函数很方便
the following ways just fix, okay, a is a is to fine. B is three. And C is let's say 下面的方法就解决了，还好，a是a就 可以了。 B 是三个。而 C 是让我们说
again, if you want these numbers, now, if you call a function like so, that will happen. 再一次，如果你想要这些数字，现在， 如果你调用这样的函数，那将会发生。
Now, if you change the order, no matter what order of add the calling time you come up 现在，如果您更改顺序，无论您 添加调用时间的顺序是什么
with, it will stay the same. For example, you go and say okay, C is at the first position. 与，它将保持不变。例如， 你去说好的，C 在第一个位置。
And a is at the second position, let's say two, and B is at the third position three, a 在第二个位置，比方说 二，B 在第三个位置三，
the output will stay the same. And that's a, that's a beautiful, that's a beautiful 输出将保持不变。那是一个，那 是一个美丽的，那是一个美丽的
thing. So that's one way of handling with the order. If you if if you think at call 事物。所以这是处理订单的一种方式 。如果你如果你在电话中思考
time it is important to define the variable names, but it has one problem that you need 时间定义变量名很重要， 但它有一个你需要的问题
to know you need to know exact variable names. If the variable name is C one there, you need 要知道您需要知道确切的变量名称。如果 变量名是 C 那里的一个，你需要
to know what it's see one, you need not to I mean the C one matches with C it must match 要知道它是什么，你不需要我的 意思是 C 与它必须匹配的 C 匹配
with C one, C two must match with C two and so on. So you need to know these names. Okay, 与C一，C二必须与C二匹配，依此类推 。所以你需要知道这些名字。好的，
great. In the upcoming videos, more features of functions are are going to are going to 伟大的。在即将发布的视频中 ，更多的功能特性将会出现
be discussed. So stay with us hope to see you in the next video. So we in the last video, 进行讨论。所以留在我们身边，希望在下一 个视频中见到你。所以我们在上一个视频中，
we saw the ordering of input arguments in a function. 我们看到了函数中输入参数的 顺序。
And we saw a fix to it. I mean, if you if you if there is a chance that you may miss 我们看到了解决方法。我的意思是， 如果你如果有机会，你可能会错过
a proper order, there is a way to fix that we saw that in the last video. Here, we have 正确的顺序，有一种方法可以解决我们在上 一个视频中看到的问题。在这里，我们有
another another thing to discuss this x variable x input argument This is the variable that 另一件事要讨论这个 x 变量 x 输入参数 这是变量
is defined inside a function although the value it receives is copied from somewhere 虽然它接收的值是从某处复制 的，但在函数内部定义
else, but it is defined inside the function that is also the function variable or the 否则，但它是在函数内部定义 的，该函数也是函数变量或
or the variable that is in the scope of the function inside the function in the body of 或在函数体内的函数 范围内的变量
the function something like so it may be handy. For example, let's say you want you you compute 功能类似这样它可能很方便 。例如，假设你想要你计算
something you do some processing on your inputs. And whatever the result is you save that result 你对你的输入做一些处理。无论结果 如何，您都可以保存该结果
in another variable. And let's say now you need the value of this variable. to do some 在另一个变量中。假设现在您 需要这个变量的值。做一些
further process, let's say, what you do is let's say in a call time, that's let's say 进一步的过程，比方说，你做的是让我们 在通话时间说，也就是说，让我们说
this is the this of the function and say, This is the complete function. And let's say 这是函数的 this 并说，这 是完整的函数。让我们说
a is equal to 12. And B is equal to, let's say seven. And let's say you call the function a 等于 12。B 等于，比方 说 7。假设你调用函数
add a, b, now the value of a will be copied in x, the value of d will be copied in Y, 添加a，b，现在a的值将被复制到 x中，d的值将被复制到Y中，
okay, and now, you need the Sum of a and b, to be received here, in a variable, you want 好的，现在，您需要在这里接收 a 和 b 的总和，在一个变量中，您想要
a variable in which the results should be saved. For example, let's say a variable is 应保存结果的变量。例如 ，假设一个变量是
D, let's say, and then you want to do some more processing on D, let's say d doublestar D，比方说，然后你想对D做更 多的处理，比方说d doublestar
five, mod three, and maybe you need to apply an if condition on that if that equals to 五，mod 3，也许你需要应用一 个 if 条件，如果它等于
zero, then do some stuff otherwise, so let's say you need this variable out, what will 零，然后做一些其他的事情，所以 假设你需要这个变量，什么会
happen is this C variable is not accessible outside this function. And the reason is the 发生的是这个 C 变量在这个函数 之外是不可访问的。原因是
C is defined inside the function when the function body completes its execution, the 当函数体完成执行时，C 被定义在函数内部，
C is lost sees no more available, C is defined when the function call has been made, when C 丢失了，看不到更多可用的，C 是 在进行函数调用时定义的，当
the when when you're executing the statement C is defined and a memory location was created 当你执行语句 C 被定义 并创建一个内存位置时
in a C sometimes called the function space in the memory or process space that is created 在 C 中有时称为创建的内存 或进程空间中的函数空间
in memory. But once all the body of the function executes all the functions that were inside 在记忆中。但是一旦函数的所有主体 都执行了内部的所有函数
the variable they are lost, what how can you How can you receive this value? How can you 他们丢失的变量，你怎么 能收到这个值？你怎么
receive the value inside see outside this function? So, that is, that is question in 接收内部的值，看到外部的这个函数 ？所以，也就是说，这是问题
this slide, how can we do that further, 这张幻灯片，我们如何进一步做到这一点，
this particular function can access all the variables that are not defined in this function, 此特定函数可以访问此函数 中未定义的所有变量，
but that are available outside this function and are defined already. For example, let's 但在此功能之外可用并且已经 定义。例如，让我们
say I have a function, f. And the function is let's say I have a function f. And so if 说我有一个功能，f。假设我 有一个函数 f。所以如果
this function is defined, like so f, let's say F is your function, and it has to find 这个函数是定义的，就像 f 一样， 假设 F 是你的函数，它必须找到
like D, E, F, and that's it. And here it prints let's say, some variable, let's say a. Let's 像 D、E、F，仅此而已。在这里它打 印出一些变量，比如说a。让我们
now now you know this a variable is no longer in F not even defined in F, but as long as 现在你知道这个变量不再在 F 中 甚至不在 F 中定义，但只要
this a variable is defined, before calling F for example, that's the cell where we are this 定义了一个变量，例如在调用 F 之前，这就是我们所在的单元格
writing the code and we say okay, a is equal to seven, and then we just call this F, because 写代码，我们说好的，a 等于 7，然后我们就叫这个 F，因为
a was available before calling f a will is accessible here. So, the functions the variables a 在调用 f 之前可用 a will 可 在此处访问。所以，函数变量
that are available before the call, they are available inside the functions, but the variables 在调用之前可用，它们 在函数内部可用，但变量
that are defined inside the functions, they are not available outside. That's the problem 在函数内部定义的，它们在外部 不可用。那就是问题所在
further, if we define this ad here is equal to two now, this a is sometimes called the 此外，如果我们现在定义此广告 等于 2，则此 a 有时称为
local variable or the function where the variable there is local to the function. Now, this 局部变量或函数，其中变量是函数 的局部变量。现在，这
a is is is defined inside the function and all the accesses to a will access this value a is is 在函数内部定义，所有 对 a 的访问都将访问此值
to rather than the sound considered sound has a separate location in memory, and this 而不是被认为是声音的声音在内存 中有一个单独的位置，而这个
too has a separate location and memory, both have names a, but this a will only be referred 也有单独的位置和内存，两者都 有名字a，但是这个a只会被引用
to when the function is executing, after the after the execution of the function completes to 当函数正在执行时， 在函数执行完成之后
this has gone from the from the memory and this will still be available, the seven will 这已经从记忆中消失了 ，这仍然可用，七个将
still be available. So it is good to know and by the way, if a was not defined here, 仍然可用。所以很高兴知道，顺便 说一下，如果这里没有定义 a，
and you still call F, then either you will be getting an error, or this a might be a 然后你仍然调用 F，那么你要么会得到 一个错误，要么这 a 可能是一个
global variable or available in some package that you have already loaded or stuff like 全局变量或在您已经加载 的某些包中可用或类似
so, in that case, this eight will be accessed if it's a global variable or accessible. So, 因此，在这种情况下，如果它是全局变量或 可访问的，则这八个将被访问。所以，
it is good to know the the scope of the variables inside the function because when you're calling 最好知道函数内变量的范围 ，因为当你调用时
them what functions if this if x is already defined, for example, if x is already defined 如果 x 已经定义，例如，如果 x 已经定义，它们的功能是什么
like 34 and then this x is 34, as long as this x is not defined here, if x is defined 像34然后这个x就是34，只要这里 没有定义这个x，如果x被定义了
here, this is this x actually is the local copy and that will be accessed inside the 在这里，这是这个 x 实际上是 本地副本，它将在内部访问
function. Once the function is gone again x will be 34. So, it is good to know the local 功能。一旦函数再次消失，x 将是 34。所以，最好知道本地
copies or or the function space itself. The but but the problem here is how to access 复制或或函数空间本身。但是 ，这里的问题是如何访问
them. This variable the value of this variable outside the function, because this is completely 他们。这个变量是这个变量在 函数之外的值，因为这完全是
defined inside 内部定义
how to access that? Well, well, there is a fix, and that fix is called the return statement. 如何访问？嗯，嗯，有一个修复 ，这个修复被称为 return 语句。
If you write the return statement, for example, you return this value. So x plus y, you might 例如，如果您编写 return 语句，您将 返回此值。所以 x 加 y，你可能
have saved these values, you might have saved these values, for example, C equals x plus 已经保存了这些值，您可能已经保存 了这些值，例如，C 等于 x 加
y, that's okay. And then you say, okay, return, see, what will happen is wherever you have y，没关系。然后你说，好吧，回来，看 ，无论你有什么，都会发生什么
called this function, d equals add, let's do three. Now, this value, this value C, which 调用这个函数，d等于add，我们做 三个。现在，这个值，这个值 C，
in this particular case is five, that value will be returned in D, and all the properties 在这种特殊情况下是 5，该值 将在 D 中返回，并且所有属性
of this variables are returned in D. So just like the C is copied in D, and this is available 这个变量的一部分在 D 中返回。所以 就像 C 被复制到 D 中一样，这是可用的
further, whatever you want to do with this D. Okay, so yeah, so return statement is there. 此外，无论你想用这个 D 做什么。好 的，是的，所以 return 语句就在那里。
So, in the next video, we will actually code this in Jupyter Notebook and see the return 因此，在下一个视频中，我们将实际在 Jupyter Notebook 中对此进行编码并查看返回
statement running and we will see the scope of the variables and all that in Jupyter Notebook. 语句运行，我们将看到变量的范围 以及 Jupyter Notebook 中的所有内容。
So hope to see you in the next video. In the last video, we saw a scope of a variable particularly 所以希望在下一个视频中见到你。在上一个 视频中，我们看到了一个变量的作用域，特别是
if a function if a variable is defined inside a function, is it accessible outside the function 如果一个函数如果一个变量定义在一 个函数内，它是否可以在函数外访问
and if a variable is defined outside the function, is it accessible inside the function and vice 如果在函数外部定义了一个变量，它是否 可以在函数内部访问，反之亦然
versa? and so on. So we discussed those kinds of things, which is sometimes called school 反之？等等。所以我们讨论了 那些有时被称为学校的事情
scope of a variable. And further, we discussed what if we want, what if we want a value of 变量的作用域。此外，我们讨论了如果我们 想要什么，如果我们想要一个值
the function that is computed value value of some variable or some result that is computed 计算某个变量的值或计算 出的某个结果的函数
inside a function? What if we want that to be accessed outside, outside the function? 在函数里面？如果我们希望 在函数外部访问它怎么办？
So we discussed that in detail in the last video, so let's see all those concepts in 所以我们在上一个视频中详细讨论了 这一点，让我们看看所有这些概念
a running form in Jupyter. notebook. So let's see how it works. So first of all, let's define Jupyter 中的一种运行形式。笔记本。那么让我们 看看它是如何工作的。所以首先，让我们定义
variables, let's define a function, let's say define, let's say, my ad. And let's say 变量，让我们定义一个函数，让我们说 定义，让我们说，我的广告。让我们说
it receives two arguments, let's say a and b. And then let's say C is a plus b, let's 它接收两个参数，假设 a 和 b。然后 让我们说 C 是一个加 b，让我们
say that C are our c value, that's a c value or some value, whatever, whatever you want 说 C 是我们的 c 值，那是一个 c 值 或某个值，不管你想要什么
to call that value, some value. That's it. Let's say we did, we did that. Now we want 调用那个值，一些值。就是这样。假设 我们做到了，我们做到了。现在我们要
to access that some value from outside the function. paint some value. By the way, let's 从函数外部访问某个值。画一些 价值。顺便说一下，让我们
first call this function, let's say my app, add four values, let's say two, three. So 首先调用这个函数，假设我的应用程序， 添加四个值，假设两个，三个。所以
two will be copied in a three will be copied in B. So then, let's access let's try to access 二将被复制到三将被复制到 B。那么 ，让我们访问让我们尝试访问
this value, some value, it will throw an error. And the reason is this variable, some value 这个值，某个值，它会抛出一个错误 。原因是这个变量，一些值
is not accessible outside this function. What if we want to access because this is defined 在此功能之外无法访问。如果我们 想访问，因为这是定义的怎么办
inside the function? What if we want to access this? I mean, what if we want to compute some 在函数里面？如果我们想访问它怎么办 ？我的意思是，如果我们想计算一些
result and then use that result outside the function? So the way out, as discussed in 结果然后在函数之外使用该 结果？所以出路，如讨论
the last video is return statement. Return Value. And now if we call that again, let 最后一个视频是退货声明。返回值 。现在如果我们再次调用，让
me let me go if we call that again. Now, what we haven't actually registered, by the way, 如果我们再次打电话，我让我走。现在，顺便 说一下，我们实际上还没有注册的东西，
remember this, that's, that's a common error I got in that era, a lot of a lot many times. 记住这个，那个，那是我在那个时代犯 的一个常见错误，很多很多很多次。
If you change the implementation of the function, you have to rerun that cell, you have to register 如果你改变了函数的实现，你必须 重新运行那个单元格，你必须注册
the updated copy of the function to the Python, otherwise, you will be getting errors. Probably, 将函数的更新副本复制到 Python，否则 ，您将收到错误消息。大概，
yeah. What's the problem here? Now, when somebody Oh, we, oh, there's somebody is still not 是的。这里有什么问题？现在，当有人 哦，我们，哦，还有人还没有
still not accessible. Because some value is not is not accessible it is it is a variable 仍然无法访问。因为某些值不是 不可访问的，所以它是一个变量
defined inside the function it is scope in, its the scope of this variable, is just the 在其作用域内的函数内部定义， 它的这个变量的作用域，就是
body of the function. So let's receive this output in a variable D. And then let's just 函数体。所以让我们在变量 D 中 接收这个输出。然后让我们
print D and D is five. Great. So one more thing. Let's say we define a variable here, 打印 D 和 D 是五。伟大的。所以还有一件 事。假设我们在这里定义了一个变量，
of variable outside the function, let's say that's a label name. That's a very lengthy 函数外的变量，假设这是一个 标签名称。这是一个很长的
name, but let's say that's the name variable. Well outside the function that saves value 名称，但假设这是名称变量。 好在保存价值的功能之外
is three. And then 是三。进而
then let's define another function somewhere. Let's see, let's define another function down 然后让我们在某处定义另一个函数。 让我们看看，让我们定义另一个函数
somewhere, let's say define F, maybe G, and it receives nothing, but it prints this, that's 在某处，假设定义 F，也许是 G，它什么 也没收到，但它打印了这个，那就是
a variable. out side the function. And that's it. That's it, that's a function. Now, when 一个变量。功能之外。就是这样。就 是这样，这是一个功能。现在，当
we call this function, this variable outside the function that is accessible inside the 我们称这个函数，这个变量在函数 外部，可以在函数内部访问
function. So so and and, and if this function, and if this variable is not defined inside 功能。所以，和，如果这个函数， 如果这个变量里面没有定义
here, and if there is this is defined somewhere else, and it is global or accessible, it will 在这里，如果在其他地方定义了 this， 并且它是全局的或可访问的，它将
still be accessible. However, if we define a function with the same name, let's say variable, 仍然可以访问。但是，如果我们 定义一个同名的函数，比如说变量，
outside, outside the function, let's say five, now, this function will print five, if we 外面，在函数外，比方说五个，现在， 这个函数将打印五个，如果我们
because that's the local variable, that's the local variable in the function. Now, this 因为那是局部变量，那是函数 中的局部变量。现在，这
will be accessed in this print statement. Let's see. Now the result will be five. But 将在此打印语句中访问。让我们 来看看。现在结果将是五个。但
if you print the variable outside, now the value will be three, because this variable, 如果你在外面打印变量，现在 值将是三，因为这个变量，
this particular variable that was inside the function, it got destroyed when the function 函数内部的这个特定变量 ，当函数被销毁时
finishes. And this is available again. So yeah, so you need to know, by the way, it's 完成。这再次可用。所以是的，所以 你需要知道，顺便说一下，它是
a good practice whenever you want to, whenever you want to access a particular variable inside, 无论何时，无论何时，只要您想访问 内部的特定变量，都是一个好习惯，
it is a good practice to pass that variable as input argument to minimize the confusions 将该变量作为输入参数传递以最大 程度地减少混淆是一种很好的做法
because this can create a lot of confusions. So it's a good practice, although the feature 因为这会造成很多混乱。所以这 是一个很好的做法，虽然功能
is available and sometimes useful as well. But it is always recommended to pass the values 是可用的，有时也很有用 。但始终建议传递值
as input arguments that whatever you want to access inside the function. Okay, so one 作为输入参数，无论您想在函数 内部访问什么。好的，所以一个
more thing, this, this function g is returning nothing. For example, it is not returning 更重要的是，这个，这个函数 g 什么 都不返回。例如，它没有返回
anything, it is just printing, let's say something, let's say it is not printing anything, let's 任何东西，它只是打印，让我们说点什么， 让我们说它不打印任何东西，让我们
say, let's say this is a comment, let's say it is not printing anything. So this, and 说，假设这是一条评论，假设它没有 打印任何内容。所以这个，和
then we call this and that's it. So it has no return value. By the way, in Python, even 然后我们称之为这个，就是这样。所以它没有 返回值。顺便说一句，在 Python 中，即使
if you even if any function, even if a function does not return anything, it still returns 如果你即使有任何函数，即使一个函数 没有返回任何东西，它仍然会返回
a value, which is called none, which you can see here. So in Python, a function always 一个值，称为 none，您可以在此处看到 。所以在 Python 中，一个函数总是
returns a value. If you write a return statement explicitly, it returns that if you do not 返回一个值。如果你明确地写了一个 return 语句，它会返回，如果你没有
write return statement, when the function body finishes, it automatically returns none. 写return语句，当函数体 结束时，自动返回none。
Let's see the type of this output. What is the type of this output? What is the type 让我们看看这个输出的类型。这个 输出的类型是什么？什么是类型
of this man, what kind of data type is this? Let's see. It's an n type, I mean, that's 这个人，这是什么类型的数据？让我们来看看 。这是一个 n 类型，我的意思是，那是
a type in Python. So downs are non type, output, how fancy Well, one more thing, the return Python 中的一种类型。所以downs都是非类型的， 输出，怎么花样嘛，还有一件事，返回
statement is not only used to return a particular value, if you for example, in a particular 语句不仅用于返回特定值， 例如，如果您在特定
function, let me write a function here. Let's say d f, that's the function is H. And then 函数，让我在这里写一个函数。让 我们说 df，那是函数是 H。然后
inside that function, you do something, let's say print, a, let's say then you define a 在那个函数里面，你做一些事情，比如说 打印，a，然后你定义一个
variable, let's say a equals to three, let's say, then B equals let's say five, and then 变量，假设 a 等于 3， 假设 B 等于 5，然后
you add those values A and B. And then you do some other stuff, let's say plant something. 你将这些值 A 和 B 相加。然后你做一些 其他的事情，比如说种植一些东西。
And then you just write a return statement without any output or I mean it is not returning 然后你只写一个没有任何输出的返回 语句，或者我的意思是它没有返回
anything. You can still you can still I mean continue writing the function body more and 任何事物。你仍然可以 你仍然可以 我 的意思是继续编写更多的函数体
more. But what happens is whenever the first return will be encountered, 更多的。但会发生的是，每当遇到 第一个返回时，
the function returns from there. So the effective body of the function is just that the function 该函数从那里返回。所以 函数的有效体就是函数
returns right from there. If you return a particular value for example C, you can receive 从那里返回。如果您返回一个 特定的值，例如 C，您可以收到
that value outside the function. If you do not return anything, just type a return statement. 函数外的那个值。如果您不返回 任何内容，只需键入 return 语句。
That means exit the function right away. It works like the break statement and loop. Remember 这意味着立即退出该功能。它的工作 原理类似于 break 语句和循环。记住
the break statement it It resembles to break Excitement bulletin means just exit the function break 语句它类似于 break 兴奋 公告意味着退出函数
right away, no problem. And by the way, when return is called the default return value 马上，没问题。顺便说一句，当 return 被调用时，默认返回值
that is returned is none type if the return is called without, without an argument here, 如果在没有参数的情况下调用返回 值，则返回的类型为 none 类型，
so for example, let's run this function. Let's see. And let's call that function Ah, yeah. 例如，让我们运行这个函数。让我们来看看 。让我们调用该函数 啊，是的。
So it prints a, then it brings something and then it returns. And it returns, for example. 所以它打印一个，然后它带来一些东西 ，然后它返回。例如，它会返回。
It returns nothing but anon. It returns or not. And if you didn't see, for example, saying, 它只返回 anon。它返回与否。 如果你没有看到，例如，说，
then it returns 然后它返回
a C, value of C, which is eight. And this time this type, the return value is no longer a C，C 的值，即八。而这 次这个类型，返回值不再
none type, it is probably an integer type. Let's see. Yeah, here. So it's indeed a type none 类型，它可能是一个整数类型。让我们来 看看。是的，在这里。所以它确实是一种类型
Make sense? Yeah. So return statement has two purposes, one, you can return a value, 有道理？是的。所以return语句有两 个目的，一，可以返回一个值，
two, you can return, you can just return the control, you can just exit the function like 二、可以返回，可以返回 控件，退出函数就好了
the break and loops. Just Just one more thing. return statement can return multiple values. 中断和循环。只是还有一件事。 return 语句可以返回多个值。
For example, let's say we have defined a function, let's say J. Let's say G, G, we already have 例如，假设我们已经定义了一个函数，假设 是 J。假设 G，G，我们已经有了
defined, we can redefine it. But let's say our is our function. And we just have a equals 定义，我们可以重新定义它。但是让我们说我们 的就是我们的功能。我们只是有一个平等的
five, b equals seven, and D equals let's say something. And then we just return them a, 五，b 等于七，D 等于让我们说点什么 。然后我们就返回给他们一个，
b, and A, D, and D. So return statement can return multiple values in a sequence. Now, b、A、D、D。所以return语句可以在 一个序列中返回多个值。现在，
if you receive those values, let's say X, Y and Z equals r, so a will be copied in a 如果您收到这些值，假设 X、Y 和 Z 等于 r，那么 a 将被复制到 a
is a first return value, it will be returned in X, it will be copied in x, b will be copied 是第一个返回值，它将在 X 中返回 ，它将在 x 中复制，b 将被复制
in y, and D will be copied in z just as a sequence as you as you keep the sequence in 在 y 中，并且 D 将被复制到 z 中，就像您将序列保留在
the return statement, if you change the sequence and return statement accordingly. So whatever return 语句，如果您相应地更改序列 和 return 语句。所以无论如何
the first value here is the first value here, whatever the second value, here is the second 这里的第一个值是这里的第一个值， 无论第二个值如何，这里是第二个
value here, and so on. So let's run this and just print all these things X, Y, and Z. So 这里的价值，等等。所以让我们运行它 并打印所有这些东西 X、Y 和 Z。所以
yeah, five salmon and something. So this return statement is really powerful. I mean, it can 是的，五条鲑鱼什么的。所以这个return语句 真的很强大。我的意思是，它可以
return multiple, not all the languages, actually, not all the languages, they have feature to 返回多个，不是所有的语言，实际上 ，不是所有的语言，它们有特性
return multiple values. But Python does have feature to return more than one values. And 返回多个值。但是 Python 确实 具有返回多个值的功能。和
more than one values of any type A can have different types, you can have different types, 任何类型 A 的多个值可以有不同 的类型，你可以有不同的类型，
you can have different type, and so on. So that's about the that's about the return statement, 你可以有不同的类型，等等 。这就是关于返回语句的内容，
as well as the variable scope. And whether you can access a variable that is outside 以及变量作用域。以及是否 可以访问外部变量
the function or inside the function, and so on, and all that kind of things. In the next 函数或函数内部等等 ，诸如此类。下一个
video, we will talk about what if we want to access arbitrary number of input arguments. 视频，我们将讨论如果我们想访问 任意数量的输入参数怎么办。
I mean, we do not know how many arguments will be there inside. But no matter how many 我的意思是，我们不知道里面 会有多少争论。但无论多少
arguments a particular user is giving, let's say we want to write an add function. Just 特定用户提供的参数，假设我们 要编写一个 add 函数。只是
Just to give you an example, let's say you want to write an add function that says define 举个例子，假设你想 写一个 add 函数来定义
add that say add to another function, add two. Let's say it receives an arbitrary number 添加说添加到另一个函数，添加 两个。假设它接收一个任意数字
of arguments. D in I don't know how many and it has some implementation, then anybody who 论据。 D in 我不知道有多少并且 它有一些实现，然后任何人
wants to call this add to it, if that person gives two or two arguments, then just two 想调用这个添加到它，如果那个人给出 两个或两个参数，那么只有两个
should be added. If the person gives three arguments, then three should be added. I mean, 应该添加。如果此人给出三个参数 ，则应添加三个参数。我的意思是，
the person can give arbitrary number of arguments. How can we handle that because because the 这个人可以给出任意数量的参数。 我们如何处理，因为因为
caller the this is the call, this is the call, the caller can give five arguments, six arguments, caller this is the call, this is the call, caller 可以给五个参数，六个参数，
seven arguments. And earlier we saw in the definition, the total number of variables 七个论据。之前我们在定义 中看到，变量的总数
when we specify, we have to pass those many arguments for sure. If a single argument is 当我们指定时，我们必须肯定地传递 这么多参数。如果单个参数是
missing, or a single argument is just more than the specified number of variables, we 丢失，或者单个参数只是 多于指定的变量数，我们
will be getting an error. But how can we handle the situation where we have an arbitrary or 会出错。但是我们如何 处理我们有任意或
variable number of input arguments? How can we handle that? So to answer this, or to get, 可变数量的输入参数？我们该如何处理 ？所以要回答这个问题，或者得到，
how can we do that? See our next video? It's coming. In the last video we were talking 我们怎么做？看我们的下一个视频？它来 了。在上一个视频中我们正在谈论
about how can we handle arbitrary number of input arguments. For example, let's let's 关于我们如何处理任意数量的 输入参数。例如，让我们
say we want to write an add function. That should be a To add any number of let's say 假设我们要编写一个 add 函数。那 应该是添加任意数量的让我们说
integer or floating point numbers that are passed in. Remember last time, we discussed 传入的整数或浮点数。 记得上次，我们讨论过
in an earlier video, that when you are defining a function, the total number of variables 在之前的视频中，当你定义一 个函数时，变量的总数
that you are defining, you have to pause exactly those many input arguments. Otherwise, you're 您正在定义，您必须准确地暂停那些 许多输入参数。否则，你是
getting an error. But but this may be required some time that we want to add a universal 得到一个错误。但是这可能需要一些 时间，我们要添加一个通用的
kind of add function that has that has capacity to receive any number of arguments. But no 一种具有接收任意数量参数的 能力的 add 函数。但不是
matter how many arguments it receives, it, just add them all and return the result. Such 无论它接收多少个参数，它都只需 将它们全部添加并返回结果。这样的
a function, if available will be very, very helpful. Because sometimes we might be calling 一个功能（如果可用）将非常非常 有帮助。因为有时我们可能会打电话
that function by just two arguments. Sometimes we might be adding might be calling that function 该函数只有两个参数。有时我们 可能会添加可能正在调用该函数
with, let's say, 比方说，
three arguments, and sometimes more arguments or less arguments and so on. How can we have 三个参数，有时更多的参数或更 少的参数等等。我们怎么能有
this kind of feature available, but the implementation is just one time implementation? Well, Python 这种功能可用，但实现只是 一次实现？好吧，Python
have a very, very easy way of handling this arbitrary or variable number of inputs. And 有一种非常非常简单的方法来处理 这种任意或可变数量的输入。和
the way you do that is when you receive when you are defining a function, you just write 你这样做的方式是当你在定义 一个函数时收到，你只需写
a star, and then just Brent let's say, one variable name, let's say arcs. And then after 一颗星，然后只是布伦特让我们说， 一个变量名，让我们说弧线。然后之后
that, this arts will act like a list. And I mean, it will be having a lot of properties 那个，这种艺术会像一个清单 。我的意思是，它将有很多属性
are this arts has a property, this this x like list, so all the arguments that you will 这个艺术有一个属性，这个这个 x 喜欢列表，所以你会的所有参数
send in will be received like, like you're receiving those in a in one list. And all 发送将被接收，就像你在一个列表 中接收那些一样。和所有
elements, which are the arguments in the list, they are accessed by different indices, we 元素，它们是列表中的参数，它们 被不同的索引访问，我们
will see lists in detail later on. But right now just think it is a collect all the collection, 稍后将详细查看列表。但现在只是 认为它是一个收集所有的集合，
it is received by indices, for example, the ARDS, the very first element is indexed by 它由索引接收，例如 ARDS，第一个元素由
zero, it is at the zero location. At the zero location, there is a three at first location, 零，它在零位置。在零位置 ，第一个位置有一个三，
for example, the location index number one, which is actually the second look, the four 例如，位置索引第一，实际上 是第二外观，第四
will be copied at this and so on. Now, no matter how many arguments you pass a list, 将在此复制等等。现在，无论 你传递多少个参数列表，
it will be of that size, and there is a function length le n that is handy to just check how 它将是那个大小，并且有一个函数 长度 len 可以方便地检查如何
many arguments are there. Now if you pass two arguments, the arcs will, the length of 有很多论点。现在，如果你传递 两个参数，弧线将，长度
the arc will be two, if you have three, if you have passed three arguments, the length 弧将是两个，如果你有三个， 如果你传递了三个参数，长度
of the arts will be three and so on. No matter how many arguments you pass this arcs, it 的艺术将是三等。无论你传递 多少参数这个弧，它
will receive all them in one by one and all the elements in that arc will be indexed by 将一一接收所有这些元素，并且 该弧中的所有元素都将被索引
012, starting from zero until the length of the arcs. So see, for example, here, they 012，从零开始直到弧的长度。所以 看，例如，在这里，他们
said the sum sum equals zero, let's, let's say we want to add all these for i in range. 说总和等于零，让我们，假设我们 要在范围内为 i 添加所有这些。
And inside range, we just give the length of arcs for this example 12345, the length 在范围内，我们只给出这个 例子的弧长 12345，长度
of arg is five. So I will start from zero till till four, because five is not included. arg 是五。所以我将从零开始 直到四，因为不包括五。
So the very first time I will be zero, and our eggs in subscript zero is actually the 所以第一次我会是零，我们 下标零的鸡蛋实际上是
value value of the first variable, which is three, so three is added to zero, then next value 第一个变量的值，也就是 三，所以三加零，然后下一个
time, I will be one and add the position one four is located. So three plus equals four, 时间，我将一并添加位置一四 所在。所以三加等于四，
which means three equals three plus four, a sum equals whatever the some previous value 这意味着三等于三加四， 总和等于之前的某个值
of the sum plus for the next time, the value of i will be four, you know how this loop 下一次的总和加上，i 的值 将是 4，你知道这个循环
works, we discussed the loop and loops in detail. And as you move on, you actually explore 有效，我们详细讨论了循环和循环 。当你继续前进时，你实际上探索
all these numbers. And this variable sum actually contain the sum of all the variables. Now 所有这些数字。而这个变量 sum 实际上 包含了所有变量的总和。现在
you can return the sum and that at this particular function acts like a universal guide a function 您可以返回总和，并且在此特定函数 中就像一个函数的通用指南
that receives arbitrary number of arguments. How cool is that? Let's see in Jupyter Notebook 接收任意数量的参数。多么酷啊 ？让我们在 Jupyter Notebook 中看到
to get more convinced how it works. So let's say we have define, let's say we have any 更加确信它是如何工作的。所以假设 我们有定义，假设我们有任何
function, my ad, they might add, let's say that function might add powerful, that's universal 功能，我的广告，他们可能会添加，假设 功能可能会添加强大的功能，这是通用的
or universal. Universal might add universal, and it received receives star whatever the 或通用。通用可能会添加通用，并且 它收到了星星，无论是什么
variable name is, that you can read, you can write the name arcs or you can write any other 变量名称是，你可以读，你可以 写名字弧或者你可以写任何其他
other variable limits. This is this is just this is just a name of a variable. Okay, then 其他可变限制。这就是这只是 这只是一个变量的名称。好吧
let's say we have let's say we have s equals zero, which is some, then we just apply a 假设我们有假设我们有 s 等于零，这 是一些，那么我们只需应用一个
loop. I guess you know, the loops we have lengthy discussion on loops, in range, length, 环形。我想你知道，我们对循环进行 了长时间的讨论，范围、长度、
that's a built in function length arcs. Okay, then what should we do s plus equals r x 这是一个内置的函数长度弧。好的， 那我们应该怎么做 s plus 等于 r x
i, which means access all the elements one by one. And this is again the same as S is i，这意味着一一访问所有 元素。这又与 S 相同
equal to s plus r x i. Either way you write this way or that way, both ways are fine. 等于 s 加 r x i。无论你这样写还是 那样写，两种方式都可以。
Then when the loop finishes, s contains the Psalm, just return it, and you are done. Wow. 然后当循环结束时， s 包含 Psalm， 只需返回它，你就完成了。哇。
Now, let's call this add function, my add universal. And let's call this function as 现在，让我们调用这个 add 函数，我的 add 通用函数。让我们称这个函数为
two, four and five for these, and let's just print the result. Let's just print the result. 两个，四个和五个，让我们打印 结果。让我们打印结果。
Okay, the result is 11. Well, because two plus four plus five is 11. Now let's call 好的，结果是 11。好吧，因为二 加四加五是 11。现在让我们调用
this function for let's say, for for, let's say, five arguments. It works. It adds all 这个函数让我们说，因为，让我们说 ，五个参数。有用。它添加了所有
these five numbers. Wow, that is great. I mean, now we can add any, we have one function, 这五个数字。哇，太棒了。我的意思是， 现在我们可以添加任何，我们有一个功能，
we need not write a function for two arguments, and then another function for three arguments, 我们不需要为两个参数编写一个函数， 然后为三个参数编写另一个函数，
then another function for four arguments and so on. Depending upon the number of arguments, 然后是四个参数的另一个函数， 依此类推。根据参数的数量，
we need not to write separate functions. We have just one function working in all scenarios. 我们不需要编写单独的函数。我们 只有一个功能适用于所有场景。
While so, yeah. That's doable. I've done in front of you. No problem. Yeah, Python allows 虽然如此，是的。这是可行的。我已经在 你面前完成了。没问题。是的，Python 允许
this. 这个。
Yeah. In the next video, we are going to see how can we actually handle the same kind of 是的。在下一个视频中，我们将看到 我们如何实际处理相同类型的
scenario. But we want to handle the sequence of the input variables in a very controlled 设想。但是我们想以非常可控 的方式处理输入变量的顺序
way. Remember, in some of the previous this this year, in this order of input arguments, 道路。请记住，在今年之前的一些 内容中，按照输入参数的顺序，
remember that we receive three arguments and we pass the three arguments in a very controlled 请记住，我们收到三个参数，并 以非常可控的方式传递这三个参数
way. And then whatever these are, we don't care whatever the order here if we don't care, 道路。然后不管这些是什么，如果我们 不在乎，我们不在乎这里的顺序，
what if we want to fix the issue? Or we want to become more careful for input argument 如果我们想解决这个问题怎么办？或者 我们想对输入参数更加小心
orderings. But then we also want the arbitrary number of arguments. How can we do that? Yeah, 订单。但是我们也想要任意数量 的参数。我们怎么做？是的，
wait for the next video. And I will show you how can you do that? In the last video, I 等待下一个视频。我会告诉你你怎么能 做到这一点？在上一个视频中，我
promised you that I will show you how can you achieve the ordering of the input variables, 向你保证，我将向你展示 如何实现输入变量的排序，
but still having the arbitrary number of them. Remember, this looks like much familiar to 但仍然有任意数量的。记住 ，这看起来很熟悉
you, that's a call that can be made to a function. And remember, the function definition in some 你，这是一个可以对函数进行的调用 。请记住，某些函数定义
previous slide was like C one, C two, and C three maybe. And then something. What if 上一张幻灯片可能是 C 一、C 二和 C 三。然后某事。如果
we want an arbitrary number of arguments to be passed, but we want their control. For 我们想要传递任意数量的参数， 但我们想要它们的控制。为了
example, let's say this particular variable symbol name that acts as a key, that's a variable 例如，假设这个作为键的特定 变量符号名称，这是一个变量
name, and that's the value. So let me call the variable name as a key. And let's This 名称，这就是价值。因此，让我 将变量名称称为键。让我们这个
is the value that is copied in the variable. That's another key that's a value, that's 是在变量中复制的值。这是另一 个键，它是一个值，那就是
another key that's a value and so on, what if we have a lot of key value pairs? What 另一个键是值等等，如果我们 有很多键值对怎么办？什么
if we have a lot of them. And we also want to check which value is of what key, let's 如果我们有很多。我们还想检查 哪个值是哪个键，让我们
say we want to specify those. But we want to specify an arbitrary number of them. Let's 说我们要指定那些。但是我们 想指定任意数量的它们。让我们
say here, for example, there are only three, let's say we want to pass five of them, six 在这里说，例如，只有三个，假设 我们要通过其中的五个，六个
of them, and then we want our function to perform accordingly. No matter how many input 其中，然后我们希望我们的功能 相应地执行。无论输入多少
arguments it received. Yeah, and and maybe inside the function, we may have applied a 它收到的论据。是的，也许在函数 内部，我们可能已经应用了
check that if the key value is C one, then do this processing, if the key value is C 检查键值是否为C 1，则进行 此处理，如果键值为C
two, then do that kind of processing and so on, let's say, based on different variable 二，然后做那种处理等等， 比方说，基于不同的变量
symbol names, we want to process the value differently, how can we achieve that, and 符号名称，我们想以不同的方式处理值 ，我们如何实现这一点，以及
still having the need that these number of variables can be can can be in a variable, 仍然需要这些数量的变量 可以可以在一个变量中，
variable length, they can be an arbitrary number of those. So Python gives you again, 可变长度，它们可以是任意数量 的。所以Python再次给你，
a very, very simple way. Rather than writing a simple single star, you write a double star, 一个非常非常简单的方法。与其写一 个简单的单星，不如写一个双星，
and then you receive in whatever variable name. And now in this double double star means 然后你会收到任何变量名。 而现在在这个双双星意味着
you are receiving a key value pair list. It's a list of key value pairs. We will see that 您将收到一个键值对列表。这是 一个键值对列表。我们会看到
that resembles two that resembles to a data structure in Python called dictionary. We 这类似于两个类似于 Python 中 称为字典的数据结构。我们
will see dictionary later on in detail but right now just just consider that this input 稍后将详细查看字典， 但现在只需考虑此输入
argument this input variable C, it contains a, it contains a list of key values pairs, 参数这个输入变量 C，它包含一 个，它包含一个键值对列表，
and then you just you can just iterate over the sea you can just apply a for loop to check 然后你就可以在大海上进行迭代 ，你可以应用一个 for 循环来检查
the contents of this Remember, we have actually done that kind of thing in the, in the portion 这个的内容 记住，我们实际上已经 在，在部分中做过那种事情
of loops. Yeah, here. Remember that was a key. And that was a value that was a key that 的循环。是的，在这里。记住那 是一把钥匙。这是一个关键的价值
was a value. And we did that thing, we could explore the we were able to explore the dictionary, 是一个价值。我们做了那件事， 我们可以探索我们能够探索字典，
just just using for loop. Yeah, it's the same thing here. It's not exactly but you can think 只是使用 for 循环。是的，这里也是 一样的。不完全是，但你可以认为
of that that's exactly the same thing. So you can explore that, that see looks like 那是完全一样的事情。所以你 可以探索它，看到看起来像
a dictionary. Now this is key, this is value, this is key, this is value. This is key, this 一本字典。现在这是关键，这是价值， 这是关键，这是价值。这是关键，这
has value, you can this x points, the first key, then C of x point to the value based 有值，你可以这个x点，第一个 键，然后x的C指向基于的值
on the based on the key x, and then x point to the second key, then the second value and 基于键x，然后x指向第二 个键，然后第二个值和
so on you that that is very simple procedure, you're just printing all the dictionary, but 所以对你来说，这是一个非常简单的过程 ，你只是打印所有的字典，但是
you can, you're printing all the variable names and the values, but you can do very 你可以，你正在打印所有的变量 名和值，但是你可以做很多
complicated processing, if you want to, let's go to our friend Jupyter Notebook to just 复杂的处理，如果你想，我们去我们 的朋友 Jupyter Notebook 来吧
get convinced that this indeed works. Let's see. So let's define a function first. So 确信这确实有效。让我们来看看。所以 让我们先定义一个函数。所以
d f, that's the function name is Brent, all d f, 那就是函数名是 Brent, all
variable, variables, and values. So that might be a function name. While that's lengthy one, 变量、变量和值。所以这可能是 一个函数名。虽然那很长，
but descriptor one, maybe we can make it more descriptive, paint all the variable, variable 但是描述符一，也许我们可以让它 更具描述性，绘制所有变量，变量
names and values, while that's more descriptive a guess. So it receives, let's say, doublestar. 名称和值，而这是更具描述性的猜测 。所以它接收，比方说，双星。
Any variable, let's say the variable name is again, let's say arcs or anything, whatever 任何变量，让我们再说一遍变量 名，让我们说弧或任何东西，随便
you want, then what we do is for x in orgs, just Brent, let's say, variable name is just 你想要，那么我们所做的就是为 orgs 中的 x，只是布伦特，比方说，变量名只是
Brent x, and then the sprint x and then just continue, and value is value is our eggs of 布伦特x，然后冲刺x然后就继续了 ，价值就是价值就是我们的蛋
x. So let's say you, you done this, you did this. So the variable name is this, and the X。所以让我们说你，你做了这个，你 做了这个。所以变量名是这个，而
value is this, okay, and you want to do this for all, all the all the variable and value 值就是这个，好吧，你想为所有 人做这件事，所有的变量和值
pairs that you that you send at the call time. So now let's call this brand, all variable 您在通话时发送的配对。所以现在 让我们称这个品牌，所有变量
names and values. And let's call this let's say the variable first variable name, let's 名称和值。让我们称之为变量 第一个变量名，让我们
say is a, and its value is three. The second variable name is let's say B, its value is 说是一个，它的值为三。第二 个变量名是B，它的值是
capital B, let's say the third Will you third variable name is C, its value is CCC. And 大写B，假设第三个你第三个变量 名是C，它的值是CCC。和
let's say the fourth variable name, I mean, you can define an arbitrary number of arguments 让我们说第四个变量名，我的意思 是，你可以定义任意数量的参数
here. Wow, that's amazing. That's the fourth variable name is why its value is 6.7. And 这里。哇，太神奇了。这是第四个变量 名，这就是为什么它的值为 6.7。和
further notice, you can you can pass variable and value all have different types, I'm in 进一步注意，你可以传递变量 和值都有不同的类型，我在
different number of them. And and much more. Yeah, you can do that. So let's call this 它们的数量不同。还有更多。是的，你 可以这样做。所以让我们称之为
function by just having four variables and their values. Let's see what we got. So well, 仅具有四个变量及其值即可发挥作用。 让我们看看我们得到了什么。那么好，
variable name is a and the value is three variable name is B, and the value is B, variable 变量名是a，值是三个 变量名是B，值是B，变量
name is C and the values CCC, variable name is why and value is 6.7. You can give an arbitrary 名称是 C，值是 CCC，变量名称是原因 ，值是 6.7。你可以给一个任意的
lampi list here if you want. And Python just allows you to do that. And it allows you to 如果您愿意，请在此处列出lampi。而 Python 只允许你这样做。它允许你
do that in a very, very simple way. That's amazing. That's amazing. I mean, that's, that's 以非常非常简单的方式做到这一点。太 棒了。太棒了。我的意思是，那个，那个
why a high level language or radio, a powerful language should should have a feature. So 为什么一个高级语言或广播，一个强大 的语言应该有一个特性。所以
Python does have this feature. I'm really amazed. I'm really, really astonished by time. Python 确实有这个特性。我真的很 惊讶。我真的，真的被时间惊呆了。
By the way, I'm not saying the other languages don't have this. several languages actually 顺便说一句，我并不是说其他​​语言 没有这个。实际上有几种语言
support this kind of feature, but Python supports it in a very easy way. It's very easy to do 支持这种特性，但 Python 以一种非常简单 的方式支持它。这很容易做到
that. I mean, it's not not a rocket science. Yeah. Okay, so now we have had an arbitrary 那。我的意思是，这不是火箭科学。是 的。好的，现在我们有了一个任意的
number of arguments even when the ordering is really controlled. 即使排序确实受到控制，参数的 数量也是如此。
We have one or two more videos on functions. Just to explain a bit more than we will, then 我们还有一两个关于函数的视频。 只是为了比我们多解释一点，然后
we will practice on Jupyter Notebook, we'll practice we will play with these functions 我们将在 Jupyter Notebook 上练习，我们 将练习我们将使用这些功能
a lot. And we will be calling one function inside the other function and so on, we will 很多。我们将在另一个函数中调用 一个函数，依此类推，我们将
be having one better program just just program and noodle Jupyter Notebook just to get comfortable 拥有一个更好的程序，只是为了让自己 感到舒服而编写程序和面条 Jupyter Notebook
with this functions. But before that, let's have one or two more things to discuss about 有了这个功能。但在此之前 ，让我们再讨论一两件事
the functions. Yeah, let's see. So I hope to see you in the next video. Okay, I really 功能。是的，让我们看看。所以我希望 在下一个视频中见到你。好吧，我真的
want to talk about these default values for a function as well, because that's important 还想讨论函数的这些默认值 ，因为这很重要
and mostly needed. The default value is a value of the input variable that you assign 并且最需要。默认值是 您分配的输入变量的值
well, while you are defining a function, and if the value is, for example, if you call 好吧，当你定义一个函数时，如果 值是，例如，如果你调用
this F, with let's say, the input value three, then three will be copied in the sum and the 这个F，比方说，输入值三， 然后三将被复制到总和中
print will be three. But if you call this function without the input, then this value 打印将是三个。但是如果你在没有输入 的情况下调用这个函数，那么这个值
acts as as if you have passed this. So this is the default value if you do not supply 就好像你已经通过了这个。所以 如果你不提供，这是默认值
the value, this is the value that is going to operate. And by the way, you can have multiple 值，这是将要运行的值。 顺便说一句，你可以有多个
variables with default values, some variables with default value is defined some variables. 具有默认值的变量，一些具有默认值 的变量定义了一些变量。
With default variables, a default value is not defined, and so on. So you can have this 对于默认变量，未定义默认值， 依此类推。所以你可以拥有这个
one here must be taken here that the default value, when you actually define the function, 这里必须取默认值，当 你实际定义函数时，
and you compile this function, actually, you you run the cell shift enter in Jupyter Notebook. 你编译这个函数，实际上，你在 Jupyter Notebook 中运行单元格移位输入。
At that very time, this variable is assigned this value at that particular time, it is 就在那个时候，这个变量在那个特定 的时间被赋予了这个值，它是
not assigned at the call time. So sum equals to zero is already there, when you actually 通话时未分配。所以 sum 等于 0 已经存在，当你实际上
press Shift Enter for a cell that contains this code. 对于包含此代码的单元格，请按 Shift Enter。
Now later on, if you pass a value, that value will be overwritten on some, if you don't 现在稍后，如果您传递一个值，该 值将被某些人覆盖，如果您不
pass the value zero will go on, it looks like very easy, but one care that I want to mention 传递零值会继续，看起来很 容易，但我想提一个关心
here that I haven't mentioned earlier, in Python, there are certain variables that are 这里我之前没有提到，在 Python 中，有一些变量是
that are referenced rather than copied, I will discuss the referencing in the copying 引用而不是复制，我 将在复制中讨论引用
data in detail in data structures. But let me just tell you 111 example, let's say you 数据结构中的详细数据。但是让 我告诉你111个例子，让我们说你
define a list, let's say one, two, and three. And then what you do you copy this list into 定义一个列表，比如说一、二和三。 然后你做什么 你把这个列表复制到
another variable, let's say l two, what will happen is in the memory, this list in a particular 另一个变量，比方说 l 两个，会发生 什么是在内存中，这个列表在一个特定的
way, this is not the exact view of the memory, I'm just showing you, let's say this is the 方式，这不是内存的确切视图， 我只是向您展示，假设这是
particular memory layout for which this L is pointing to this L is label for that l 这个 L 指向这个 L 的特定 内存布局是那个 l 的标签
two is also labeled for that, which means actually in memory, this is not the copy of 也为此标记了两个，这意味 着实际上在内存中，这不是
the structure that is made, I mean this is not like in variables. For example, if a is 制作的结构，我的意思是这 不像变量。例如，如果 a 是
equal to three and b is equal to a, a will be a will be a position in memory, and B will 等于三且 b 等于 a，a 将是 a 将 是内存中的一个位置，而 B 将是
be a separate position in memory. That is what a view of the memory in ordinary variables 在内存中是一个单独的位置。 那就是普通变量中的内存视图
are. But there are certain variables in memory just for memory efficient and cost efficiency 是。但是内存中有一些变量只 是为了内存效率和成本效率
and time. People have people have designed these data structures in a way that when you 和时间。人们让人们以一种方式 设计这些数据结构，当您
copy them, when you just assign a variable to another variable, the memory view doesn't 复制它们，当您只是将一个变量分配 给另一个变量时，内存视图不会
change the just it's it's another name for the same for the same for the same memory 改变只是它的另一个名称相同 的相同的相同的内存
location. So what happens is if you change any value, and let's say l two, let's say 地点。所以如果你改变任何值会发生 什么，假设我有两个，假设
l two, at the very, the zeros and add the zero index, let's say you change that by minus 我有两个，在非常，零并添加 零索引，假设您将其更改为减号
nine, the because it is the same view in memory that changes minus nine. And now if you print 九，因为它是内存中相同的视图 ，减去九。现在如果你打印
the elements of L rather than l two, you will get the changed value, you will see the change L 的元素而不是 l 两个，你会得到 改变的值，你会看到变化
value. And that happens. Now why that is important in terms of these default values here for 价值。这发生了。现在为什么这对于 这里的这些默认值很重要
the function. The reason is, if you are accepting a list, let's say the default is a list, and 功能。原因是，如果您接受一个列表 ，假设默认是一个列表，并且
you're accepting a list and you are also defining some default value for the list. If that's 您正在接受一个列表，并且您还为该列表 定义了一些默认值。如果那是
your definition, let's say then this list this default value is assigned at the ad the 你的定义，让我们说这个列表 这个默认值是在广告中分配的
very first at the very first time, and this L is really a local variable inside inside 第一次第一次，这个L里面 真的是一个局部变量
the inside the memory. Now when once this cell is run, not the call time at the at the 内存里面。现在当这个单元格 运行时，而不是在
sowhat call the compile time, when the cell is run this L is assigned this and that just 所以调用编译时间，当单元格运行时 ，这个 L 被分配了这个，那个只是
happens once. Now if you call this list with some other list let's say l to let's say two 发生一次。现在，如果您将这个列表与其他 列表一起调用，让我们说 l 来让我们说两个
three and four. Then if you call this L two, l two will go there it will be copied in L 三和四。然后如果你把这个 L 称为两 个，我会去那里它会被复制到 L
and everything is fine, but don't then expect this the contents of L to to stay same as 一切都很好，但不要 期望 L 的内容与
staying l because l is this default. values, they are assigned just once. And they stay 保持 l 因为 l 是这个默认值。值 ，它们只分配一次。他们留下
as it is, every time you call the function, they don't change. They are not assigned at 事实上，每次调用该函数时，它们 都不会改变。他们没有被分配在
the call time they are assigned at the compile time and they stay fixed. So that care must 它们在编译时分配的调用时间并且它们 保持固定。所以这种关怀必须
be taken. I will show you that example that particular example, in Jupyter Notebook shortly 被带走。我将很快在 Jupyter Notebook 中向您展示那个特定示例
at this, this might be confusing right now, because we have not defined, we have not seen 在这一点上，这现在可能令人困惑，因为 我们还没有定义，我们还没有看到
lists in detail. But I just want to make this point. I just want to mention this because 详细列出。但我只想说明这 一点。我只想提这个因为
that's important difference with ordinary variables that I mean default values, just, 这是与普通变量的重要区别， 我的意思是默认值，只是，
I mean, just like like a value. And if you don't supply a value, the default value just 我的意思是，就像一个值。如果 你不提供一个值，默认值只是
works. But with the variable that are referenced by variables, you may expect something else. 作品。但是对于变量引用的变量 ，您可能会期待其他东西。
And the Python function behaves maybe differently. And that's because these default values they Python 函数的行为可能有所不同。 那是因为这些默认值它们
are assigned at compile time they are not are compiled time. Actually, this is not a 在编译时分配它们不是在编译 时。实际上，这不是一个
compiled language, I should not use the word compiled compiled again. And again, just think 编译语言，我不应该再次使用 编译这个词。再一次，想想
when we define this function, and we run the cell at that particular time, the default 当我们定义这个函数，并在那个特定 的时间运行单元格时，默认的
value is assigned. And the default value never changes. It stays fixed. Yeah. So and I will 值被赋值。并且默认值永远不会改变 。它保持固定。是的。所以我会
show you that example. Why don't we move to Jupyter Notebook and see that example? Yeah. 给你看那个例子。我们为什么不转向 Jupyter Notebook 并查看该示例？是的。
So or why don't we do that in the next video? What do you think? This video, okay, same 那么或者为什么我们不在下一个视频中这样做 呢？你怎么认为？这个视频，好吧，一样
with you. Okay, let's go to Jupiter and mode notebook and see the default values. For example, 和你。好的，让我们转到 Jupiter 和 mode notebook 并查看默认值。例如，
let's see. 让我们来看看。
Let's say we have define a function, let's say GG, and the default value s is equal to 假设我们定义了一个函数， 假设是 GG，默认值 s 等于
four, let's say that's a default value. And we want to print let's say s, if available. 四，假设这是一个默认值。我们 想打印假设 s，如果有的话。
From the call time, if not available, then four will be printed. Now we print now right 从调用时间来看，如果不可用，则 将打印四个。现在我们立即打印
now we are going to print, now we are going to press Shift Enter at that time, S is assigned 现在我们要打印，现在我们要 在那个时候按Shift Enter，S被赋值
to for S has no value for it is assigned there. Now we call GG, let's say and we call GG without to for S 没有值，因为它在那里分配。现在 我们称 GG，比方说，我们称 GG 没有
input arguments. Now the four will be printed. If we call this GG with some input argument, 输入参数。现在将打印四个。如果我们 用一些输入参数调用这个 GG，
let's say 56. Now the 56 will be printed, no problem, everything is fine. Let's see 假设 56。现在将打印 56，没问题 ，一切正常。让我们来看看
about the lists. For example, let's say the list is, let's say 123, that list, and then 关于名单。例如，假设列表是 ，假设 123，那个列表，然后
l two is simply let's say l two is L, then what we do is we change the contents of L l two 简单地说 l two 是 L，那么我们 所做的就是改变 L 的内容
two, let's say we change the very first value in L two, and we place that values minus nine, 二，假设我们更改了 L2 中的第一 个值，然后将该值减去九，
and then we print L. Now, you might be expecting that l is a different thing, l two is a different 然后我们打印 L。现在，你可能会期待 l 是不同的东西， l two 是不同的
thing. Because l and l two, they both are pointing to the same memory. This, the content 事物。因为 l 和 l 两个，它们 都指向同一个内存。这，内容
through l two actually changes the memory view and l also changes and that gives the 通过 l 两个实际上改变了内存 视图， l 也改变了，这给了
result minus nine in L. Well, the behavior that I want to show you is different in the 结果在 L 中减去 9。好吧， 我想向您展示的行为在
default values. When we when we talk about for example, let's say we define a function, 默认值。例如，当我们谈论时 ，假设我们定义了一个函数，
f f and it accepts a list and the default value is empty list, or the default value f f 并且它接受一个列表并且默认值 为空列表，或者默认值
is let's say one, two, that's the default value, let's say if, if no list is passed, 让我们说一，二，这是默认值 ，假设，如果没有传递列表，
the default list is one two. Now, in this particular scenario, if we just print, so 默认列表是一二。现在，在这个特定 场景中，如果我们只是打印，那么
for example, for i in the list, brand, I let's say we just print all the list. That's it. 例如，对于列表中的 i，品牌，我假设我们 只是打印所有列表。就是这样。
Now we will press Shift Enter, and at this time this L is assigned this value, and that's 现在我们将按 Shift Enter，这时候 这个 L 被赋予这个值，那就是
a default value that never, that is not going to change. Now let's say we have an L tool 一个永远不会改变的默认值。 现在假设我们有一个 L 工具
that is simply let's say two, three and four, or let's say 12, three and four. And what 那就是简单地让我们说二、三和四，或者 让我们说 12、三和四。还有什么
we do is we call F and we just press Shift Enter. Now, why don't we call f f without 我们所做的就是调用 F，然后按 Shift Enter。 现在，为什么我们不调用 f f
anything. So, the default list is printed, if we call this f f with L to the L two will 任何事物。所以，默认列表被打印出来， 如果我们调用这个 f f with L to the L two will
be printed. Now the notice that this L two actually is copied in this L because we supplied 被打印。现在注意到这个 L 两个实际上 是复制到这个 L 中的，因为我们提供了
it. So l and l two you may tend to think that l is now also pointing to L to an L has also 它。所以 l 和 l 两个你可能倾向于 认为 l 现在也指向 L 到 L 也
the same contents as l two. So if next time because because of the behavior of these lists 和我两个一样的内容。所以如果 下次因为这些列表的行为
because they are by Reference. Next time you make you make might be thinking that because 因为它们是引用。下次你做 你做的时候可能会想，因为
l two is past there, so l two L is also L, L two is copied in L in a memory view way l 二在那里过去，所以l二L也是L，L 二以内存视图方式复制到L中
layout. So l has also the same data as l two and next time, if we call this function without 布局。所以 l 也有与 l 两次和下一次相同 的数据，如果我们调用这个函数而没有
input arguments, then l might be pointing out to L two values. So, 12 three and four 输入参数，那么 l 可能指向 L 两个值。所以，12个三四
might be printed, but that is not going to happen, the default values they never change. 可能会被打印出来，但这不会发生 ，它们永远不会改变默认值。
So, again, you will be getting one, two, so, the behavior of these Reference Type variables, 所以，再一次，你会得到一个，两个 ，所以，这些引用类型变量的行为，
that is different ordinarily, but when you do that in in the default value structure, 这通常是不同的，但是当你 在默认值结构中这样做时，
that, that, that might work in a different way. And the reason is, you, you must know 那，那，那可能会以不同的方式 工作。原因是，你，你必须知道
that these default values they're assigned at, at the time when the function is created, 这些默认值是在创建 函数时分配的，
not at the function when the function is called. And they are not going to change whatsoever. 调用函数时不在函数处。 他们不会有任何改变。
So, so that was about the default value. And by the way, the default if it was a simple 所以，这就是默认值。顺便说一句 ，如果它是一个简单的默认值
concept, I guess I have made it too complicated by telling you layers and default values and 概念，我想我通过告诉 你层和默认值和
creation of these variables, at what time and at the call time, I made this complicated, 创建这些变量，在什么时间和 调用时间，我把这变得复杂了，
I guess, I shouldn't have told you the list values and all that stuff. But but that's 我想，我不应该告诉你列表值和 所有这些东西。但不过如此
true. And in whatever I have told you is true. Maybe I have told you in a very complicated 真的。我告诉你的都是真的。也许 我已经用很复杂的方式告诉过你
way, but it's true. Yeah. Okay. 方式，但这是真的。是的。好的。
One more video on the functions and then we will be practicing functions in detail on 再放一个关于函数的视频， 然后我们将详细练习函数
on Jupyter notebooks. So just be or one more video with me. Hope to see you in the next 在 Jupyter 笔记本上。所以就和我一起 做一个视频吧。希望下次再见
video. Okay, this is probably the last video on on the functions. Yeah, we will, we will 视频。好的，这可能是有关功能的最后 一个视频。是的，我们会，我们会
be having one more video. But but that will be like coding and practicing all the concepts 再放一个视频。但这就 像编码和练习所有概念
that we learn about the functions not? Not something not not new theoretical concepts. 那我们学习一下功能不？不 是什么不是新的理论概念。
Yeah. So let me ask you a question to actually, to actually make you understand about this 是的。所以让我问你一个问题 ，让你真正了解这个
slide. Let me go to the Jupiter and ask you about a few questions. Let's say you have, 滑动。让我去木星问你几 个问题。假设你有，
let's say, let's say you have this particular function, and you, let's say my ad, my ad 比方说，比方说你有这个特殊的功能， 你，比方说我的广告，我的广告
universal, let's say we have written that function, maybe two or three or three videos 通用，假设我们已经编写了那个 函数，可能有两三个或三个视频
before, let's say you have this function, you have written this function, and you are 之前，假设你有这个函数， 你已经写了这个函数，你是
very, very excited, wow, what kind of masterpiece you have generated, it can add an arbitrary 非常非常激动，哇，你产生了什么样 的杰作，它可以添加任意
number of values pass in it well, but this particular function is written inside this 传入的值的数量很好，但是这个 特殊的函数是写在这个里面的
particular file, which is mastering Python zero to hero. Later on, let's say two or three 特定文件，这是掌握 Python 零到英雄。以后再说两三
months later, you are writing some code for some, some project or you are doing something 几个月后，您正在为某个项目编写 一些代码，或者您正在做某事
somewhere and you are writing code, and there you just needed. 在某个地方，您正在编写代码，而您正是 需要的地方。
You just needed a, you just needed a code for adding a lot of a lot of values together. 你只需要一个，你只需要一个 代码来将很多很多值加在一起。
And then you just remember, oh, I have written some function somewhere. How can you use that 然后你只记得，哦，我在某处写 了一些函数。你怎么能用那个
function? One way is to just go back to that file mastering Python zero to hero, and just 功能？一种方法是回到那个掌握 Python 零到英雄的文件，然后
copy this function, this particular this code and paste in the new file, run that, register 复制这个函数，这个特定的代码并 粘贴到新文件中，运行它，注册
that and then call that happy. What if you want to use let's say, 100 different functions, 那然后叫那快乐。如果你想使用 比方说 100 种不同的功能，
let's say you have written a lot of functions in a lot of different files. And now you want 假设您在许多不同的文件中编写 了许多函数。现在你想要
to use all of them. And, and let's say this is a repetitive kind of demand several times 使用所有这些。而且，假设 这是多次重复的需求
you notice that this usually happens that this particular kind of function, you require 你注意到这通常发生在这 种特殊的函数中，你需要
almost every almost in every project, let's say a set of maybe 50, or 60 functions that 几乎每个项目中的几乎每一个，让 我们说一组可能有 50 或 60 个功能
are that are required always, one way to do that, as I told you is to jump just copy paste 总是需要的，一种方法是，正如 我告诉你的那样，直接复制粘贴
those functions in every file, run them and do that. Another way is to just just I mean, 每个文件中的那些函数，运行它们并执行 此操作。另一种方法就是我的意思是，
make a module a file of containing just those functions. And whenever any of those functions 使模块成为仅包含这些功能的文件 。每当这些功能中的任何一个
is required, just import that module into your coding file, which has one line of code 是必需的，只需将该模块导入到您 的编码文件中，该文件只有一行代码
and then access all the functions as if they were they were they were actually available 然后访问所有功能，就好像 它们确实可用一样
in in the port file that you are working on. So that's about the that's about making modules 在您正在处理的端口文件中。 这就是关于制作模块的内容
of so module is basically a Python file that contains functions that you want to use in of so 模块基本上是一个 Python 文件， 其中包含您要在其中使用的函数
several different coding projects or the functions that you don't want to write in your the functions. 几个不同的编码项目或您不 想在函数中编写的函数。
Having the implementation that you don't want to write in your grant coding file, so you 拥有您不想在授权编码文件 中写入的实现，因此您
can have several of those functions stayed somewhere else in a different directory they 可以将其中几个函数保留 在不同目录中的其他位置
are residing there, whenever you want to use any of them, you just import the whole module 居住在那里，无论何时您想使用其中 任何一个，您只需导入整个模块
and use the functions. So, so module is just a Python file that can that can contain a 并使用这些功能。所以，所以模块只是 一个 Python 文件，它可以包含一个
code for you that whenever you want to use, you can use it. Normally it contains functions 为您编写的代码，只要您想使用， 就可以使用它。通常它包含函数
maybe more than one function and several functions. Normally, it contains functions that you repetitively 也许不止一个功能和几个功能。 通常，它包含您重复使用的功能
use, and that you have written once in very careful way. And then now you want to use 使用，并且您以非常仔细的方式编写 了一次。然后现在你想使用
it again and again in several different ways. You need not to write the function definition, 它以几种不同的方式一遍又一 遍。您无需编写函数定义，
in every coding file you need, you just make one coding file, or that that is the most 在您需要的每个编码文件中，您只需制作 一个编码文件，或者这是最多的
important for you, that is called a module where wherever you want to use any of those 对您来说很重要，这称为模块 ，您可以在其中使用任何模块
functions that are there in that module, you can call it, you can use it. So that's about 该模块中存在的函数，您可以调用 它，您可以使用它。所以这是关于
the modules we are going to make. I'm going to show you one example of making module and 我们将要制作的模块。我将向 您展示一个制作模块的示例
how to use that. But but to use the module, we need to actually specify the path where 如何使用它。但是要使用模块， 我们需要实际指定路径在哪里
the module actually resides using this cess module. So and then we have to do some this 该模块实际上使用这个 cess 模块驻留 。然后我们必须做一些这样的事情
import kind of commands. And then I mean, there is some work that we need to do to actually 导入类型的命令。然后我的意思是 ，我们需要做一些工作才能真正做到
get this module running in our code. So in the next video, I'm going to tell you what 让这个模块在我们的代码中运行。所以 在下一个视频中，我会告诉你什么
that extra work, very little amount of work what that extra work you have to do. So here, 额外的工作，很少的工作量你必须 做的额外工作。所以在这里，
for example, my funks.py, that's my Python file, and it contains these two functions. 例如，我的 funks.py，这是我的 Python 文件，它包含这两个函数。
And let's say I want to use one of these have both of these functions in some other file, 假设我想使用其中一个在其他 文件中具有这两个功能，
and that file contains this particular code. So in the next video, I will show you how 并且该文件包含此特定代码。所以在下 一个视频中，我将向您展示如何
to how to actually make and use the modules. Yeah, so hope to see you in the next video. 到如何实际制作和使用模块。是的， 所以希望在下一个视频中见到你。
Okay, in the last video, I told you about modules module is just a Python file that 好的，在上一个视频中，我告诉过 你模块模块只是一个 Python 文件
can contain a code that can be used anywhere, if you want normally, that module. Normally, 可以包含可以在任何地方使用的代码， 如果您通常需要，该模块。一般，
the modules, they contain a lot of functions, but they can contain variables and other values, 模块，它们包含很多函数，但 它们可以包含变量和其他值，
and so on. So think about file myfonts.py, that contain this, these two functions, and 等等。所以想想文件 myfonts.py，它 包含这个、这两个函数，以及
think about a different file, maybe Jupiter, maybe you're working in a Jupyter Notebook. 考虑一个不同的文件，也许是 Jupiter， 也许你正在使用 Jupyter Notebook。
And now you want to use these two functions. So you first have to import another module 现在您要使用这两个功能。所以 你首先必须导入另一个模块
call the system module says you have to have you have to make this path available. There 调用系统模块说你必须让 这个路径可用。那里
are a lot of built in modules that are already there in the path all the already there in 有很多内置模块已经 存在于路径中
the search path. When you want to call a function, it is written in some module that is already 搜索路径。当你想调用一个函数时， 它被写在某个已经存在的模块中
in the search path. If you're making your modules, you have to either 在搜索路径中。如果你正在制作你 的模块，你必须要么
either copy those, those modules into the modules that are built in or if you want to 要么将那些，那些模块复制到 内置模块中，要么如果你想
maintain them separately somewhere else, then you have to add the path of these in the search 在其他地方单独维护它们，然后 您必须在搜索中添加这些路径
path as well. And the way to actually insert this path is sis dot path dot append. And 路径也是如此。实际插入此路径的 方法是 sis dot path dot append。和
then you actually write the the path of the directory where this module file one or more 然后你实际上写了一个或多个 这个模块文件的目录的路径
files are located. Once this is added to the path, now you can write the import. And you 文件位于。将其添加到路径后， 现在您可以编写导入。和你
can import your file and your file as it is or you can import your file with some other 可以按原样导入您的文件和您的文件，或者 您可以将您的文件与其他文件一起导入
name if you want, you can rename that on the fly if you want. Once this is imported, now 如果需要，可以随时重命名 。一旦导入，现在
you can use all the functions like the built in functions, the implementation of these 您可以使用所有功能，例如内置 功能，这些功能的实现
functions are not there in your coding file, you are just using those and you can now import 您的编码文件中没有函数，您只是 在使用这些函数，现在可以导入
this module into some other file and use their and so on. for, for, for for very large kind 将此模块转换为其他文件并使用它们等等 。对于，对于，对于非常大的种类
of projects. It is good to make modules. Actually it is better to make packages, which is actually 的项目。制作模块很好。其实 做包比较好，其实就是
the directory structures that contain modules. But modules at least are really good too, 包含模块的目录结构。但 至少模块也非常好，
for maintaining a large amount, of course, or actually the functions that you want to 用于维护大量的，当然，或者 实际上是你想要的功能
use again and again. So let's just let's let's make a module, why not? So let's make a module. 一次又一次地使用。所以让我们让我们制作一个 模块，为什么不呢？所以让我们制作一个模块。
Let's say let's go to Jupyter Notebook. Let's create another file. Let's create another 假设让我们转到 Jupyter Notebook。让我们创建 另一个文件。让我们创建另一个
file, let's say new Python three and let's let's name this file as my IE let's say let's 文件，让我们说新的 Python 3，让我们 将此文件命名为我的 IE，让我们说
let's name this file as my universal, let's let's use underscores my universal functions. 让我们将此文件命名为我的通用文件， 让我们使用下划线作为我的通用函数。
Let's classify the name. Let's create another notebook. Right now it's just a notebook that's 让我们对名称进行分类。让我们创建另 一个笔记本。现在它只是一个笔记本
defined some functions. Let's say we want to define one function as jack, all orgs. 定义了一些函数。假设我们想将一 个函数定义为 jack，所有 orgs。
Let's say that's the function it receives, let's say, 假设这是它接收的函数，比方 说，
let's say it receives a dictionary like input. And then it checks the date, let's say check, 假设它接收像输入这样的字典。然后 它检查日期，比方说检查，
set check type of all arcs. And let's say, let's say you write a function check, if not 设置所有圆弧的检查类型。假设 你写了一个函数检查，如果没有
numeric, let's say, let's say you want to write a function that that just accepts a 数字，比方说，比方说，你 想写一个函数，只接受一个
lot of arguments. And you want to check whether any one thought, if any one of them is not 很多论点。你想检查是否有人 想过，如果有人没有想过
numeric, you want to return let's say, a flag. Otherwise, you want to return a true, let's 数字，你想返回比方说，一个标志。 否则，你想返回一个真，让我们
say, so for example, you may you may need this function in several places. Let's say 比如说，例如，您可能在多个 地方需要此功能。让我们说
in in your core, you're expecting numerical inputs. And if the input is, and let's say 在您的核心中，您期待数字输入 。如果输入是，让我们说
there are a lot of variables that you are working on if and if any one of them is not 如果其中任何一个不是 ，您正在处理很多变量
numeric, you might want to check all the all the variables and their values. One way of 数字，您可能想要检查所有所有 变量及其值。一种方式
doing that is just to create a list. And that's it. I mean, that's and and you may have several 这样做只是为了创建一个列表。就是 这样。我的意思是，你可能有几个
of those, I mean, you can check all of them. And maybe here, maybe here, we do not need 其中，我的意思是，你可以检查所有这些。 也许在这里，也许在这里，我们不需要
the dictionary kind of argument. So maybe we just are happy with just one. So let's 字典类的说法。所以也许我们只是 对一个感到满意。那么让我们
say for so the output, let's say output is let's say, R or the return value that value. 说是输出，让我们说输出是让 我们说，R 或该值的返回值。
Let's say that is already true. And we will say okay, for x in ARDS, let's say for x in 让我们说这已经是真的了。我们会说好的 ，对于 ARDS 中的 x，让我们说对于 x 在
arcs. If x if is in stance, x is and float, if that is true, then we are happy. But if 弧线。如果 x if 是 stance，x is 并且是浮动的， 如果这是真的，那么我们很高兴。但是如果
that is not true, if that is not true, then there is a trouble, then we say okay, if this 那不是真的，如果那不是真的，那就 有麻烦了，那么我们说好的，如果这
is not true for any value, then we just return. False. Okay, we just return false. I mean, 对于任何值都不是真的，那么我们就返回。错误的 。好的，我们只是返回false。我的意思是，
we need not to break anything, we just return false return means return, whatever. Otherwise, 我们不需要破坏任何东西，我们只是返回 false 返回意味着返回，无论如何。除此以外，
if we finish this loop, if the loop finishes successfully, and there is no return statement 如果我们完成这个循环，如果循环 成功完成，并且没有返回语句
that is called already, then we return, maybe true, we need to do not need Actually, this 那已经被调用了，然后我们返回，也许 是真的，我们需要不需要其实，这个
variable. Let's see. So this function will return true if all the variables are either 多变的。让我们来看看。 所以如果所有变量都是
int or float. If any of them is not of this type, this function returns false. Well, we 整数或浮动。如果它们中的任何一个不是 这种类型，则此函数返回 false。嗯，我们
can have another we can have another function, maybe we can write several function, the same 可以有另一个我们可以有另一个函数， 也许我们可以写几个函数，一样的
cell or in different cells. Either way, define let's say another function, universal. Or 单元格或在不同的单元格中。无论哪种方式， 定义让我们说另一个功能，通用。或者
add all values, let's add all that's in Numerix, and all numerix. And it also contains, let's 添加所有值，让我们添加 Numerix 中的所有值 ，以及所有 numerix。它也包含，让我们
say, arcs. And the goal of this function is just to add all the values and return the 说，弧线。这个函数的目标 只是将所有值相加并返回
sum. So let's say s equals zero for x in for x in ogs, as plus equals to tax, and that's 和。所以让我们说 s 等于 0 for x in for x in ogs，因为加等于税，那就是
it, then return us, let's say these are two functions. And maybe one more the name of 它，然后返回给我们，假设这是 两个函数。也许还有一个名字
this, or some some variable, let's say you, I mean, these are two functions. Now we are 这个，或者一些变量，比方说你，我的 意思是，这是两个函数。现在我们是
out of the function we are writing something else. Let's say my name let's say that's a 在函数之外，我们正在编写其他东西。 让我们说我的名字让我们说那是一个
variable, my name this, this does not this my name variable does not belong to any of 变量，我的名字这个，这不是这个 我的名字变量不属于任何一个
these functions. And my name is Python. Course let's say that's my. So that's it. That's 这些功能。我的名字是 Python。当然，让我们 说那是我的。就是这样了。那是
file with name my universal functions. So what we do is we download this file as a.pi 文件名为我的通用函数。所以我们 要做的是将这个文件下载为 a.pi
file.pi file. So what we do really is the Go to File, let me just zoom this out so that 文件.pi 文件。所以我们真正做的 是转到文件，让我把它缩小，这样
you can see the download options. We go to File Menu, we download this, as we download 你可以看到下载选项。我们去文件 菜单，我们下载这个，我们下载
this as 这作为
we download this as well as by file, so Python file. So let's download this, or we can write 我们下载这个以及按文件，所以 Python 文件 。所以让我们下载这个，或者我们可以写
this Python file as in some other editor if we want. So open folder, there is a Python 如果我们需要，这个 Python 文件就像在其他一些 编辑器中一样。所以打开文件夹，有一个Python
file here, copy it. Now copy that file. And now you're free to go to any, for example, 文件在这里，复制它。现在复制该文件。 现在你可以自由地去任何地方，例如，
any, any folder if you want, just, for example, you go to somewhere in your directory, and 任何，任何文件夹，如果你想，只是，例如 ，你去你的目录中的某个地方，和
make a new directory, maybe, maybe you want to make another directory. For example, go 创建一个新目录，也许，也许您 想创建另一个目录。例如，去
and make a directory, maybe in D, let's say, or maybe an E, let's say or maybe in C somewhere 并创建一个目录，可能在 D 中，比方说，或者 可能是 E，比方说，或者可能在 C 中的某个地方
and then make a module anywhere. For example, in C, make a new folder, call that folder 然后在任何地方制作一个模块。例如，在 C 中 ，创建一个新文件夹，将该文件夹命名为
as my, or any name, whatever name you want, for example, my module or let's say utils, 作为我的，或任何名字，任何你想要的名字 ，例如，我的模块，或者让我们说 utils，
for example, utilities or whatever name, I mean, let's let's call it as, let's call it 例如，实用程序或任何名称，我的意思 是，让我们称之为，让我们称之为
as ABC, for example, ABC, whatever. And you just made that and just copy that Python file 作为ABC，例如，ABC，随便。你刚刚 做了那个，然后复制那个 Python 文件
here, my universal functions.by. Now, if you go back, if you go back to your there, there 在这里，我的通用功能。现在，如果 你回去，如果你回到你的那里，那里
is a Jupiter, here is a Jupiter. Now you go back to your code, this is your file, go back 是木星，这里是木星。现在你回到 你的代码，这是你的文件，回去
to your code, let's say this file is no longer here. And what you do is you import Sis, that's 对于您的代码，假设此文件不再存在 。你所做的就是导入 Sis，那就是
a system module and says dot path dot bend. Right the path here where the module is located. 一个系统模块并说点路径点弯 曲。就在模块所在的路径上。
So the module right now is located at ABC, this is the part of the module. Once done, 所以现在的模块位于 ABC，这是 模块的一部分。一旦完成，
you can import what what was the name of the module, you need to know that that was my 您可以导入模块的名称是什么 ，您需要知道那是我的
my word. So I just I just don't remember the name, let's import my universal functions. 我的话。所以我只是不记得名字了 ，让我们导入我的通用函数。
How it appears, actually, when I when I have Eric this part, then this import command and 实际上，当我有 Eric 这部分时，它是 如何出现的，然后是这个导入命令和
after the dab completion, just fetches that file. So that that that name might be very 轻拍完成后，只需获取该文件 。所以那个名字可能很
lengthy. So you can rename that as let's say, my apps or whatever name you want. So you 冗长。因此，您可以将其重命名为我的应用 程序或您想要的任何名称。那么你
import that once you have imported that. Now you can use the functions if you want, for 导入后导入。现在，您可以根据 需要使用这些功能，因为
example, you can check the implementation of my efs.if, you see dot add Numerix, you 比如你可以查看我的efs.if的实现 ，你看到dot add Numerix，你
want to check the implementation of that. Here, this remember this file is no longer 想检查一下执行情况。在这里 ，这个记住这个文件不再
in this particular file is located somewhere else. And you can call this function like 在这个特定文件中位于其他地方 。你可以像这样调用这个函数
like the built in functions, my apps dot add all numerix. And you can have for example, 像内置函数一样，我的应用程序点添加 了所有数字。你可以有例如，
let's say accepts the input arguments, let's say 234. All that says six. And that's it. 假设接受输入参数，假设为 234。 所有这些都是 6。就是这样。
That's the, that's the return value, you can you can save the return value in some other 那就是，那是返回值，您可以 将返回值保存在其他
variable, let's see. And then later on, you can print this see our do some stuff with 变量，让我们看看。然后稍后，你可以 打印这个，看看我们做一些事情
this. See, that's one thing. Another way of importing the same thing is let's say you 这个。看，那是一回事。导入相同 内容的另一种方法是假设您
don't want to use all the functions, you just need this add all the metrics, let's say that's 不想使用所有功能，您只需要 添加所有指标，假设就是
that's the only function that you want to use again and again. So you need not the other 这是您想要一次又一次使用的 唯一功能。所以你不需要另一个
functions, let's say for this particular file, you do not need the other functions, then 函数，假设对于这个特定文件， 您不需要其他函数，然后
what you can do is you can just say okay, from my universal functions, import, 你能做的就是你可以说好的， 从我的通用功能，导入，
add all Numerix and you can rename it rename this function as something and you can call 添加所有Numerix，您可以重命名它，将这个 函数重命名为某个东西，您可以调用
that function the same way. So you do that now. You need Not to write any dot kind of 以同样的方式发挥作用。所以你现在 就这样做。你不需要写任何点
thing, you just call add all Numerix because it is important now, and you say, Okay 234567 事情，您只需调用 add all Numerix 因为它 现在很重要，然后您说，好吧 234567
and you'll save that in let's a D, and then you print the if you want, or do whatever 然后你将它保存在一个 D 中，然后你可以 根据需要打印它，或者做任何事情
with that. That's it are you can import several multiple functions or you can import all of 接着就，随即。就是这样，您可以导入 多个功能，也可以导入所有
them. Other than modules, there are I mean, for complex codes, I mean, this is not one 他们。除了模块，我的意思是，对于复杂 的代码，我的意思是，这不是一个
module that is there, I mean, there are several modules. And the several modules may be arranged 那里的模块，我的意思是，有几 个模块。并且可以安排几个模块
in in a directory structure, where the directory and the sub directory and the sub directory 在一个目录结构中，其中的 目录和子目录和子目录
and so on. So the modules that are arranged in directory structure, although they are 等等。所以在目录结构中排列 的模块，虽然它们是
accessed, much like the same way, that directory structure is sometimes called package. And 以同样的方式访问，该目录 结构有时称为包。和
these are basically the packages that are that are most useful. And we will be seeing 这些基本上是最有用的 软件包。我们将看到
some data science packages, like NumPy is a data science package. Then, we will be seeing 一些数据科学包，比如 NumPy 是一 个数据科学包。那么，我们将看到
pandas, that's a data science package, we will be seeing matplotlib that's a data science pandas，这是一个数据科学包，我们 将看到 matplotlib，这是一个数据科学
package for plotting and visualizations and stuff. So packages, just the modules that 用于绘图和可视化等内容的 包。所以包，只是模块
are arranged in directory structures. So now you know what module is. And the old one, 以目录结构排列。所以现在你知道 什么是模块了。而旧的，
Venus two, we actually missed to import the name of have to see the name Vivi have saved 金星二号，我们居然漏了导入 名字不得不看薇薇保存的名字
a name there as well. So let's go back. And let's go back and do that and see how, how 还有一个名字。那我们回去吧。让 我们回去做，看看如何，如何
many things are available. Let's go to some other cell and empty cell. So my apps dot 很多东西都是可用的。让我们转到其他单元格 和空单元格。所以我的应用程序点
tab completion, my name is available. Remember, there was a variable. Yeah, that's available. 选项卡完成，我的名字可用。请记住， 有一个变量。是的，这是可用的。
So the name is Python course. So this module file does not require to only contain functions, 所以名字是Python课程。所以这个 模块文件不需要只包含函数，
it can contain any information, any data that you want to use in other files, other coding 它可以包含任何信息、您想在其他文件 中使用的任何数据、其他编码
and stuff, and so on. So, yeah, that's about modules. In the in the next video, we will 和东西，等等。所以，是的，那是关于 模块的。在下一个视频中，我们将
practice about these functions a little bit, we will be seeing how to call a function inside 稍微练习一下这些函数，我们 将看到如何调用内部函数
another function, how to make a lot of functions that are calling each other and so on. So 另一个函数，如何制作很多互相 调用的函数等等。所以
we will be practicing more on about these functions, not theoretically, just in Jupyter 我们将在 Jupyter 中更多地练习 这些功能，而不是理论上
Notebook, just to get a better look and feel of of functions more. And after that practice, 笔记本，只是为了更好的体验更 多的功能。在那次练习之后，
we will be then jumping towards data structure starting from strings. So hope to see you 然后我们将跳转到从字符串开始的 数据结构。所以希望见到你
in the next video. Okay, before moving on, let's just practice some, some some, I mean, 在下一个视频中。好的，在继续之前， 让我们练习一些，一些，我的意思是，
let's get a good grip on functions and multiple functions and handling those. And the best 让我们很好地掌握函数和多个 函数并处理它们。最好的
way to do that is to solve actually a problem. Remember, we solved a problem when we when 这样做的方法是解决实际问题。 记住，当我们解决问题时
we, when we are done when we were done with if conditions, then we solved another problem 我们，当我们完成 if 条件时 ，我们解决了另一个问题
when we were done with loops just to get a good grip on loops. Let's solve a problem. 当我们完成循环只是为了更好地掌握 循环时。让我们解决一个问题。
Let's just solve a problem using using the functions just to get a good idea of functions. 让我们使用函数来解决一个问题 ，只是为了更好地了解函数。
What kind of problems should be solved here? Should we solve an older problem? Last time 这里应该解决什么样的问题？我们 应该解决一个老问题吗？上次
we solve a problem using loops that are sorting a list? What Why don't we? Why don't we solve 我们使用对列表进行排序的循环来解决问题 ？我们为什么不呢？我们为什么不解决
the same problem, but in a different way? So let's go to Jupiter and see. See our file 同样的问题，但方式不同？所以让 我们去木星看看。查看我们的文件
Jupiter file? We have actually solved a function, which somewhere using loops, just let me just 木星文件？我们实际上已经解决了一个函数 ，它在某处使用循环，让我只是
find that out. Oh yeah, they're here. So here. So given a list of numbers, let's this make 找出来。哦，是的，他们来了。所以在这里。 所以给定一个数字列表，让我们这样做
another list or maybe the same list that contains all the items in the sorted order, from minimum 另一个列表或可能包含按排序顺序的所有 项目的相同列表，从最小值开始
to maximum, your result will be another list like this. And we solve that using loops. 最大，您的结果将是另一个这样的列表 。我们使用循环来解决这个问题。
Okay, let's solve the same problem. Exactly the same problems that solve the same problem 好的，让我们解决同样的问题。 完全相同的问题解决相同的问题
using a different way using a different user using functions just to get a grip on functions. 使用不同的方式使用不同的用户 使用功能只是为了掌握功能。
So let's say that's our problem we want to solve. So that's the problem again, and we 所以让我们说这是我们想要解决 的问题。那么问题又来了，我们
want to solve that. So how can we solve that? To solve that, let's first define a function. 想解决那个。那么我们该如何解决呢？为了 解决这个问题，让我们首先定义一个函数。
Let's just make a function. 让我们做一个函数。
Let's just make a function that let's just make a function, let's say define, find minimum 让我们创建一个函数，让我们创建 一个函数，比如说定义，找到最小值
and the function accepts a list. And we're times the minimum value in the list not only 并且该函数接受一个列表。我们 不仅乘以列表中的最小值
the minimum value of the list, but also the position of that minimum value. So find minimum 列表的最小值，以及该最小值 的位置。所以找到最小值
as well as find out Some minimum as well as the position of the minimum in the list. So 以及找出一些最小值以及最 小值在列表中的位置。所以
how can we how can we solve that problem? That's that's one standalone function, no 我们怎样才能解决这个问题 ？那是一个独立的功能，不
matter what list you pass in, it will find the minimum. Okay? As long as the the minimum 无论您传入什么列表，它都会 找到最小值。好的？只要最小
is defined for the items of the list, for example, the list items, or let's say all 是为列表项定义的，例如 列表项，或者说所有
the metrics, okay, how can we how can we do that? Let's see, minimum value is the list. 指标，好吧，我们如何才能做到这一 点？让我们看看，最小值是列表。
Zero, that's let's say, the minimum value. And right now the index at the minimum value 零，也就是说，最小值 。现在指数处于最小值
is, let's say, is zero. Okay? like we did in the loops, like is, it is kind of the same 是，让我们说，是零。好的？就像我们 在循环中所做的一样，就像是一样
goal, but let's try it a function for it. Okay. So that's the function fine, man. So 目标，但让我们尝试它的功能。好 的。所以这就是功能，伙计。所以
how can we how can we proceed? What should we write here? Let's see a counter. Let's 我们如何进行？我们应该在这里写什么 ？让我们看看一个计数器。让我们
see. Concrete let's or it may be that city counter right now is zero for x in L. K, if 看。具体让我们或者它可能是现在的城市 计数器对于 L.K 中的 x 为零，如果
x is smaller than our minimum value, if that's true, then the minimum value indeed is x. x 小于我们的最小值，如果这是真的 ，那么最小值确实是 x。
And the index where we found that is high, okay, great. Else do nothing I mean, else 我们发现的指数很高，好吧，很棒。 否则什么都不做我的意思是，否则
just go away. And I plus equals one. So move on. So AI is just the position so AI is moving 刚刚离开。而我加等于一。所以继续前进 。所以 AI 只是位置，所以 AI 正在移动
on and on and on. As you follow the list, and M contains the minimum value and Id X 不断地。当您按照列表操作 时，M 包含最小值和 Id X
variable contains the position of the minimum value. So that's the function for for readability, 变量包含最小值的位置 。这就是可读性的功能，
we might be adding an else clause just write balls. And that means the if condition finishes, 我们可能会添加一个 else 子句，只是 写球。这意味着 if 条件结束，
I'm in do if this condition holds true, do that stuff, otherwise do nothing. That's just 如果这个条件成立，我就去做，做 那些事，否则什么都不做。那只是
because of readability. If you want, even if you don't write the else clause and pass 因为可读性。如果你愿意， 即使你不写else子句并通过
statement, even then everything is fine. So let's call this function just to test whether 声明，即使那样一切都很好。所以 让我们调用这个函数只是为了测试
this function is working properly or not. So let's just find, oh, we haven't returned 此功能是否正常工作。所以让我们 找到，哦，我们还没有回来
anything. We need, we need the minimum value as well as the index. So return a minimum 任何事物。我们需要，我们需要最小值 以及索引。所以返回一个最小值
value as well as the position so return that. Okay. Oh, but we do view returning that inside 值以及位置，因此返回。好的。哦 ，但我们确实认为将其退回内部
the loop that becomes in the body of the loop. Oh, no, no, no, no, no, that's bad. Because 成为循环体中的循环。哦，不，不 ，不，不，不，那很糟糕。因为
even in the first iteration, the return will be called an even in the first iteration, 即使在第一次迭代中，返回值也会 在第一次迭代中被称为偶数，
the function will finish indentation, remember, indentation. Now that's better. Now this is 该函数将完成缩进，记住，缩进 。现在好多了。现在这是
no longer inside the body of the loop. Great. That was a bug. We fixed it, right? Okay. 不再在循环体内。伟大的。那是一个错误 。我们修好了，对吧？好的。
So let's go find, let's receive a B, so a will contain the minimum value, and we will 所以让我们去寻找，让我们接收一 个 B，所以 a 将包含最小值，我们将
contain the index of the minimum value. So fine men, for example. And the list let's 包含最小值的索引。例如，如此 优秀的男人。名单让我们
let's give it the list. 13423409. Let's say now the minimum value is zero. And that minimum 让我们把清单给它。 13423409. 假设 现在最小值为零。而那个最低限度
value appears that 0123. That's the third index. So b should be three a should be zero. 值显示为 0123。这是第三个索引 。所以 b 应该是三个 a 应该是零。
So let's see, what's the value? What's the result? So Brent? A, B? So A is zero? Yes. 那么让我们看看，它的价值是什么？结果如何 ？那么布伦特？甲，乙？所以A为零？是的。
And the position of minimum is three, I guess it is working fine. rate. So that's one function, 最小的位置是三个，我想它工作 正常。速度。所以这是一个功能，
find a minimum? Let's find another let's write another function. Swap. So define. define 找到一个最小值？让我们找到另一个让我们编写 另一个函数。交换。所以定义。定义
another function, let's say swap values. And what we do is it it actually accepts two indices 另一个功能，让我们说交换值。我们 所做的是它实际上接受两个索引
index one that actually accepts list then two indices, index one and index two. And 索引一实际接受列表，然后是两 个索引，索引一和索引二。和
what it does is it actually swaps the value of index. So index, one value should go to 它所做的实际上是交换索引的值 。所以索引，一个值应该去
index two position and index two value should go to index one position in the same list, 索引二位置和索引二值应该去索引同 一列表中的一个位置，
and then it returns the list. Okay, great. So it would it so so that's, that's a good 然后它返回列表。好的，太好了 。所以就这样吧，这样就好了
example it would, it accepts a list type variable, it accepts index type variable which are integers. 例如，它接受一个列表类型变量 ，它接受整数的索引类型变量。
Great. So 伟大的。所以
let's continue with let's define a variable temp that contains l ID x index one, just 让我们继续让我们定义一个包含 l ID x 索引一的变量 temp，只是
store it in a temporary variable, then at this particular index, next one, just copy 将其存储在一个临时变量中，然后在 此特定索引处，下一个，只需复制
this value. Don't worry, we'll see lists in detail. Later on now list. Now at index one, 这个值。别担心，我们将详细查看列表 。稍后在现在列表中。现在在索引一，
the value of index two is copied. But it is not overwritten, because we already have saved 索引二的值被复制。但它不会 被覆盖，因为我们已经保存了
the value somewhere before that copying appears. So l at ID x two is simply damp. And now return 该复制出现之前某处的值。所以在 ID x 2 处的 l 只是潮湿。现在回来
the list. So that's how you can swap the two values if you want. Great. So let's just check 列表。这就是您可以根据需要交换两个值 的方法。伟大的。所以让我们检查一下
it, whether the two values are swept or not. So let's say list is 236. And seven, that's 它，无论是否扫过这两个值。所以让 我们说 list 是 236。 七，那就是
a that's list. And let's say we want alto that is swept values. And let's say we pass 这就是清单。假设我们想要中 音，即扫掠值。假设我们通过
the list and we want the values to be swept at position one, and position three, which 列表，我们希望将值扫描 到位置一和位置三，即
may add position one, the value is three, because the position starts from zero, and 可以添加位置一，值为三， 因为位置从零开始，并且
at the third position, the value is seven. So we want these to swap. So the result will 在第三个位置，值为 7。所以我们 希望这些交换。所以结果会
be 276. And three, let's see what's the result? So let's print out two. And yeah, it works 是 276。三，让我们看看结果是什么？所以 让我们打印出两个。是的，它有效
great. What else? What else do we need? So we have find a minimum function, we have swept 伟大的。还有什么？我们还需要什么？所以 我们找到了一个最小函数，我们已经扫过
values function. What else? So yeah, what should we do? Now let's write the main function 值函数。还有什么？所以是的，我们 该怎么办？现在让我们编写主函数
sorting. Let's write that function. And we will call we will use these kinds of functions 排序。让我们写那个函数。我们 将调用我们将使用这些类型的函数
inside that function when you call these functions. So let's define sort list. Let's say that's 当您调用这些函数时，在该函数内部。所以 让我们定义排序列表。让我们说那是
our function, it accepts a list and it returns a sorted list. Okay, what should we do? What 我们的函数，它接受一个列表并返回一个排序 的列表。好的，我们该怎么办？什么
do you think? What should we do for the very first time? Well, first of all, we should 你认为？我们第一次应该做什么 ？嗯，首先，我们应该
check whether all these list it contains the list contains all the numeric values are not 检查所有这些列表是否包含 列表包含的所有数值都不是
let's say we're just doing this for numeric values. So, we should first check the all 假设我们只是对数值执行此操作。 所以，我们应该首先检查所有
the arguments are are of numeric type or not, for that, we should write a function that 参数是否为数字类型，为此， 我们应该编写一个函数
should do that oh, remember that function is all written in in a module remember that 应该这样做哦，记住函数 都写在一个模块中记住
module we made that module ourselves? So, we can import that module if we want import? 模块是我们自己制作的？那么，如果我们 想要导入，我们可以导入该模块吗？
My remember that my universal functions and we just need that function we just need that 我记得我的通用功能，我们只需要 那个功能，我们只需要那个
function one just from from my universal functions import what import check if Numerix check 功能一只是从我的通用功能导入什么 导入检查如果Numerix检查
if not numeric, as you can write that function name something else, but justice. So you import 如果不是数字，你可以把函数名写成 别的东西，但正义。所以你导入
that function. Now you may be able to use that function. So after that, you can use 那个功能。现在您可以使用该功能 了。所以在那之后，你可以使用
that function. If check, if not, numeric list or remember that function returns true if 那个功能。如果检查，如果没有，数字 列表或记住该函数返回真如果
all the values are numeric, otherwise, it returns false. So if it is true, then move 所有值都是数字，否则返回false。 所以如果它是真的，然后移动
on the if it is not true. If it is not true, what should you do? If it is not true? If 如果不是真的。如果它不是真的，你应该 怎么做？如果不是真的？如果
it is not true, then you might be printing an error. Error. Last does not contain numeric 这不是真的，那么您可能会打印 错误。错误。最后不包含数字
values, maybe that and then you just return. Return. That's it. I mean, return. Don't need 价值观，也许那样，然后你就回来了。返回 。就是这样。我的意思是，返回。不需要
to write anything in return. Fine. Great. So else we need not to write else because 写任何东西作为回报。美好的。伟大 的。所以 else 我们不需要写 else 因为
this return will take care of that but it is for readability. That's good, right health. 这个返回会处理这个问题，但它 是为了可读性。这很好，健康。
If all are numeric, then what should we do? Okay, what should we do? If all are numeric, 如果都是数字，那我们该怎么办？好 的，我们该怎么办？如果都是数字，
what we do is we will be doing what we will be fine minimum. We'll be finding out the 我们所做的是我们将做我们会做的 最低限度的事情。我们会发现
minimum and then we will be swapping the minimum from 最小值，然后我们将从中交换最小值
what should we do what we we have already a function find a minimum that we can call 我们应该做什么我们已经有一个 函数找到我们可以调用的最小值
just right away we have a function swap values that we can call right away. We already have 马上我们就有了一个可以立即调用 的函数交换值。我们已经有了
used this function. How can we combine all these functions? How can we use all these 用过这个功能。我们如何将所有这些功能 结合起来？我们如何使用所有这些
functions just to achieve the problem sorting, we want disorder list. How can you do that? 函数只是为了实现问题排序，我们 要无序列表。你怎么能这样做？
Okay. Yeah, that's, that's, it looks like it looks like a different thing. Maybe? Maybe. 好的。是的，那个，那个，它看起来 像一个不同的东西。也许？也许。
So, let's just write out, let's just for x in the list, let's start thinking here for 所以，让我们写出来，让我们只为列表 中的 x，让我们在这里开始思考
every element that is in list for x and list what should we do? We should we should find 列表中的每个元素 x 和列表我们 应该怎么做？我们应该找到
out the minimum and slap the minimum with x r. So, we should find out the minimum as 取出最小值并用 x r 拍打最小值 。所以，我们应该找出最小值为
well as the index of the minimum and should slap it with with the value x and everything 以及最小值的索引，应该 用值 x 和所有东西拍打它
will become great. Yeah, I guess Yes. Okay. So, what what we are going to do is we are 会变得很棒。是的，我想是的。好 的。所以，我们要做的是我们是
going to maintain a counter right now, the counter is zero, which is just the index, 现在要维护一个计数器，计数器 为零，这只是索引，
which we are going to do is we are going to find out the minimum minimum and index where 我们要做的是找出最小 最小值和索引在哪里
the minimum lies. So, by find minimum in the list, so, it will return us the minimum as 最低限度的谎言。因此，通过在列表 中找到最小值，它将返回最小值为
well as the index where the minimum lies and then what we do is, we will say, Okay, okay, 以及最小值所在的索引，然后我们要 做的是，我们会说，好吧，好吧，
what we want to do is, L is actually L is swap, swap values with index see swap values 我们想要做的是，L 实际上是 L 是 交换，交换值与索引见交换值
and list with index c. So, index c should be swapped with ID x and C plus equals one, 并列出索引 c。因此，索引 c 应该 与 ID x 交换，并且 C 加等于 1，
will that work with that work? So, after this will the will the whole list be sorted. So, 这将与该工作一起工作吗？因此，在此之后 ，将对整个列表进行排序。所以，
let's return the list is that true, I mean, we are finding out the minimum value one by 让我们返回列表是真的，我的 意思是，我们正在找出最小值
one, the only catch is the list is updated here. And, oh, there was a problem. When we 一，唯一的问题是列表在这里更新。 而且，哦，有问题。什么时候我们
are finding out, when we are finding out the minimum, we are finding out the minimum from 正在寻找，当我们寻找最小值 时，我们正在寻找最小值
the list. And every time the same minimum will be returned. That's a big problem. So, 列表。并且每次都会返回相同的最 小值。这是一个大问题。所以，
looks like this fine minimum function is not doing our job, what we need to do really is 看起来这个很好的最小函数并没有完成 我们的工作，我们真正需要做的是
the, we should go to find min function and give it that start your stock your final minimum ，我们应该去找到最小函数并给 它开始你的股票你的最终最小值
from a particular index. So, don't don't search the whole list to find the minimum, start 从一个特定的索引。所以，不要搜索 整个列表来找到最小值，开始
finding out the minimum from the following index, for example. So let's give a start 例如，从以下索引中找出 最小值。让我们开始吧
index and maybe an end index. But let's give a starting next. So start searching the minimum 索引，也可能是结束索引。但让我们 开始下一步。所以开始搜索最小值
from right from there. How can we change all the code right now? Oh, that's bad thing. 从那里。我们现在如何更改所有 代码？哦，那是坏事。
Let's change the code. Let's say that's the start index. Start index. That's it. This 让我们更改代码。假设这是开始索引 。开始索引。就是这样。这个
the index right now is start index and I is also start up VB we may use a range function 现在的索引是开始索引，我也在 启动 VB 我们可以使用范围函数
here, that might be much more feasible to us. So let's use a range function. Rather 在这里，这对我们来说可能更可行。 因此，让我们使用范围函数。相当
than this let's change the coding a whole lot. That's a bad thing we need to change 比这让我们彻底改变编码。这 是一件坏事，我们需要改变
the code for i in range i 在范围内的代码
starting from start index, starting starting from start index, ending at length of the 从起始索引开始，从起始索引 开始，到长度结束
list and doing a step of one Okay. Now x really is x is really list at the index i okay if 列出并做一个步骤 好的。现在 x 真的 是 x 真的列在索引 i 上，如果
x is smaller than m then this is that an index is AI. Otherwise this we need not to do this x 小于 m 那么这是一个索引是 AI。否则我们不需要这样做
because this is this is happening automatically. And rest of the story is same, I guess Yes. 因为这是自动发生的。其余的故事 是一样的，我想是的。
That will work out. Okay, great. Oh, there is a problem. Oh, we just missed this column 那会解决的。好的，太好了。哦，有 问题。哦，我们刚刚错过了这个专栏
here. Great. We fix it. Okay. Now, so if value is there, maybe this works. Maybe Doesn't 这里。伟大的。我们修复它。好的。现在，如果 存在价值，也许这可行。也许没有
maybe there is a bug. Let's see, let's let's just call this function. So let's call this 也许有一个错误。让我们看看，让我们 调用这个函数。所以让我们称之为
function l two is sort list. And let's pass the list as to 153. Minus 870. Let's see. 功能 l 二是排序列表。让我们将列表传递 给 153。减去 870。让我们看看。
That's boss this list and see what it returns. If it returns fine, we might be happy. Otherwise, 那就是这个列表的老板，看看它返回什么。如果 它返回良好，我们可能会很高兴。除此以外，
we will see where is the bug? If there is a bug, oh, this does not contain numeric values. 我们将看到错误在哪里？如果 有bug，哦，这个不包含数值。
Why not? list does not contain numeric values. Why is that happening? bliss actually contains 为什么不？列表不包含数值。 为什么会这样？幸福其实包含
all the American values. We read the problem, check if not numeric, let's see the let's 所有美国价值观。我们阅读问题，检查 是否不是数字，让我们看看让我们
see the implementation of check if not numeric. Let's see that. Check. If not numeric, let's 请参阅检查如果不是数字的实现。让我们 看看。查看。如果不是数字，让我们
see the implementation. And there is the bug. Because all these are numeric. So check if 见实施。还有一个错误。因为这些 都是数字。所以检查是否
not numeric x in arcs, if not is instance then return false. So if everything is int 不是弧中的数字 x，如果不是实例， 则返回 false。所以如果一切都是 int
or float, so if x is int or float, then return otherwise return true. So it returns true 或浮点数，所以如果 x 是整数或浮点数， 则返回，否则返回真。所以它返回真
if all our if all our numerix. So it returns true if all our Numerix so not true means 如果我们所有如果我们所有的数字。所以如果我们 所有的 Numerix so not true 意味着它返回 true
false. And why why does Why does returning for us? So that is just was let us just see 错误的。为什么为什么会为我们 返回？所以这只是让我们看看
why it is returning false. That's that's the bad news that something is happening wrong. 为什么它返回false。那就 是发生错误的坏消息。
Let us just see how this is working. So that is just check. Check, if not numeric. And 让我们看看这是如何工作的。所以这只 是检查。检查，如果不是数字。和
let's pass the list this list. And let's see what is returned. Let's just print the return 让我们通过列表这个列表。让我们 看看返回了什么。让我们打印返回
thing. But it is either true or false. So it returns a false why it is returning a false. 事物。但它要么是真的，要么是假的。所以 它返回一个错误，为什么它返回一个错误。
It is a bad thing. Why does they're turning a false? Let's go to the File. Let's go to 这是一件坏事。为什么他们变成假 的？让我们转到文件。让我们去
the File. Here. Sorry. Let's go to the File. Here in this directory. Let's open up this. 文件。这里。对不起。让我们转到文件 。在这个目录中。让我们打开这个。
Maybe open this in simply an old bad. Maybe an old bad, why not? Or maybe some other fancy 也许在简单的旧坏中打开这个。也许是一个 老坏，为什么不呢？或者也许是其他一些幻想
editor. Let's open this up and see what is happening. ad format font, let's have a bigger 编辑。让我们打开它，看看发生了什么 。广告格式字体，让我们有一个更大的
follow on and see what is happening. 继续，看看发生了什么。
Self face one of 20 bugs are bad, they're really bad for x and ogs. Okay? If not is 自我面对 20 个错误之一是不好的，它们对 x 和 ogs 来说真的很糟糕。好的？如果不是
in stance. So first of all is in stance this, it will return true always okay. If not true, 实例。所以首先是这个，它总是 会返回 true 。如果不是真的，
which means false. Then we'll move on and the loop will be running if anywhere you where 这意味着错误。然后我们将继续前进 ，如果你在任何地方，循环就会运行
it is finding out where it is finding out basically. So this this is working really 它正在找出它基本上在哪里 发现。所以这真的有效
fine. Let's, let's let's write this function somewhere inside our notebook and see what 美好的。让我们，让我们把这个函数写在我们 笔记本的某个地方，看看会发生什么
is let's say rather than this. Let's say this function like check the metric to check numeric 是让我们说而不是这个。假设这 个函数就像检查指标以检查数字
to check it not numeric to let's call that function and see what happens check numeric 检查它不是数字让我们调用该函数 ，看看会发生什么检查数字
to it is returning false again. Why does returning false? That's amazing. Where is the false? 它再次返回false。为什么返回false？ 太棒了。哪里是假的？
So two is integer? Yes. One is integer. Yes. So true. True. True. True. All these are true. 所以二是整数？是的。一个是整数。是的。如此 真实。真的。真的。真的。所有这些都是真的。
OH minus eight might be a problem. minus eight might be a problem. Let's see. Maybe. I don't 哦减去八可能是一个问题。减八可能是 个问题。让我们来看看。也许。我不
know. Well, well, there is still false. I mean, I'm stuck here. Guys. I'm stuck here. 知道。好吧，好吧，还是有假的。我的意思是 ，我被困在这里。伙计们。我被困在这里。
I don't know what to do. I don't know what to do. I have to debug this function, I have 我不知道该怎么办。我不知道该怎么 办。我必须调试这个功能，我有
to go inside that function and see what is happening. So what we really are eggs. Oh 进入该功能并查看发生了什么 。所以我们真的是鸡蛋。哦
my god, the big trouble big trouble. Yeah, I found the air. We are passing a list. And 我的天，大麻烦大麻烦。是的，我找到 了空气。我们正在传递一个列表。和
that list is just one argument. That is not a lot of arguments we have to pass all these 该列表只是一个论据。这不是很多 我们必须通过所有这些的论点
arguments in in a different way. I mean, if you want to, you're getting you're getting 以不同的方式论证。我的意思是 ，如果你愿意，你就会得到
the bug, the bug is we're passing one variable, not a lot of them 2153 817 these are not all 错误，错误是我们传递了一个变量， 不是很多 2153 817 这些还不是全部
different variables. For example, if we just go inside and print x, for just first x, it 不同的变量。例如，如果我们只是 进入并打印 x，对于第一个 x，它
is the all it is all the it is all the list. It is all the list. It is not the variables 是所有它是所有它是所有列表。 这是所有的清单。这不是变量
one by one. Let's see. Yeah, I found the bug. Found the bug. Wait. Yeah, see, it is not? 逐个。让我们来看看。是的，我发现了这个错误 。发现错误。等待。是的，看，不是吗？
It is not a lot of it is not a lot of variables. It is not a lot of arguments. It is just one 它不是很多，也不是很多变数。这 不是很多争论。这只是一个
argument that is in the form of placed variable. That's incredible. What should we do? Should 参数是放置变量的形式。这是令人难以 置信的。我们应该做什么？应该
we go inside and add another function check if not Americ for lists, rather than variable 我们进去并添加另一个函数检查 列表是否不是 Americ，而不是变量
number of arguments. What should we do? Let's write another function that check for the 参数的数量。我们应该做什么？让 我们编写另一个函数来检查
list. Let's write here check numeric to it contains the list for exam just accepts list 列表。让我们在这里写检查数字 到它包含考试列表只接受列表
ello or maybe l or whatever x or art just simply, you can call the or l list. And it hello 或者 l 或者任何 x 或 art 只是简单 地，你可以调用或 l 列表。而它
goes through all the list. And does does the same job as previous. So now this will work. 遍历所有列表。并做与以前相同 的工作。所以现在这将起作用。
So the function that was there in our module is no longer working, and it will not work. 所以我们模块中的函数不再起 作用，它也不会起作用。
So we are not going to use the function that is in the module, we are going to write another 所以我们不打算使用模块中 的函数，我们将编写另一个
function that will help us here. And we have written that, and here we go. It just chained 在这里可以帮助我们的功能。我们已经 写好了，我们开始吧。它只是连锁
that function to that. And we just we just throw that out again. And let's see what happens 那个功能。我们只是再次将其 扔掉。让我们看看会发生什么
now. Oh, there was another error whichever. Find a man missing one o v v did not find 现在。哦，还有另一个错误 。找人失踪一 o v v 没找到
this fireman is missing the starting index. So the starting index is C rate. 这个消防员缺少起始索引。所以 起始指标是C率。
Right? That's a problem. That's a huge problem. Let's just sorted Oh, my god list finally 对？这是个问题。这是一个巨大的问题。让 我们整理一下哦，我的上帝名单终于
is sorted. Oh, huge, huge, huge. So you see, you can call the functions inside other functions, 排序。哦，巨大的，巨大的，巨大的。所以 你看，你可以调用其他函数内部的函数，
you can call the functions from modules. If they are no longer working or no longer beneficial 您可以从模块调用函数。如果 他们不再工作或不再有益
for you, you can write new functions, you can call them you can. Yeah, all that stuff. 对你来说，你可以编写新的函数，你 可以调用它们。是的，所有这些东西。
I guess that that lengthy video taught you a lot of lessons, how to how to code actually. 我想那个冗长的视频教了你 很多课程，如何实际编码。
And this actually happens when you are doing tasks that are really big. You have to define 这实际上发生在您执行非常 大的任务时。你必须定义
different functions, you need to define different functions for modular approach, and focus 不同的功能，你需要为模块化的方法 定义不同的功能，并关注
on each function as a separate entity. And that that makes much simplicity in managing 在每个功能上作为一个单独的实体 。这使得管理变得更加简单
the code and bug fixing and all that stuff. You see, I fixed the bug by just noticing 代码和错误修复以及所有这些东西。 你看，我只是注意到了这个错误
that just by just focusing on this function. I have not thought anything else, just focus 仅仅通过专注于这个功能。 我没有想别的，只是专注
on that function go and see the implementation fix that everything else stays the same. Yeah, 在该功能上，查看其他所有内容 保持不变的实现修复。是的，
so too lengthy a swap here. Okay, now you have done a lot of practice about functions, 在这里交换太长了。好的，现在 你已经做了很多关于函数的练习，
loops, and a lot of stuff. That was all the basic programming in Python. In the in the 循环，还有很多东西。这就是 Python 中的所有基本编程。在中
next video, from the next video, we will see the real power, a much more real power of 下一个视频，从下一个视频中，我们将 看到真正的力量，更真实的力量
Python where you need not write a lot of loops and a lot of gold and still you will be able Python，你不需要写很多循环 和很多金子，你仍然可以
to achieve a lot of stuff. And for that we need to go through the data structures that 实现很多东西。为此， 我们需要通过数据结构
are available in Python. So from the very next video, we will start seeing strengths 在 Python 中可用。所以从下一个 视频开始，我们将开始看到优势
that study or structure we will see less in detail we will see set in detail we will see 那个研究或结构，我们将看到较少的细节 ，我们将看到详细的设置，我们将看到
dictionary in detail we will see tuples in detail. And after going through all these 详细字典我们将详细看到元组 。在经历了所有这些之后
data structures and getting a good grip for the data structures. Then finally we will 数据结构，并很好地掌握数据 结构。那么最后我们会
move we will move to the packages that are available for data science, particularly NumPy, 我们将转向可用于数据科学 的软件包，尤其是 NumPy，
pandas matplotlib. And we will see maybe I include maybe I include one or two videos 熊猫 matplotlib。我们会看到也许 我包括也许我包括一两个视频
for psychic learn as well. So hope to see you For the whole new phase in Python, the 也用于通灵学习。所以希望见到 你 对于 Python 的全新阶段，
data structures, so we'll hope to see in the next video. Okay, let's dive into the long 数据结构，所以我们希望在下一个视频 中看到。好的，让我们深入探讨
awaited strings. string is basically just a sequence of characters. And it's a data 等待的字符串。字符串基本上只 是一个字符序列。这是一个数据
type, it's kind of a data type. In Python, it's much more powerful. The reason, the reason 类型，它是一种数据类型。在 Python 中，它要强大得多。原因，原因
of, I mean, making this a whole new data type in, in almost every language is, the reason 的，我的意思是，在几乎所有语言中，使 之成为一种全新的数据类型是，原因
is that almost all the data all the text that appears in sequence of characters, so making 就是几乎所有的数据都是按字符顺序 出现的所有文本，所以使得
that sequence of corrector, the whole text as one kind of data type, and writing special 那个序列的更正，整个文本 作为一种数据类型，写特殊
kind of functions to, to deal with that text might be necessary. And that's what the string 可能需要某种功能来处理 该文本。这就是字符串
is. In Python, for example, you can declare a string variable s, or any variable name, 是。例如，在 Python 中，您可以声明一 个字符串变量 s，或任何变量名，
by just double quotes, let's say ABC, are our equal monthly by a single quotes, either 只是双引号，让我们说 ABC，是 我们每月相等的单引号，要么
way is fine, d f. So either way is fine, you can declare using double quotes, or single 方法很好，df。所以无论哪种方式都可以 ，您可以使用双引号或单引号声明
quotes, either way is fine. One thing is, be careful, don't mix. I mean, don't start 报价，无论哪种方式都可以。一件事是， 小心，不要混合。我的意思是，不要开始
by a single quote, and think that now I will end with double quote, and that will be fine. 通过单引号，并认为现在我将以 双引号结束，这样就可以了。
So don't mix them together. If you're using single quotes, use single quotes, if you're 所以不要把它们混在一起。如果您使用 单引号，请使用单引号，如果您是
using double quotes, use double quotes, don't mix them together, that might be much more 使用双引号，使用双引号，不要将 它们混合在一起，那可能会更多
confusing later on. So let's say this S is a string, Python is the best language for 稍后混淆。所以假设这个 S 是一 个字符串，Python 是最好的语言
data science. That's a D is another string that is defined by single quotes. In this 数据科学。那是一个 D 是另一个 由单引号定义的字符串。在这
course, we are going to learn Python, then you can print s, different in a different 当然，我们要学习Python，然后你 可以打印s，不同的在不同的
way, let's say you will call you can call a brand s, you can call a print to D. Or you 方式，假设你会打电话给你可以打电话 给品牌，你可以打电话给 D。或者你
can just by the way, you can you can add two string variables s and D. And the result is 可以顺便说一下，你可以添加两 个字符串变量 s 和 D。 结果是
a new variable. That's how the plus symbol works in strings is plus in strings means 一个新变量。这就是加号在字符串中的 工作方式是加号在字符串中意味着
just concatenate concatenate them together. So first, you just copy this string, the whole 只是连接将它们连接在一起。所以 首先，你只需复制这个字符串，整个
string, and then you just concatenate the other string with it. And the result is a 字符串，然后您只需将另一个 字符串与它连接起来。结果是
new string. Now that's a new variable, you can use that variable and do a lot of stuff 新字符串。现在这是一个新变量， 您可以使用该变量并做很多事情
with it. So let's go to Python and see actually, the brains in in the strings in in the running 用它。所以让我们去 Python 看看实际上 ，在运行中的字符串中的大脑
form. So let's say S is 形式。所以让我们说 S 是
string, let's say, right on is good language, let's say. And let's have another string T, 字符串，让我们说，正确的语言，让我们 说。让我们有另一个字符串 T，
that is using single quotes. It's good for data science, sci fi. Okay, it's good for 那是使用单引号。这对数据科学 、科幻很有好处。好的，这对
data science, let's run these two, and see the type of s was the type of s. The type 数据科学，让我们运行这两个，看看 s 的类型是 s 的类型。方式
is str string, str, that's what the type is. And if you just print s, that will be printed. 是str字符串，str，这就是类型。如果 你只打印 s，它就会被打印出来。
Python is a good language. Remember, so far, we are using this sprint. And always we use Python是一门好语言。请记住，到目前为止， 我们正在使用这个 sprint。我们总是使用
this kind of Hello or something like that. That basically is a string because by the 这种你好或类似的东西。那基本上 是一个字符串，因为由
way, the sprint function, actually, it takes an arbitrary number of arguments, we can print 方式，sprint 函数，实际上，它需要 任意数量的参数，我们可以打印
hello, then we can print anything in another type, then we can print another Hello, let's 你好，然后我们可以打印其他类型的任何东西 ，然后我们可以打印另一个你好，让我们
say hello to hello to that's a multi multi variable argument function print, then we 向你问好，这是一个多变量 参数函数打印，然后我们
can have another string maybe Who are you. And then maybe a floating point number 5.9. 可以有另一个字符串也许你是谁 。然后可能是一个浮点数 5.9。
So we we have used these kind of, we have used these kind of, I mean stuff a lot. We 所以我们使用了这些，我们使用 了这些，我的意思是很多。我们
have used print function. And we were using these double quotes again and again. But but 使用过打印功能。我们一次又一 次地使用这些双引号。但是但是
these are actually strings that we will be that we were using later there. So the spring 这些实际上是我们稍后将在那里 使用的字符串。于是春天
function actually accept strings and all these kind of Normally, the whenever you use print, 函数实际上接受字符串和所有这些类型 的正常情况下，每当您使用打印时，
normally you're using it normally you're going to actually display some text, and maybe you're 通常，您通常会使用它来实际 显示一些文本，也许您正在
writing that text into some file and so on. So this string is highly, highly useful. Most 将该文本写入某个文件等等。所以 这个字符串非常非常有用。最多
of the data is available in the text form in the screen form. And we want to process 的数据在屏幕形式的文本 形式中可用。我们要处理
the data we want to find the anomalies in data, we want to fix them again, we want to 我们要找出数据中的异常数据， 我们要再次修复它们，我们要
stay in the text. So it is good to have a data type that actually have a lot of functionality 留在正文中。所以拥有一个实际上 有很多功能的数据类型是很好的
that handles all that stuff. So Let's see, for example, another another, let's see how 处理所有这些东西。所以让我们看看 ，例如，另一个，让我们看看如何
can we concatenate the two strings, for example, SMT. Let's say we have B, that is s plus T, 我们可以连接两个字符串吗，例如，SMT。 假设我们有 B，即 s 加 T，
that's concatenated. B. And that's francqui. And we is going to get an ad. While bicon 那是串联的。 B. 那就是弗兰基。我们 将得到一个广告。虽然比肯
is a good language. It's good for data science. Well, it is concatenated. But there is no 是一门好语言。这对数据科学有好处 。嗯，它是串联的。但是没有
space between two because wherever the first string ends, the second string starts right 两个之间的空格，因为第一个字符串在哪里 结束，第二个字符串就从哪里开始
from there. What if we can get in a three strings? s plus another string that just contains 从那里。如果我们可以输入三个字符串 怎么办？ s 加上另一个只包含的字符串
a space corrector? Then this string? Why do we whatever that is there in double quotes, 空间校正器？那么这个字符串呢 ？为什么我们用双引号括起来，
or single quotes, whatever, one corrector to track character, all these things are called 或单引号，无论如何，一个跟踪字符 的校正器，所有这些东西都被称为
strings. So now we are concatenated, three strings together as a space, one space string 字符串。所以现在我们连接起来，三个字 符串一起作为一个空格，一个空格字符串
that contains just a space greater than T. And let's see what happens now. So Python 只包含一个大于 T 的空间。让我们 看看现在会发生什么。所以Python
is a good language space, it's good for data science and so on. Well, so 是一个很好的语言空间，有利于数据科学 等等。那么，所以
yeah, so that's basically the introduction of string. What if we want for example, to 是的，这基本上就是字符串的 介绍。例如，如果我们想要
concatenate? What if we want, we have a variable A, which is 12. And let's say we have variable 连接？如果我们想要，我们有一个变量 A，它是 12。假设我们有变量
b, which is the price of this book, let's say the price of this book, and a is 12. So b，这是这本书的价格，我们说 这本书的价格，a是12。所以
let's say this is our price. Now price is in integer form S is in book form, let's say 假设这是我们的价格。现在价格 是整数形式 S 是书本形式，比方说
we want to make another string we, that contains the following kind of thing, the price of 我们想制作另一个字符串， 包含以下内容，价格
this book is and then whatever the private price is, that should be there. So what how 这本书是，然后无论私人价格是 多少，都应该在那里。那怎么办
can we do that? So let's say s, plus, maybe, maybe another string is then maybe a space. 我们能做到吗？所以让我们说 s，加上，也许 ，也许另一个字符串可能是一个空格。
So that after that the price appears? Now, if we right plus and right price, price is 那么在那之后价格出现？现在，如果 我们正确加和正确的价格，价格是
no longer a string, it is an integer, and an integer cannot be concatenated the string 不再是字符串，它是一个整数， 并且一个整数不能连接字符串
in a straightforward way, like plus, how can we how can we make a message like the the 以一种直截了当的方式，比如 加号，我们如何才能像
price of this book is, whatever the value of the price is, one way to do that is to 这本书的价格是，无论价格 是多少，一种方法是
convert the variable price, the Convert the type of the variable of price, from integer convert the variable price, the Convert the type of the price of the variable, from integer
to string, that means whatever the value, in this case, 12 is written, that becomes 到字符串，这意味着无论值如何， 在这种情况下，写入 12，都会变成
a string of characters one and two. And now it can be concatenated with with the rest 一串字符一和二。现在它 可以与其余的连接起来
of the string, and we will contain the message that we want. For example, if we now see what 的字符串，我们将包含我们想要的消息 。例如，如果我们现在看到什么
is free, that is, the price of this book is this book is 12. Oh, we don't have a space 是免费的，就是这本书的价格是 这本书是12。哦，我们没有空位
before. So let's let's type a space, their space is also a corrector can be handled in 前。所以让我们输入一个空格，他们 的空格也是一个校正器可以在
strength, while so that's how we can convert different types to string. We can have a float 强度，而这就是我们可以将不同类型转换 为字符串的方式。我们可以有一个浮动
type, we can convert that to string, and so on. Another way of doing the same or achieving 类型，我们可以将其转换为字符串，等等 。做同样的事情或实现的另一种方式
the same kind of stuff is to write Brent, the price of this book is I mean, we can use 同样的东西是写布伦特，这本书 的价格是我的意思，我们可以用
the power of the variable number of arguments of then price, that's exactly the same thing. then price 的可变数量参数的力量 ，那是完全一样的事情。
The price of this book is 12, the price of this book, however, consider one thing, the 这本书的价格是12，这本书的 价格，但是，考虑一件事，
print function automatically adds the space for different kinds of arguments. You can 打印函数自动为不同类型的 参数添加空间。你可以
see that here, yeah, you need not to specify a specifier space, the space is automatically 看到这里，是的，你不需要指定一 个说明符空间，这个空间是自动的
added if it is if it is considered to be a different argument in the print function. 如果它被认为是打印函数中 的不同参数，则添加。
Okay, great. So that's the introduction of a string. We are going to explore string much 好的，太好了。这就是字符串的 引入。我们将深入探索字符串
in in much more detail in the upcoming video, so stay with us, we are going to see a string 在即将到来的视频中会有更详细的介绍，所以 和我们在一起，我们将看到一个字符串
in much more detail. Okay, hope to see you in the next video. A string might be very 更详细。好的，希望在下一个视频 中见到你。一个字符串可能非常
lengthy, or may span I'm in very lengthy and may span more than one lines. Or maybe the 冗长，或可能跨越 我很冗长，可能 跨越不止一行。或者也许
formatting is in a way that you want to even if even if it is not very lengthy, you will 格式化是一种你想要的方式， 即使它不是很长，你也会
still want the different chunks of the same string to be appear in different lines. So 仍然希望同一字符串的不同块 出现在不同的行中。所以
there is a way to declare multi line strength again using either three single quotes or 有一种方法可以使用 三个单引号或
three double quotes. And then three double quotes or single quotes. Whatever convention 三个双引号。然后是三个双引号 或单引号。无论什么约定
you follow Then you write all the string in, no matter how many lines you want, and that 你跟着然后你把所有的字符串都写 进去，不管你想要多少行，然后
one variable actually contains a multi line string. If you now print, for example, if 一个变量实际上包含一个多行字符串 。例如，如果您现在打印，如果
you call the print function on this multi line, that that's By the way, a variable name, 你在这个多行上调用打印函数， 那是顺便说一句，一个变量名，
multi line string that contains this data, multi line, multi, multi line that now the 包含此数据的多行字符串， 多行，多行，多行，现在
spelling our Spelling's around here, I just created multi line anyways, if you if you 在这里拼写我们的拼写，我 只是创建了多行，如果你
call that print function, this will the print will display the string as it is like it is 调用该打印函数，这将打印 将显示字符串，因为它是
there. So let's see the and by the way that the same multi line string kind of fashioned 那里。所以让我们看看 和 顺便说 一下，相同的多行字符串类型
remember that that is used for comments as well. If you have comments that span on multiple 请记住，这也用于评论 。如果您的评论跨越多个
lines, you can use this. So this multi line string really is if it is not saved in a variable 行，你可以使用这个。所以这个多行字符串真的 是如果它没有保存在变量中
and used as it is somewhere in the code, then that acts as a multi line comment. Great. 并在代码中的某处使用，然后 作为多行注释。伟大的。
So let's practice the multi line string in in Jupyter. notebook. Let's see. So let's 那么让我们在 Jupyter 中练习多行字符串。 笔记本。让我们来看看。那么让我们
say we have a variable A that is multi line string. And let's say the spring is this is 假设我们有一个变量 A，它是多行字 符串。让我们说春天是这样的
line one. 第一行。
Then we have this is line two, and then we have this is last line. And this line is three. 然后是第二行，然后是最后 一行。而这条线是三。
That's it. Okay, great. That's a multi line string. Let's see. How can it Brent a, what 就是这样。好的，太好了。那是一个多行字符串 。让我们来看看。怎么可能布伦特一个，什么
happens? So this is line one, this is line two, this is last line and this line is three? 发生？所以这是第一行，这是第二 行，这是最后一行，这是第三行？
Why this? The first this is shifted one corrector, right? Oh, there is a space here. Let's remove 为什么这个？第一个这是移动一个校正器 ，对吗？哦，这里有空。让我们删除
that space if not required. And run this again. While because space is a corrector that will 如果不需要，那个空间。并再次运行。 虽然因为空间是一个校正器，它将
be printed if you want. Okay, what if you really want really want the following kind 如果需要，可以打印。好吧，如果 你真的想要真的想要下面的那种
of stuff, you have, let's say brand. So what you really do is you want to bring the following 的东西，你有，让我们说品牌。 所以你真正要做的是你想带来以下
the following options are available. And the options are, let's say dab, dab, dab, let's 以下选项可用。选项是，让我们 说轻拍，轻拍，轻拍，让我们
see a hyphen, a. And that does play from a that does nothing. And then we have let's 看到一个连字符，a。这确实是从一个什么 都不做的地方开始的。然后我们让我们
say hyphen B and they're also also does nothing. Let's say you want our message to be painted 说连字符 B，他们也什么也不做。 假设您希望我们的信息被绘制
in in such a way, what will happen? Let's see. Okay, the following options are available 以这种方式，会发生什么？让我们 来看看。好的，以下选项可用
hyphenate has nothing hyphen B I mean, all this is a string multi line string, these 连字符没有连字符 B 我的意思是，所有 这些都是字符串多行字符串，这些
crackers that you think they are not there, these are spaces and they are I mean the spaces 你认为它们不存在的饼干，这些 是空间，它们是我的意思是空间
are painted here, the spaces are painted here, we are saying nothing is printed, these are 画在这里，空间画在这里， 我们说没有印刷，这些是
the spaces that are printed there. So sometimes this multi line string, it helps to format 打印在那里的空间。所以有时这个 多行字符串，它有助于格式化
our message in a way that we like. So that's how helpful in most of the cases further if 以我们喜欢的方式传达我们的信息。所以 这在大多数情况下是有帮助的，如果
you write this multi line, by the way, if you write this multi line, comment in the 你写这个多行，顺便说一下， 如果你写这个多行，注释在
start and end of any good script. That means the if you write this multi line way of defining 任何好的剧本的开始和结束。这意味 着如果您编写这种多行定义方式
the strings at the start and end of any good script, that code script is commented that 任何好的脚本的开头和结尾的字符串 ，该代码脚本被注释为
we have seen several times earlier as well. So, for example, in problem solving, remember 我们之前也见过几次。因此， 例如，在解决问题时，请记住
that we define all? Oh yeah. So that's the comment. That's a comment. Even if some code 我们定义所有？哦耶。所以这就是 评论。那是评论。即使一些代码
is written inside that will not be executed. Right. Okay, so that's about the multi line 写在里面，不会被执行。对 。好的，这就是关于多行
string. In the next video we will see because because the string really is, is basically 细绳。在下一个视频中，我们将看到 因为字符串确实是，基本上是
a collection of all these characters. What if we want to access a particular character? 所有这些字符的集合。如果我们 想访问一个特定的字符怎么办？
For example, this is the first graduate is d here, the second Gregory is at the third 例如，这是第一个毕业生在这里 是 d，第二个格雷戈里在第三个
correct? Is it the fourth record is S, the fifth Gregory space and all? What if we want 正确的？难道第四条记录是S，第五条格雷戈里 空间等等？如果我们想要怎么办
to access particular characters inside the string? Because the string contains a lot 访问字符串中的特定字符 ？因为字符串包含很多
of directors? What if we want to play with some of the directors inside the string? How 董事？如果我们想和弦内的一些 导演一起演奏怎么办？如何
can we access different directors for example, if we want to access seventh director of the 我们可以访问不同的董事，例如 ，如果我们想访问第七个董事
string, how can we do that? So, let's see in the next video, how can we index different 字符串，我们怎么做？那么，让我们在 下一个视频中看到，我们如何索引不同的
characters inside a string, I hope to see you in the next video. Okay, in this video, 字符串中的字符，我希望在下一个视频 中见到你。好的，在这个视频中，
we are going to actually access different characters inside the string, sometimes called 我们将实际访问字符串 中的不同字符，有时称为
indexing, the term slicing is basically more relevant to arrays, lists are actually the 索引，术语切片基本上与数 组更相关，列表实际上是
immutable structures, but we will see, 不可变的结构，但我们会看到，
I'm just comparing, because you may listen this term slicing again and again, but really 我只是比较一下，因为你可能会一 遍又一遍地听切片这个词，但真的
this indexing but we will see the indexing or slicing sometimes is you these two terms 这个索引但我们有时会看到 索引或切片是你这两个词
are used interchangeably, we will see the examples of slicing in detail in lists. And, 可以互换使用，我们将在列表 中详细查看切片示例。和，
and in more detail in NumPy arrays. But here, you just think that indexing and slicing are 以及更详细的 NumPy 数组。但在这里 ，你只是认为索引和切片是
the same things. index. So for example, I have this a let's say this is a array, and 同样的事情。指数。例如，我有 这个，假设这是一个数组，并且
I want to access its fourth element here, the fourth corrector element is E. By the 我想在这里访问它的第四个元素 ，第四个校正器元素是 E。通过
way, this a is a variable, if I want to access the very first corrector the the indexing 方式，这是一个变量，如果我想 访问索引的第一个校正器
the number, the positioning starts from the integer zero, that's the first corrector. 数字，定位从整数零开始 ，即第一个校正器。
So if I want to print out of it, that will print g if I access for example, if I write 因此，如果我想打印出来，例如，如果 我访问，则会打印 g，如果我写
the index three, what do we mean that means the fourth element, the fourth element is 索引三，我们的意思是什么意思 是第四个元素，第四个元素是
he what will be printed, what will be printed, if I access the fourth element of the index 他将打印什么，将打印什么，如果 我访问索引的第四个元素
for a fi access this thing or space will be printed and you will be seeing nothing because 对于 fi 访问这个东西或空间将被 打印，你将什么也看不到，因为
when a space is printed, actually, nothing colorful is printed there and you might be 当一个空间被打印出来时，实际上，那里 没有打印任何彩色的东西，你可能会
thinking Oh, nothing is printed, nothing, nothing has been accessed, actually a space 想着哦，什么都没有打印出来，什么都没有 ，什么也没有访问过，其实是一个空格
corrector have been accessed. So yeah, a more we can we can we can actually access, we can 校正器已被访问。所以，是的，我们 可以实际访问的更多，我们可以
actually access a substring inside a string as well. For example, we want to access for 实际上也访问字符串内的子字 符串。例如，我们要访问
example, a substring starting from index three, and all the way up to index eight, but does 例如，一个从索引 3 开始一直到 索引 8 的子字符串，但是
not include the index eight. So it will include the corrector at index three, which is he 不包括索引八。所以它将包括索引 三处的校正器，也就是他
correctly at index four, which is space, let me write space in this way. Director at index 正确地在索引四，这是空间， 让我这样写空间。指数总监
five, which is Oh, correct, read index six, next record, which is F, then a space, which 五，哦，对了，读索引六，下一 条记录，是F，然后是空格，
is seven, and then the correct read eight. And so this is not included, to be accessed. 是七，然后正确读八。所以 这不包括在内，可以访问。
This is included, this is inside, this is included. This is not included. So we can 这是包括在内，这是在里面，这是包括 在内。这不包括在内。所以我们可以
access a substring. So starting from three and ending at eight. Let's see, let's see 访问一个子串。所以从三点开始 ，八点结束。来看看吧
an example. And you'll come back to this slide again, after after a few minutes. So let's 一个例子。几分钟后，您将再次回到 这张幻灯片。那么让我们
say we have a spring as let's say, how are you? And who are you? That's it. So let's 说我们有一个春天，让我们说，你好吗 ？你是谁？就是这样。那么让我们
do that. So spring, okay. And what do we really want is we want to access for example, the, 去做。所以春天，好吧。我们真正 想要的是我们想要访问例如，
we want to access the element to access the elements, you have to write the square brackets. 我们要访问元素要访问 元素，就得写方括号。
That's a standard notation. In Python. Whenever you have a collection and you want to access 这是一个标准的符号。在 Python 中 。每当您有收藏并想访问时
different elements, that collection might be a string that collection later on, we will 不同的元素，该集合可能是一 个字符串，该集合稍后，我们将
see might be a list. Maybe a tupple dictionary may be a set. Maybe a NumPy array may be a 看到可能是一个列表。也许元组字典可能是一 个集合。也许一个 NumPy 数组可能是一个
panda's structure, I mean, anything that is a collection, normally it is accessed by It panda 的结构，我的意思是，任何是 集合的东西，通常它都被 It 访问
has different elements, and we want to index them. The indexing division is square brackets. 有不同的元素，我们想要索引 它们。索引划分是方括号。
And indexing always starts from zero rather than one. In Python. There are some languages 索引总是从零而不是一开始 。在 Python 中。有一些语言
in which the indexing starts from one for example, MATLAB, the indexing starts from 其中索引从 1 开始， 例如 MATLAB，索引从
one but in Python and in several other languages. The indexing starts from zero, which has some 一个，但在 Python 和其他几种语言中 。索引从零开始，其中有一些
benefits or starting with one it has some benefits. So starting with zero is okay is 好处或从一个开始它有一些好处 。所以从零开始是可以的
okay. So let's say we want to access element at index five. The element at index five is 好的。因此，假设我们要访问索引 5 处的元素。索引 5 处的元素是
actually the sixth element in the string starting from zero. So first, second, third, fourth, 实际上是字符串中从零开始的第六个元素 。所以第一，第二，第三，第四，
fifth, sixth, so our will be printed. So let's see. Our is printed. Let's check the let's 第五，第六，所以我们的将被打印。所以让我们 看看。我们的打印出来了。让我们检查一下
check the type of this return value. Let's check the type of this this one element which 检查此返回值的类型。让 我们检查这个元素的类型
is our what is the type of it subtype of different elements in a string different characters 是我们的字符串不同字符的不同 元素的子类型是什么类型
in a string? What are the types 在字符串中？有哪些类型
So what is the type of it. So the type is also string. So each and every corrector is 那么它的类型是什么。所以类型也 是字符串。所以每一个校正器都是
also of string type. In some other languages, the type might be a corrector. corrector is 也是字符串类型。在其他一些语言中 ，类型可能是修正器。校正器是
another type, but in, in Python, each and every one character is also a string. More 另一种类型，但在 Python 中，每 个字符也是一个字符串。更多的
than one. correctness is also string, as long as they are accessed from a string. Okay, 比一个。正确性也是字符串，只要它们 是从字符串中访问的。好的，
let's access for example, the element number three to element number, let's say eight. 例如，让我们访问第 3 个 元素到第 8 个元素。
So the result is our so element number three, not three, actually starting from index three, 所以结果是我们的 so 元素编号为三， 而不是三，实际上是从索引三开始，
which means the fourth vector, which is space, and then e, r, e, and then space, and then 这意味着第四个向量，即空间，然后 是 e、r、e，然后是空间，然后是
we finish. if you for example, move to from three to nine, let's say, and the the rally 我们完成了。例如，如果你从三点 移到九点，比方说，然后集会
will be our why or we may move to from for example, we may start from the very beginning. 将是我们的原因，或者我们可能会从 ，例如，我们可能从一开始就开始。
So for example, index zero, we may end at the index 10, but not including the 10. So 例如，索引 0，我们可能会在索引 10 处结束，但不包括 10。所以
the result is, how are you and then I mean, why Oh, and not the you included, because 结果是，你好吗然后我的意思是，为什么 哦，而不是你包括在内，因为
that's index number 10. And index number 10. The last index is not included. Great. We 那是索引号 10。和索引号 10。最后一个 索引不包括在内。伟大的。我们
can have negative indices in strings as well. So a negative index is just just the indexing 字符串中也可以有负索引 。所以负索引只是索引
from the right side, not from the left side, for example, on negative index. So minus one 从右侧，而不是从左侧，例如 ，在负索引上。所以减一
points to the last corrector. For example, you similarly minus two points to the second 指向最后一个校正器。例如， 你同样减去两个点到第二个
last corrector, and so on. So minus one, that's a success, you. And similarly, we have minus 最后一个校正器，依此类推。所以减去一个 ，那就是成功了，你。同样，我们有负
three, and that will access why, or we may have start from let's say, minus, start from 三，这将访问为什么，或者我们 可能从假设开始，减去，从
let's say, minus eight, and go till minus three, that means go back to go back to minus 比方说，减八，直到减 三，这意味着回到减负
eight index, and then move to minus three index, okay? And minus three. In this case, 八指数，然后移动到减三指数， 好吗？和减三。在这种情况下，
let's see what was the result are, what is that? Why are? Oh, this are, I guess this 让我们看看结果是什么，那是什么？ 为什么是？哦，这是，我猜是这个
are? Let's check it out. So this is this, you, this is minus one minus two minus three, 是？让我们来看看。所以这是 这个，你，这是减一减二减三，
that's an X number three. So three is not included. minus three is not included. So 那是一个 X 数字三。所以不包括 三个。不包括负三。所以
it has to stop here. Okay. That's minus four minus five minus six, minus seven and minus 它必须停在这里。好的。那是 减四减五减六，减七加减
eight. Oh, great. So that should be printed, it has printed. So let's say we have rather 八。哦，太好了。所以应该打印，它 已经打印了。所以让我们说我们有
than minus eight, we start from minus 12, and be raised to minus three. So we're okay. 比负八，我们从负12开始， 升到负三。所以我们没事。
Great. So we have negative indices as well. And by the way, this kind of fetching this 伟大的。所以我们也有负指数。 顺便说一句，这种获取这个
kind of substring is sometimes called slicing, I mean, we are just fetching the slicing, 一种子串有时称为切片，我的意思 是，我们只是获取切片，
although the term slicing is much more popular in, in in mutable data structures. What What 尽管术语切片在可变数据结构 中更受欢迎。什么什么
is a mutable data structure? What is an immutable data structure? Well, yeah, I should tell 是可变数据结构吗？什么是不可变数据 结构？嗯，是的，我应该告诉
you right now, you can change, you can not change any corrector in the spring. That might, 你现在，你可以改变，你不能改变 春天的任何校正器。那可能，
that might look like a bad news for you. But once the spring is created, the elements in 这对你来说可能是个坏消息。但是 一旦创建了弹簧，其中的元素
the strings are not changeable. So for example, let's say at position number one, you want 字符串是不可更改的。例如， 假设在第一位置，您想要
to place a corrector. Let's see, that's not possible. And the reason is, the string is 放置校正器。让我们看看，这是 不可能的。原因是，字符串是
a data structure, the string is a variable type a data type that is immutable, immutable, 一个数据结构，字符串是一个变量类型 一个数据类型是不可变的，不可变的，
are unchangeable. Once created, you cannot change its contents, they stay fixed, you 是不变的。一旦创建，你就不能改变 它的内容，它们保持固定，你
cannot change them, you cannot alter them, you you cannot delete certain contents from 不能改变它们，你不能改变它们 ，你不能从中删除某些内容
it. I mean, once created, it stays as it is, you can copy this into another string, you 它。我的意思是，一旦创建，它就保持原样 ，您可以将其复制到另一个字符串中，您
can copy and paste, but you can get a substring and copy into another variable, for example, 可以复制和粘贴，但您可以获取子字符串并 复制到另一个变量中，例如，
but the contents of s cannot be changed. 但 s 的内容不能改变。
So all the kinds of data types in Python that are unchangeable, the contents are not changeable. 所以Python中所有的数据类型都是 不可改变的，内容是不可改变的。
They're called immutable. And string is immutable. So so the the time slicing makes much more 它们被称为不可变的。而字符串是不可变 的。所以时间切片会产生更多
I mean sense or it is more popular in the data structures that are mutable, that are 我的意思是说它在可变数据 结构中更受欢迎，即
mutable, although, you can use time slicing indexing both interchangeably. But it refers 虽然可变，但您可以交替使用 时间切片索引。但它指的是
to roughly in reference to fetching the sub structure or substring. In this case, in the 大致参考获取子结构或子字 符串。在这种情况下，在
list, it will be a sub list or so on. So that's what slicing is. Yeah. Great. Why don't we 列表，它将是一个子列表等等。所以这就是 切片。是的。伟大的。我们为什么不
do some more fun with this spring? 今年春天多一些乐趣？
Yeah, 是的，
let me show you more fun with this rank, more indexing, let's say you start at index zero, 让我向您展示这个排名的更多乐趣， 更多索引，假设您从索引零开始，
you go to index 12, but not including 12. And then you jump, you take a jump of two 你转到索引 12，但不包括 12。然后你跳，你跳了 2
rather than one, what we'll do is, it will fetch all the corrector starting from index 而不是一个，我们要做的是，它 将从索引开始获取所有校正器
zero, all the way to index 12, but not including 12. But it will take a jump of two rather 零，一直到索引 12，但不包括 12。但它会跳两个而不是
than taking the jump of two. So first greater than take a jump of two, then pick a corrector, 而不是跳两个。所以首先大于两 次跳跃，然后选择一个校正器，
then take a jump of two and then pick a corrector. So it will actually pick every other characters 然后跳两个，然后选择一个校正器。 所以它实际上会选择所有其他字符
starting from zero. So let's see that. So for example, if you remember the string, that's 从零开始。所以让我们看看。例如 ，如果你记得字符串，那就是
the string. So it starts from h Fine, then it skips Oh, and go to W, then it skips bass 字符串。所以它从 h Fine 开始，然后 跳过 Oh，然后转到 W，然后跳过 Bass
and go to a then it skips R and go to E then a skip space and go to u and then it skips 然后转到 a 然后它跳过 R 转到 E 然后 跳过空格然后转到 u 然后它跳过
Oh, and go to a shoe and then the cloud achieved and we stop there. Wow. So the general way 哦，然后去一个鞋子，然后云实现，我们 就停在那里。哇。所以一般方式
of slicing or indexing the general way is you have a starting next start, then you have 切片或索引的一般方式是你有 一个开始下一个开始，然后你有
an index and then you have a step size. If you do not mention the step size. the step 一个索引，然后你有一个步长 。如果不提步长。步骤
size by default is one that we were doing already. If you do not mention the end, the 默认情况下，大小是我们已经 在做的。如果不提结局，
default end is the building and the total list size. If you do not mention the start 默认结束是建筑物和总列表 大小。如果不提开始
the default start is zero. For example, let me make that a comment and just practice a 默认开始为零。例如，让我做 一个评论，然后练习一个
few for example. Let's start from zero we do not mention the start let's start from 例如很少。让我们从零开始 我们不提开始让我们从
zero and go to 12 if you do not mention the starting index that starts from the very beginning 如果不提及从头开始的起始索引 ，则为零并转到 12
zero go till 12 Okay great. If we do not mention For example, we start from three and we do 零到 12 点 好的。如果我们不提例如 ，我们从三个开始，我们做
not mention the end that means go till the end starting from index three including the 没有提到结束，这意味着从 索引三开始直到结束，包括
last corrector Okay, if we do not mention the step for example, if you start from one 最后一个校正器 好的，如果我们不 提及步骤，例如，如果您从一个开始
go till 12 and we do not mention the step, the default step is one okay. There is one 一直到12，我们没有提到步骤 ，默认步骤是1。有一个
way of reversing the string, I mean very beautiful way I mean, you do not you do not start the 扭转弦的方式，我的意思是非常漂亮的 方式我的意思是，你不你不开始
mention and you do not mention the start, you do not mention the end, and then just 提你不提开始，不提 结束，然后就
take a step of minus one in this particular way. The Start and End index they are they 以这种特殊的方式采取减一的步骤 。开始和结束索引他们是他们
are just swept and you get the string reversed way. While so that's the reverse great. Isn't 只是被扫过，你就可以反转字符串了。 虽然如此，但反过来很棒。是不是
that fancy? Yes, it is. Okay, a lot about indexing, you can find out the length of any 这么花哨？是的。好的，关于索引 的很多，你可以找出任何长度
string by using l m function, you can find out the length of any substring if you want string 通过使用 l m 函数，您可以根据 需要找出任何子字符串的长度
to if you have a substring using again a lamp function, alien, that's okay. Okay, and now 如果你有一个子串再次使用灯功能， 外星人，那没关系。好的，现在
you've seen how to access sub strings and how we cannot change the elements of a string 您已经了解了如何访问子字符串以及 我们如何无法更改字符串的元素
because it is immutable, but we can access them, we can access them, we can just display 因为它是不可变的，但是我们可以访问它们 ，我们可以访问它们，我们可以只显示
them, we can analyze them and so on. In the next video, we will see some functions that 他们，我们可以分析他们等等。在下 一个视频中，我们将看到一些功能
are supplied for string processing, what we can do with strings, I mean how can we manipulate 提供用于字符串处理，我们可以用字符串 做什么，我的意思是我们如何操作
those strings, although we cannot manipulate the contents of a string, but we may copy 那些字符串，虽然我们不能操作字符串 的内容，但是我们可以复制
a string we may get explained, manipulate it and save it to another variable and how 一个我们可能会得到解释的字符串，对其进行 操作并将其保存到另一个变量中以及如何
what kind of functions that are available in string in string data structure string 字符串数据结构字符串 中有哪些可用的函数
data type. So let's see that in the next video. Hope to see you in the next video. Okay, let's 数据类型。让我们在下一个视频中看到这一点。 希望在下一个视频中见到你。好的，让我们
see different functions that are available to play with the strings. In this dense string 查看可用于演奏弦乐的不同 函数。在这密密麻麻的弦里
data structure, let's say you have the string a a lot of spaces, these are a lot of spaces 数据结构，假设你有很多空格 的字符串，这些是很多空格
at the beginning and these are a lot of spaces at the end there are some spaces in the middle 开头和结尾有很多空格 ，中间有一些空格
as well. So, there is one function called strip all the functions of the string they 以及。所以，有一个函数叫做 strip所有字符串的函数
are called by taking a dot A dot something These are called methods you can loosely call 通过取一个点来调用一个点的东西 这些被称为方法，你可以松散地调用
them functions, but those kind of functions that are related to some data structure and 它们是函数，但是那些 与某些数据结构和
called with dot, they are sometimes called methods. The term method is more related to 用点调用，它们有时被 称为方法。术语方法与
object oriented programming actually string is a class. So all these are the methods But 面向对象编程实际上字符串是一个 类。所以所有这些都是方法 但是
even without knowing that it's perfectly okay, you can call it method or function that's 即使不知道它完全没问题，你 也可以称它为方法或函数
perfectly okay. You can, I mean, it's okay. It's okay without knowing what a class is 完全没问题。你可以，我的意思是，没 关系。不知道什么是班级也没关系
without knowing what an object oriented programming is, this a dot some function that operates 在不知道面向对象编程是什么的情况 下，这是一个运行的函数
on this a. 就这一个。
One difference with method and function is when you call a function with a dot, and you 方法和函数的一个区别是当你 用一个点调用一个函数时，你
call some function that say, a dot strip. Then inside the definition of the function, 调用一些函数，比如点条。 然后在函数的定义里面，
this a object or the a variable is available, like, like you have passed that variable as this a object 或 a 变量可用， 就像您已将该变量传递为
an input argument. That's all you need to know about the difference of matter and function, 一个输入参数。这就是您需要了解 的物质和功能区别的全部内容，
the rest of the story is perfectly okay. Even if you don't know that that's fine. Okay, 故事的其余部分完全没问题。即使 你不知道那也没关系。好的，
eight outstrip, it operates on a which means that a is passed in this function as just 8 outstrip，它对 a 进行操作，这意味 着 a 在此函数中作为刚刚传递
as input argument or it is available there inside the function implementation. And then 作为输入参数或者它在 函数实现中可用。进而
the script function, what it does is it removes all the spaces that are in the beginning, 脚本函数，它的作用是删除 开头的所有空格，
and removes all the spaces that are at the end, and returns another string that has that 并删除末尾的所有空格，并返回 另一个具有该空格的字符串
has no spaces at the beginning and no spaces at the end, and the new string is copied or 开头没有空格，结尾没有空格 ，复制新的字符串或者
created in a variable b, let's say whatever that we believe we can, we can have another 在变量 b 中创建，让我们说我们相信 我们能做到的，我们可以有另一个
name of that variable. So let's see. Let's see the running form of this script function 该变量的名称。所以让我们看看。 来看看这个脚本函数的运行形式
in our friend Jupyter. notebook. So let's say a is a string variable. That's a lot of 在我们的朋友 Jupyter 中。笔记本。所以 假设 a 是一个字符串变量。这是很多
spaces abcdef, a lot of spaces and hg gilwell, whatever. And then a lot of space, and that's 空格 abcdef，很多空格和 hg gilwell， 等等。然后有很多空间，那就是
it, this is a and then we have B, let's say a dot strip. Okay, and that's sprint B. So 它，这是一个，然后我们有 B，比方说一 个点带。好的，这就是冲刺 B。所以
b is actually everything without spaces without the starting spaces. And without ending spaces, b 实际上是没有空格的所有内容，没有 起始空格。没有结尾的空格，
it does not hurt the spaces inside. So that's the script function, sometimes processing 它不会伤害里面的空间。所以这 就是脚本函数，有时处理
the data. When we when we read the data from a file, it may have a lot of spaces at the 数据。当我们从一个文件中读取 数据时，它可能有很多空格
beginning at the end, maybe due to formatting issues or something like so and it is this 从最后开始，可能是由于格式问题 或类似的问题，就是这样
function is available. If we want to remove those spaces from beginning or from the end. 功能可用。如果我们想从开头 或结尾删除这些空格。
Let's see more functions. Another function is lower, like the name suggests it actually 让我们看看更多的功能。另一 个功能较低，顾名思义实际上
it actually converts all the string to lowercase. For example, let's say we have a string, let's 它实际上将所有字符串转换为小写。例如 ，假设我们有一个字符串，让我们
say, a B, A, let's say we have a string, a equals A, B, C, D, E, F, G, and some directors, 比如说，a B，A，假设我们有一个字符串 ，a 等于 A、B、C、D、E、F、G 和一些导演，
some other directors and Q f, let's say that's a string. And now what we do is b equals a 其他一些导演和 Q f，让我们说这是一个 字符串。现在我们所做的是 b 等于 a
dot lower. What it does is it converts all the string to lowercase. For the characters 点更低。它的作用是将所有字符串 转换为小写。对于字符
that are already in lowercase. It doesn't hurt it. For the characters that has nothing 已经是小写的。它不会伤害 它。对于一无所有的角色
to do with lower uppercase, it doesn't hurt that all the characters that are not in the 与小写大写有关 ，所有不在
lowercase and can be converted to lowercase, those are converted to lowercase. And this 小写和可以转换为小写，那些 转换为小写。和这个
is available. Yeah. Great. So similarly, we have another function called upper for example, 可用。是的。伟大的。类似地，我们 有另一个名为 upper 的函数，例如，
C is equal to a dot upper that the like the name suggests, it converts all the characters C 等于一个点上，顾名思义 ，它转换所有字符
to uppercase. Well, let's see more functions. Oh, there is a function replace the Replace 大写。好吧，让我们看看更多的功能 。哦，有一个功能替换替换
function. What it does is it takes a substring and replaces that substring with another substring. 功能。它的作用是获取一个子字符串 并用另一个子字符串替换该子字符串。
Okay, let's see. For example, let's say we here we want to be have the same a, let's 好吧，让我们看看。例如，假设我们在 这里我们想要拥有相同的 a，让我们
say the a is this thing. Let's say that's a and what do we want to do is we want to 说一个就是这个东西。假设这是 一个我们想要做的就是我们想要
replace the semi colons let's say with with with the semicolon, we want to replace the 用分号替换分号让我们说 用分号，我们要替换
semi colons with statics. So what we can do is we can say okay, d equals a dot replace, 带静力学的分号。所以我们能做的就是 我们可以说好的，d 等于一个点替换，
replace the semi colon with with let's say steric. Or, yeah, so let's see what D is. 用空间代替分号。或者，是的 ，让我们看看 D 是什么。
So each semicolon is replaced by a steric. By the way, if you if you want to replace 所以每个分号都被一个空间取代 。顺便说一句，如果你想更换
for example, a, a dark replace, if you want to replace one is there one semi colon One 例如，一个，一个暗替换，如果你 要替换一个是有一个分号一个
semicolon with a string. For example, the string is star star, and, and hashtag or some 带字符串的分号。例如字符串 是star star, and, and hashtag or some
person. That means one semicolon will be replaced by this, seek with this string, and the other 人。这意味着一个分号将被这个替换 ，用这个字符串查找，另一个
semicolon will also be replaced by this screen. And the result will be as expected, each semicolon 分号也将被这个屏幕取代。结果 将如预期的那样，每个分号
will be replaced by the screen. And that's the result what it is further if you want, 将被屏幕取代。这就是结果， 如果你愿意，它会更进一步，
for example, if you want, for example, let's say d equals a dot replace, if you want this 例如，如果你想要，例如，假设 d 等于 一个点替换，如果你想要这个
particular substring, that contains the two semi colons, if you want the two semi colons 特定的子字符串，包含两个 分号，如果你想要两个分号
to be replaced by another substring, let's say two semi colons, let's say. And that is 要被另一个子字符串替换，假设 两个分号，假设。那就是
also possible I mean, you, you replace one substring with another one. Right? There is 也可能我的意思是，你用另一个子字 符串替换一个子字符串。对？有
one more function called split. That what it does what what the split does is, for example, 还有一个函数叫做 split。例如， 它所做的事情就是分裂所做的事情，
you have a string, for example, let's say a equals a string, let's say, ABC, then you 你有一个字符串，例如，假设 a 等于 一个字符串，假设，ABC，那么你
have this colon, then you have d f, then you have semi colon, then you have ads g y, there's 有这个冒号，然后你有 df，然后你 有分号，然后你有广告 g y，还有
Dan semi colon, then you have y y 3223. That's it. That's your string. Let's say you read 丹分号，然后你有 y y 3223。就是这样 。那是你的字符串。假设你读了
that string from some CSV file and disappears. And now what you want, you want all these 来自某个 CSV 文件的那个字符串消失了。 现在你想要什么，你想要所有这些
values to be separated out that are that that are separated by the semicolon, maybe these 要分离的值是由分号分隔 的值，也许这些
are different values, ABC is a different value, then it is separated by a semicolon semicolon 是不同的值，ABC是不同的值 ，然后用分号分号隔开
may be an indication or token that the next value started and so on. Let's say you want 可能是下一个值开始的指示或 标记，依此类推。假设你想要
to separate them, let's say you want to just split them all of them with a particular splitter. 要将它们分开，假设您只想使用 特定的拆分器将它们全部拆分。
And here, let's say the splitter is semi colon. So what you can do is you can have a list 在这里，假设分隔符是分号。所以你 可以做的是你可以有一个列表
and a dot split. And in the split, you can specify the corrector that that is used for 和一个点分裂。在拆分中， 您可以指定用于的校正器
splitting after and before we split that. And remember, the split function actually 在我们拆分之前和之后拆分 。记住， split 函数实际上
returns a list of strings, where this is the first element of the list, this is the second 返回一个字符串列表，其中这是 列表的第一个元素，这是第二个
element of the list, this is the third element of the list, this is the fourth element of 列表的元素，这是列表的第三个元素 ，这是列表的第四个元素
the list and so on. Because once you will split, you will be having different elements 名单等等。因为一旦分开 ，就会有不同的元素
that are split it out. So if your brand for example, l we will be having a list of different 那是分裂出来的。因此，例如， 如果您的品牌，我们将列出不同的
strengths, ABC and all that, Oh, don't worry about the single code, the single core and 优势，ABC等等，哦，不用担心 单一的代码，单一的核心和
double core is the same thing. Now we can access for example, the third element or or 双核是一回事。现在我们可以 访问例如第三个元素或
maybe the second element by index one. And the second element here is D, E, F, and we 也许是索引一的第二个元素。这里 的第二个元素是 D、E、F，我们
can work more on that. Okay. Is that it? I mean? Are these the only functions that are 可以在这方面做更多工作。好的。是这样 吗？我的意思是？这些是唯一的功能吗
available? stripped function lower a birthplace and split function? Or is that it? That's 可用的？剥离函数降低出生地和分裂 函数？或者就是这样？那是
all the spring is about? Maybe there are more functions? How many functions are there in 所有的春天是什么？也许还有更 多功能？里面有多少个函数
string? How can we use them? What are the what are the total number of functions? Where 细绳？我们如何使用它们 ？函数总数是多少？在哪里
is the list? We visit documentation? Should should we follow some book? Should we go to 是名单吗？大家访问文档？我们 应该遵循一些书吗？我们应该去
some tutorial and find all the string functions and see how to use them? Well, if you want 一些教程并找到所有字符串函数并查看 如何使用它们？好吧，如果你愿意
to do that, you can do that. But there is another smart way. Let's say a is a string 要做到这一点，你可以做到这一点。但还有 另一种聪明的方法。假设 a 是一个字符串
that you know, you write a dot and then a press tab, and all the things that that are 你知道，你写一个点，然后一 个按标签，以及所有的东西
there in in string, they will they will appear in front of you on several things. You can 在字符串中，他们会在几件事情 上出现在你面前。你可以
go to this, you can go to that you can go to that and so on. So just you can check the 去这个，你可以去那个，你可以 去那个等等。所以你可以检查
documentation of a for example, if you if you press a and what it does, let's see. It's 例如，如果您按 a 及其作用 ，让我们看看 a 的文档。它是
a string object and all that stuff. Fine. It's a string. So further what we can do. 一个字符串对象和所有这些东西。美好的。这是 一个字符串。因此，我们可以做进一步的事情。
So let's say a.we, press A and then we press tab. Is there anything that starts from a 因此，让我们说 a.we，按 A，然后按 Tab。 有没有什么东西是从a开始的
Nope? Is there anything that starts from B? No. Is there anything that starts from C? 不？有没有从B开始的东西？没有 。有没有从 C 开始的东西？
Yes, capitalize case fold center count. These are the functions that are available that 是的，大写案例折叠中心计数 。这些是可用的功能
starts from C. 从 C 开始。
Okay, let's focus on capitalized. Okay, what is that thing how to use it? That's press 好的，让我们专注于大写。好吧，那 是什么东西怎么用呢？那是按
colon, question mark and see what this is and what it does. Okay, so here is the documentation 冒号，问号，看看这是什么 以及它做什么。好的，这是文档
here is a doc string returns capital. I used to worry enough the string capitalized version 这是一个返回大写的文档字符串 。我曾经担心字符串大写版本
of the string. Is that the same as upper? Maybe? So let's see. Now we know what it does. 的字符串。和上层一样吗？也许？所以 让我们看看。现在我们知道它的作用了。
Let's just check it out, print a capitalized and see what's the result? Oh, it's got Oh 让我们检查一下，打印一个大写， 看看结果是什么？哦，它有哦
no, it does not get delays the whole screen, does it? Did they the screen a was it does 不，它不会延迟整个屏幕， 是吗？他们有屏幕吗？
not capitalize the whole string? What What is a? Let's see what is a? A is the following 不将整个字符串大写？什么是什么 ？让我们看看什么是？ A 如下
string is the following string, so it does not capitalize the whole string. Oh, the difference string 是以下字符串，因此它不 会将整个字符串大写。哦，区别
between the capitalized maybe? And the upper? Is that the capitalize when it encounters 大写之间也许？而上层呢 ？遇到的时候是大写吗
when it encounters? No, no, no capitalized just capitalizes the first corrector. Let 当它遇到？不，不，不大写只 是大写第一个校正器。让
me let me read the doc string, again, returns a capitalized version of the string, more 我让我再次阅读文档字符串，返回 字符串的大写版本，更多
specifically make the first corrector have uppercase and the rest lowercase. Okay, that 专门使第一个校正器大写 ，其余小写。好的，那个
means if we have a string that has a mix of values, the capitalized will do the following. 意味着如果我们有一个混合值的字符串 ，大写的将执行以下操作。
It will convert the first character to uppercase and all the rest of the characters the lowercase. 它会将第一个字符转换为大写， 并将所有其余字符转换为小写。
Wow, that's awesome function. For example, if you have string, abs D, A, B and GG, kill 哇，好厉害的功能。例如，如果您 有字符串、abs D、A、B 和 GG，请杀死
that say. And then we call capitalize, capitalize, let's say. So what that does is it actually 那说。然后我们称之为大写，大写，让我们 说。那么它实际上是做什么的
capitalizes the first director and all the rest of the directors there as it is. And 将第一任董事和所有其他 董事按原样大写。和
there are other functions as well, a dot A dot, let's see count, what it does a dot count 还有其他功能，一个点一个点， 让我们看看计数，它是做什么的
what it does not count. What is that thing? Let's check it out. Or maybe we can check 什么不算。那个东西是什么？让我们 来看看。或者我们可以检查
that out using help. What is zero count? So let's see what is a load count. It's a built 使用帮助。什么是零计数？那么让我们 看看什么是负载计数。这是一个建
in function called matters is an instance of and it returns a number of non overlapping 在称为事物的函数中是一个 实例，它返回一些不重叠的
occurrences of a substring. Sub in Oh my God, if you I mean, that's what it what what is 子串的出现。哦，我的上帝，如果 你是我的意思，那就是它是什么
written there, non overlapping apprentice of a substring. Great Oh my god. So basically, 写在那里，子串的非重叠学徒 。厉害了我的天。所以基本上，
there are there are a whole lot of functions of strings that are available, there are several 有很多可用的字符 串函数，有几个
use of the string, there are several ways of molding and playing with the strings, some 琴弦的使用，有几种方法 可以塑造和演奏琴弦，有些
of the functions that are available, some you can make your own, you can make your own 在可用的功能中，有些您可以 自己制作，您可以自己制作
modules on top of that, to customize your written to customize according to your requirements. 在此之上的模块，可以根据 您的要求定制您的编写。
A lot of these are available, and you should know how to use them. And first thing if you 其中有很多可用，您应该知道 如何使用它们。首先，如果你
want to do something with strings, or with any data type in Python, first check whether 想对字符串或 Python 中的任何数据 类型做一些事情，首先检查是否
some method is available or not. And one way to go that is just right away from here. And 某些方法是否可用。一种方法 就在离这里不远的地方。和
other ways to go to internet and see I want to do this in Python. with strings, whether 其他上网方式，看看我想用 Python 来做这件事。带字符串，是否
there is a function available or not the good chances are there will be a built in function 是否有可用的功能 很 有可能会有内置功能
that is available. And in that case, I will encourage to use that function rather than 这是可用的。在这种情况下， 我会鼓励使用该功能而不是
to write your own one because using the built in function, or the method that is tied up 自己写一个，因为使用内置函数 ，或者绑定的方法
there will be much more faster probably than the function you will be writing at your end 可能会比你最后编写 的函数快得多
even if you're too smart in algorithms. So yeah, 即使你在算法方面太聪明了。是的 ，
so that's about the spring matters, there are so many other methods that are available. 所以这就是弹簧问题，还 有很多其他方法可用。
In the next video, we will see some more some more manipulation and processing and some 在下一个视频中，我们将看到更多一些 更多的操作和处理以及一些
more working with strings. And then we will move to other data structures. Okay, hope 更多地使用字符串。然后我们将转向 其他数据结构。好的，希望
to see you in the next video. In the last video, we saw some methods of string. And 下个视频见。在上一个视频中，我们 看到了一些字符串的方法。和
these are just a few of them, a lot of them are available. We just we just discussed some 这些只是其中的一小部分，很多都 是可用的。我们只是讨论了一些
of them. In this video we are going to talk more about strings in a particular way. For 其中。在本视频中，我们将以特定 的方式更多地讨论字符串。为了
example, what if you want to find out whether a particular substring is there in a string 例如，如果您想找出字符串中是否 存在特定子字符串，该怎么办
or not. Let's say you have a string and you want to know whether a particular substring 或不。假设您有一个字符串并且 您想知道某个特定的子字符串
is there inside a string or not? Well, you can easily find out that using the end keyword. 字符串里面有没有？好吧，您 可以使用 end 关键字轻松找到。
And similarly not in means the reverse of that, or the complement of that or not of 同样不是 in 意思是那个的相反 ，或者那个的补充或者不是
that. And in keyword always will return either true or Boolean or false. If it is inside 那。而 in 关键字 always 将返回 true 或 Boolean 或 false。如果在里面
the screen, it will return true if it is not inside it will return false. So let's check 屏幕，如果它不在里面，它将返回true， 它将返回false。所以让我们检查一下
this the implementation of that in, in, in Jupyter Notebook. So let's see. So let's say 这是在，在，在 Jupyter Notebook 中的实现 。所以让我们看看。所以让我们说
we have a string ABC ABC. And we want to check whether this string is there in this particular 我们有一个字符串 ABC ABC。我们想检查 这个字符串是否存在于这个特定的
string or not. So the return value is false because ABC as a substring is no longer there. 字符串与否。所以返回值是假的， 因为 ABC 作为子字符串不再存在。
A is there. For example, here, a B is here, but ABC is no longer there. Yeah, so if we, A在那里。例如，在这里，B 在这里，但 ABC 不再存在。是的，所以如果我们，
for example, have an ABC somewhere, at least once, then the result will be true. In the 例如，在某处有一个 ABC，至少一次 ，那么结果就是真的。在里面
last, in the last video, or maybe in the very first video for strengths, I showed you that 最后，在最后一个视频中，或者在第一 个关于优势的视频中，我向你展示了
you can use plus with strings, can you compare two strings using less than or equal to? I 您可以将加号与字符串一起使用，您可以使用 小于或等于来比较两个字符串吗？一世
mean, how to compare two strings, whether they are same or not, for example, ABC, that's 意思是，如何比较两个字符串，不管 它们是否相同，例如，ABC，就是
a that's a string ABC, I want to check whether that string is the same as ABC or not, what a 那是一个字符串 ABC，我想检查该 字符串是否与 ABC 相同，是什么
will be the result? So so so the question is, is this double equal to is used can be 会是结果吗？所以问题是，这个 double 等于 is used 可以是
used for comparing two strings? Well, the answer is yes. Or what will be the meaning 用于比较两个字符串？嗯，答案 是肯定的。或者是什么意思
of less than a string as less than the other? Is that true? For example, ABC, is less than, 小于一个字符串作为小于另一个 ？真的吗？例如，ABC，小于，
let's say d f. Is that true? If it is true, for example, what does it really mean? How 让我们说 df。真的吗？例如，如果它是 真的，它的真正含义是什么？如何
can we define one string is I mean, this string is less so than the other string, maybe this, 我们可以定义一个字符串吗？我的意思是，这 个字符串比另一个字符串少，也许这个，
maybe this operator is working based on the length of the strings. But if even if that, 也许这个运算符是根据字符串 的长度工作的。但即便如此，
then this length is the same as this length. And to be more precise, we can change that 那么这个长度和这个长度是一样的 。更准确地说，我们可以改变它
length, for example, by just saying, okay, ABC, D, F, G, H, I, and I guess this string 长度，例如，只是说，好吧，ABC，D，F，G，H，I， 我猜这个字符串
will be still smaller than the right string. So how this comparison is working? Well, I 仍会小于正确的字符串。那么这种 比较是如何运作的呢？嗯，我
guess the comparison is working based on the based on the alphabetic order, and you know, 猜测比较是根据字母顺序 进行的，你知道，
the alphabetic order, a B comes first and B and C and all the alphabetic order that 字母顺序，B 在前，B 和 C 以及所有字母顺序
is there in English dictionaries. That's how the strings are working here. And the alphabetic 英文词典里有没有。这就是字符串 在这里的工作方式。和字母表
orders for all the special characters will also be defined in Python, for example, that's 所有特殊字符的顺序也将 在 Python 中定义，例如，
a special graduate, for example, maybe this string is this string smaller than the following 一个特殊的毕业生，例如，也许 这个字符串比下面这个字符串小
string. Yeah, we've done for false, because there is particular ordering. In, in Python 细绳。是的，我们已经为 false 做了， 因为有特定的排序。在，在 Python 中
that is defined for these characters that this becomes first and there's like, a becomes 这是为这些字符定义的，这 成为第一个，就像，一个变成
first and B, B becomes first and C and so on. So whatever the alphabetic order is, based 第一个和B，B变成第一个和C，依此类 推。所以无论字母顺序是什么，基于
on that, or you can compare the two strings, no problem. So these are also available. And 或者你可以比较两个字符串，没 问题。所以这些也是可用的。和
the third thing is in function that is also available to check whether a particular string 第三件事是在函数中也 可用于检查特定字符串
is inside a substring is inside or not to in another string. One more thing that I want is inside a substring 是否在另一个 字符串中。我想要的另一件事
to talk about in that, for example, what if your goal is to print the following, let's 例如，如果你的目标是打印 以下内容，让我们来谈谈
say let's say you want to print the following, we are learning. And let's say you want to 假设您要打印以下内容，我们 正在学习。假设你想
print the string in double quotes. We are learning string here. Let's say you want to 用双引号打印字符串。我们在 这里学习字符串。假设你想
print this, you want this string to appear in double quote, how can you do that in Python? 打印这个，你想让这个字符串出现在双引号 中，你怎么能在 Python 中做到这一点？
Well, it looks like same. What's the difficulty? Let's Let's call the print function. And then 嗯，看起来是一样的。有什么困难 ？让我们调用打印函数。进而
just like here, we are learning. Then write the double quote here, scraping. And here. 就像在这里一样，我们正在学习。然后 在这里写双引号，刮。和这里。
That's it. But there is a problem. The reason is, the reason is when we call this, when 就是这样。但有一个问题。原因是 ，原因是当我们调用它时，当
we write this double code, actually, the string ends here, exactly the string ends here. And 我们写这个双重代码，实际上，字符串到这里 结束，正好字符串到这里结束。和
when we write this single code, and this double code, another string starts here. And this 当我们编写这个单一代码和这个双重代码时 ，另一个字符串从这里开始。和这个
is no longer a string. I mean, what it has no data type inside. Well, how can we then 不再是一个字符串。我的意思是，它 里面没有数据类型。那我们怎么能
insert these double quotes inside? Well, there are several ways. One way is to use escape 在里面插入这些双引号？嗯，有几 种方法。一种方法是使用转义
sequence and escape sequences just like it is you use a slash and then whatever you use 序列和转义序列就像你使用 斜杠然后使用任何东西一样
is considered as a corrector. Inside the string that is you're using it now if you want another 被视为校正器。如果你想要另一个 ，在你现在正在使用的字符串中
double quote, you use a user corrector which is the backslash or maybe a forward slash 双引号，您使用用户校正器 ，它是反斜杠或正斜杠
and if you use that That means that means whatever that is coming in front of it should 如果你使用它 那意味着 它面前的任何东西都应该
be used as it is, rather than, rather than considering that that's a special string defining 按原样使用，而不是考虑 这是一个特殊的字符串定义
symbol. Now in this particular case, you'll be having your double quotes available, and 象征。现在在这种特殊情况 下，您将获得双引号，并且
the backslash will be just out, it's justifying that don't touch this double code, it has 反斜杠刚刚出来，这是有道理的， 不要碰这个双重代码，它有
nothing to do with defining a string. It is just because I want to highlight this word. 与定义字符串无关。只是 因为我想突出这个词。
Another more. Another more easy way is to use the single quotes, for example, we are 还有一个。另一种更简单的方法 是使用单引号，例如，我们是
learning and use the double quotes as a corrector. Inside that now the single quote, wherever 学习并使用双引号作为校正器。现在 里面的单引号，无论在哪里
it starts and ends, they defined the string, everything else is correct. We do not need 它开始和结束，他们定义了字符串， 其他一切都是正确的。我们不需要
a escape cracker where we where we want, okay, great. But there are a lot of escape characters, 一个逃生饼干，我们想去哪里，好吧 ，太棒了。但是有很多转义字符，
for example, we have V, our backslash n, that means go to new line, we are now on an other 例如，我们有 V，我们的反斜杠 n，这意味 着转到新行，我们现在在另一个
line. So this backslash n actually puts everything that comes after to a new line. That's an 线。所以这个反斜杠 n 实际上把后面的所有内容 都放到了一个新行中。那是一个
escape corrector. Similarly, we have an escape corrector, backslash D, that actually inserts 逃脱修正器。类似地，我们有一个转义校正器 ，反斜杠 D，它实际上插入
a tab. Whenever we want Sophie, then a tab then now on another line, now on another tab, 一个选项卡。每当我们想要 Sophie 时，然后一个选项 卡，然后现在在另一行，现在在另一个选项卡上，
whatever. So there are a lot of escape characters. I'm in backslash, N, backslash t there are 任何。所以有很多转义字符。我 在反斜杠，N，反斜杠 t 有
other. So it is good to know those. One more thing that is important. For example, let's 其他。所以知道这些是很好的。还 有一件事很重要。例如，让我们
say you want to print. Let's say you want to print some address on the right, let's 说你想打印。假设你想在右边 打印一些地址，让我们
see, Mac's slash back slash forward slash whatever that is called name, backslash Dr. 看，Mac 的斜杠反斜杠正斜杠不管 叫什么名字，反斜杠博士。
Let's say you want to do that. And your goal was to just print that box, what will happen 假设您想这样做。你的目标只 是打印那个盒子，会发生什么
is this backslash n will be treated as a newline escape sequence. And backslash n will tell 这个反斜杠 n 将被视为换行符转义序列 。反斜杠 n 会告诉你
Okay, go to the next line and create the rest of the things. But because backslash D is 好的，转到下一行并创建其余的 东西。但是因为反斜杠 D 是
not any escape sequence, it is not listed inside, it is treated as it is and that way 不是任何转义序列，它没有 列在里面，它被按原样对待
this slash is also treated as a director. But here because if this slash followed by 这个斜线也被视为导演。但在这里 因为如果这个斜线后面跟着
this n, that's combination that is already there for a new line that is treated in a 这个 n，这是一个已经存在的组合 ，用于在一个新行中处理
different way. If you want this to be used as a deus and you don't want these, you don't 不同的方法。如果您希望将其用作 deus 而您不想要这些，则不要
want this behavior, you just want that all this should be greeted in a very literal or 想要这种行为，您只是希望所有 这些都应该以非常文字或
raw sense, then you should just apply and are there in our will tell, okay, that's, 原始的感觉，那么你应该申请并且在 我们的意愿中告诉，好吧，那就是，
that's a raw string, everything inside just treat that as a raw string, there is no escape 这是一个原始字符串，里面的所有东西 都把它当作一个原始字符串，没有转义
sequence inside. Great. So and there is much more about strings, we can talk but that that 里面的顺序。伟大的。所以还有更多关于 字符串的内容，我们可以谈论但那
was the most important that I that I told you, at least to me, we can explore this more 是我告诉过你的最重要的，至少 对我来说，我们可以探索更多
actually, you should now explore the smaller What are other functions of string, how can 其实，你现在应该探索更小的字符串 还有哪些其他功能，怎么能
we play with strings in another way and stuff and 我们以另一种方式玩弦乐
so on. If I talk about strings, I can just I mean, I can give a whole course on strings 很快。如果我谈论弦乐，我的意思是 ，我可以讲一整门关于弦乐的课程
as well. But here I just give you a snapshot of strings. If you need more about strings, 以及。但在这里我只是给你一个字符串的快照 。如果您需要更多关于字符串的信息，
I mean you should be searching on internet of seeing documentations and seeing basically 我的意思是你应该在互联网 上搜索查看文档和基本查看
what you want according to your requirements, search the functions probably they will be 根据您的要求，您想要什么， 搜索可能它们将是的功能
available. Okay. In the next video, we are going towards list topples, sets and dictionaries 可用的。好的。在下一个视频中 ，我们将介绍列表倒置、集合和字典
some other data structures that we were talking about earlier, we will be going to explore 我们之前讨论过的其他一些数据 结构，我们将要探索
them in more detail from the next video. Hope to see you in the next video data structure 下一个视频中更详细地介绍它们。希望 在下一个视频数据结构中见到你
informally or in a very naive sense is basically a collection of a lot of basic data types 非正式地或非常幼稚的意义基本上 是许多基本数据类型的集合
that contains data one structure contain a lot of data. And we can define sometimes several 包含数据的一种结构包含大量 数据。我们有时可以定义几个
methods and several specialized kind of functions are customized and define just because of 方法和几种特殊类型的函数 被定制和定义只是因为
that data structure to perform efficiently different kinds of I mean for different kinds 该数据结构可以有效地执行不同 种类的我的意思是针对不同种类
of tasks, we may have to define or we may have to choose different kinds of data structures. 在任务中，我们可能必须定义或我们 可能必须选择不同类型的数据结构。
The basic data structures that are available in Python is a list tupple set and dictionary. Python 中可用的基本数据结构 是列表元组集和字典。
These are the basic data structures that are available. We can create our own data structures 这些是可用的基本数据结构。 我们可以创建自己的数据结构
if we want to. But most of the problems almost all of the problems mostly they are solved 如果我们愿意。但是大部分问题几乎 所有问题大部分都解决了
by these four basic data structures. Although a lot of these are not that efficient. There 通过这四种基本数据结构。虽然其中 很多都不是那么有效。那里
are efficient ways for customized kind of problems, we will see that efficiency when 是定制类型问题的有效 方法，我们将看到效率
we will deal with the package NumPy that is, that is faster than all of these, but will 我们将处理比所有这些 都快的包 NumPy，但是
but we will see what kind of constraints are there to make it faster. Anyways, data set 但我们会看到有什么样的限制可以 让它更快。总之，数据集
in a very loose term is collection, it is a collection of a lot of values a lot of data 在一个非常松散的术语中是集合 ，它是很多值很多数据的集合
inside. And all these data structures list tupple set and dictionary, they they are a 里面。所有这些数据结构都列出 了元组集和字典，它们是一个
collection of data of heterogeneous types, which means one value can be integer another 异构类型数据的集合，这意味 着一个值可以是另一个整数
element let me call an element, another element or item, another item or element can be of 元素让我称一个元素，另一个元素或 项目，另一个项目或元素可以是
string type, another element can be off, let's say floating point number another element 字符串类型，另一个元素可以关闭 ，让我们说浮点数另一个元素
is a whole list itself another element is a topple and so on. So different elements 是一个完整的列表本身，另一个元素 是倒塌，依此类推。那么不同的元素
can be of different types. And that makes this heterogeneity that makes these four data 可以是不同的类型。这使得 这四个数据的异质性
structures much more applicable and much more abstract. And they can be applied to almost 结构更适用，更抽象。 它们几乎可以应用于
all the problems. So let's see one by one and let's compare them together because the 所有的问题。所以让我们一一看看， 让我们把它们放在一起比较，因为
best way to understand four of these is just to compare them which can do what as compared 理解其中四个的最好方法 就是比较它们可以做什么
to the rest. So let's let's compare them and learn how can we use those in detail. So list 其余的。因此，让我们对它们进行比较 ，并了解如何详细使用它们。所以列出
first is list list is ordered ordered here means it is indexable which means there is 首先是列表 列表是有序的 在这里排序 意味着它是可索引的，这意味着有
a particular element number one is at position one element, there is an ordering of elements 一个特定的第一个元素位于第一个 元素的位置，元素有一个排序
first element second third 25th element, there is an ordering of element with respect to 第一个元素第二个第三个第 25 个 元素，有一个元素的顺序
their position. So that's what we mean by ordered changeable or sometimes called more 他们的位置。所以这就是我们所说 的有序可变或有时称为更多的意思
more reasonable term or more usable term is mutable. mutable means once the list is created 更合理的术语或更有用的术语是 可变的。可变意味着一旦创建列表
as contrast to string, once the list is created, you can change its elements for example, you 与字符串相反，一旦创建了列表，您 就可以更改其元素，例如，您
can change the third element with another element and that's perfectly fine you can 可以用另一个元素改变第三 个元素，这很好，你可以
change it that what we mean by changeable or more popularly called as mutable duplicates 改变它，我们所说的可变 或更普遍地称为可变重复
means the list can contain more than one one element more than two, I mean, at the position 意味着列表可以包含不止一个 元素，我的意思是，在位置
number three, you can have the same item and position number five you can have the same 第三，你可以有相同的项目和 位置第五你可以有相同的
item that so the duplicates are allowed tupple however, although ordered, there there is 项目，所以重复项是允许 tupple 然而，虽然有序，有
an ordering of elements there is there are indices of different elements, this is immutable, 元素的排序有不同元素 的索引，这是不可变的，
you can once topple is created like strings. Once the template is created, you cannot change 你可以像字符串一样创建推翻 。模板一经创建就无法更改
different elements in the tupple you have to create a new topple if you want to, but 元组中的不同元素，如果您愿意， 您必须创建一个新的倒置，但是
you cannot change the items in the tupple and the duplicates are allowed again set on 您不能更改元组中的项目， 并且允许再次设置重复项
the other hand is unordered which means there is no indexing there is no positioning, there 另一方面是无序的，这意味 着没有索引没有定位，有
is no first element there is no third element, there is no Fifth Element, there is that's 没有第一元素，没有第三元素， 没有第五元素，就是这样
a collection without it without actually indexing 没有实际索引的集合
because you cannot access a particular element with index you cannot change it, but what 因为您无法使用索引访问特定元素， 所以您无法更改它，但是什么
you can do it you can insert more elements and you can remove existing elements if you 你可以做到你可以插入更多元素 ，如果你可以删除现有元素
want to. Again, the set like in mathematics sets does not contain any duplicates. So one 想要。同样，数学集合中的集合 不包含任何重复项。所以一个
item appears just once we will see the examples Dictionary of very, very, very powerful data item 只出现一次，我们将看到示例字典，其中 包含非常、非常、非常强大的数据
structure. Again, it is it is dictionary is just like a set, it's a set it is unordered. 结构体。再次，它是字典就像一 个集合，它是一个无序的集合。
Again, chancer bow, you can change them but you can change the items you can and the dictionary 再次，机会鞠躬，您可以更改它们， 但您可以更改您可以更改的项目和字典
the pocket and it does not have duplicates, because it's it's basically a set it is just 口袋，它没有重复，因为 它基本上是一套它只是
like I said, the power of dictionary is each item consists of consists of a pair and one 就像我说的，字典的力量是每 个项目由一对和一个组成
one value in the beer is called key and another is called the value for example, well is key 啤酒中的一个值称为键，另一个 值称为值，例如，well 是键
for 12 name is key for band and and so on. So we have seen this dictionary before in 对于 12 名称是乐队等的关键。 所以我们之前看过这本词典
loops and stuff in just a very loose way. But then that's really a very, very powerful 循环和东西只是一种非常松散的方式 。但那真的是一个非常非常强大的
data structure. And later on we will see in pandas basically all the data is basically 数据结构。稍后我们将在pandas中 看到基本上所有的数据都是
managed, just like a dictionary if you if you have a good knowledge of dictionary, you 管理，就像一本字典，如果 你对字典有很好的了解，你
will be having a very good grip very quickly on on a Big Data Science Library or Big Data 将很快掌握大数据科学 图书馆或大数据
Science package which is called pandas because each and everything in pandas is handled just 被称为pandas的科学包，因为pandas 中的每一件事都被处理
like you're handling a dictionary. So it's it's a really powerful data structure to know 就像你在处理字典一样。所以这 是一个非常强大的数据结构要知道
about. 关于。
So, so so 所以，所以
list is mutable dictionary is mutable set is mutable, in a sense that you can insert 列表是可变的 字典是可变的 集合是可 变的，从某种意义上说，您可以插入
and remove elements. topple is not mutable. And that's a comparison theoretically What 并删除元素。 topple 是不可变 的。这是理论上的比较 什么
is there, all these types, each and every of them is a collection of different values. 在那里，所有这些类型，每 一个都是不同值的集合。
And the values can have different types. That's the that's the abstract power of all these 并且值可以有不同的类型。这 就是所有这些的抽象力量
data structures. So, in the next video, we will, we will, we will actually try to get 数据结构。所以，在下一个视频中，我们 会，我们会，我们会真正尝试得到
a good grip on list topple set in dictionary and we will actually define them code and 很好地掌握字典中设置的列表倒置， 我们将实际定义它们的代码和
access different methods of those and we will be we will be trying to become comfortable 访问这些不同的方法， 我们将努力变得舒适
with with these data structures by coding them in Python. So hope to see you in the 通过用 Python 编码来使用这些 数据结构。所以希望能在
next video. Okay, continue in previous video we were talking about data structures in the 下一个视频。好的，继续在之前 的视频中我们讨论了数据结构
last video. So let's go to the Jupyter Notebook and see how a list can be defined or declared 最后一个视频。所以让我们去 Jupyter Notebook 看看如何定义或声明列表
how a tuple can be defined or declared set and dictionary, let's see how can we make 如何定义或声明元组集和字典 ，让我们看看我们如何制作
these data structures in Python? So then one by one, we will compare how can we access Python中的这些数据结构？那么接下来 我们将一一比较如何访问
elements of the list? How can we insert more elements in lists tuples are in dictionary 列表的元素？我们如何在列表中 插入更多元素元组在字典中
and and see the comparisons of all these one by one operation by operation. So let's see. 并查看所有这些操作的比较 。所以让我们看看。
So let's go to Jupyter Notebook, our friend this file is getting lengthy, lengthy, let's 所以让我们转到 Jupyter Notebook，我们的 朋友这个文件越来越长，冗长，让我们
let's make multiple files. Let's say this is part one. Just save it. And let's make 让我们制作多个文件。假设这是第一 部分。只要保存它。让我们做
another let's make another file. For example, let's just close this file, or maybe state 另一个让我们制作另一个文件。例如 ，让我们关闭这个文件，或者说
opened, let's close this file and make another file. Python three. Yeah, so let's name that 打开，让我们关闭这个文件并创建另一个 文件。蟒蛇三。是的，让我们命名它
file as this part two, let's start a new file that that file was on in that was okay to 文件作为第二部分，让我们开始一个 新文件，该文件所在的文件可以
stay with that file as well. But just let's make another file. Okay. So that's just have 也保留该文件。但是让我们制作 另一个文件。好的。所以只有
a markdown cell. And let's have a heading. data structures. Remember the markdown cells, 一个降价单元格。让我们有一个标题 。数据结构。记住降价单元格，
I just introduced them introduce those just in the very beginning. And then we just forget 我刚刚介绍了他们，一开始就 介绍了那些。然后我们就忘了
them. Because writing these description again, and again, we'll make the video length here. 他们。因为一遍又一遍地写这些描述 ，我们将在这里制作视频长度。
And the purpose is not to actually format the notebook, the purpose is just to show 目的不是真正格式化笔记本 ，目的只是为了显示
you the power of Python. So I just omitted writing these descriptions more and more, 你是 Python 的力量。所以我只 是越来越省略写这些描述，
but just write a few descriptions in the star and then we will forget again. Oh, that's 但是只要在星星上写一些描述，然后 我们就会再次忘记。哦，那是
it. That's amazing. Let's see, find a list. So list. Any variable name, that's a variable 它。太棒了。让我们看看，找到一个列表。 所以列出来。任何变量名，就是一个变量
in the list is, let's say this. You define this by square brackets and different elements 在列表中，让我们这么说吧。您 通过方括号和不同的元素来定义它
they are separated by comma, that's a 134, point nine. Name anything I mean, or five, 它们用逗号分隔，即 134，第 9 点 。说出我的意思，或五个，
or maybe maybe three again. So that's the list. Okay. ductile, on the other hand, is 或者也许又是三个。这就是清单 。好的。另一方面，韧性是
defined using parentheses. So let's say 134. point nine. That's the name. And that's a 使用括号定义。所以让我们说 134. 第 9 点。就是这个名字。这是一个
three again, that's okay, that's a tupple. A tupple is defined in. So when you write 再次三，没关系，这是一个元组 。元组定义在。所以当你写
parentheses, that means by default that topple the variable name has I mean, if you have 括号，这意味着默认情况下推翻变量 名我的意思是，如果你有
written t that has nothing to do that it's a tupple. That's because the Python is dynamically 写 t 与它无关，它是一个元组 。那是因为 Python 是动态的
typed. When you will write the parentheses that means the tupple is being defined. Let's 打字。当您写括号时，表示 正在定义元组。让我们
define a set Let's call the variable as S, the set is defined with with these curly brackets. 定义一个集合 让我们把这个变量称为 S，这个集合是用这些大括号定义的。
So let's say 134. 所以让我们说 134。
point nine, I want to tell you that all these things they can contain each element can have 第九点，我想告诉你，他们可以包含的 所有这些东西，每个元素都可以拥有
a different type. But then, even if we include this three again, because the set cannot contain 一种不同的类型。但是，即使我们再次 包含这三个，因为集合不能包含
the duplicates, later on, we will see only one copy of three will be there in the set, 副本，稍后，我们将看到 集合中只有三个副本，
the other will, even if we want to include it will not be included. Okay? Then let's 另一个会，即使我们想包括它也不会 被包括在内。好的？那么让我们
say a dictionary. dictionary is again defined like a set, but but each element is a pair, 说字典。字典再次被定义为一个 集合，但每个元素都是一对，
separated by a colon. Let's say the key value is 23 as a key value, that's the key and the 用冒号隔开。假设键值为 23 作为键值，即键和
value. Here is a string, let's say 价值。这是一个字符串，让我们说
two, 二，
three, that's let's see the value. Now comma. Now one element is there. This one element 三，那就是看价值了。现在逗号 。现在有一个元素。这一元素
that consists of key and value pair, another element, another element may have a key with 由键和值对组成，另一个元素 ，另一个元素可能有一个键
string. So so the keys can be of different types, the values can be of different types, 细绳。所以键可以是不同的类型 ，值可以是不同的类型，
and so abstract. So the key is, let's say, let's say B. and the value for this is, let's 如此抽象。所以关键是，让我们说， 让我们说 B. 而这个的价值是，让我们
say 43, then maybe we can have another key value pair with key as, let's say, c. and 说 43，那么也许我们可以有另一个 键值对，键为，比方说，c。和
the value is, let's say, cc. CCD. That's a charge coupled device. Okay, anyways, so. 值是，比方说，cc。 CCD。那是电荷耦合器件 。好吧，无论如何，所以。
So again, now you know how to define less how to define a topper, how to define a set, 再说一次，现在你知道如何定义 less 如何 定义一个topper，如何定义一个集合，
and how to define a dictionary. The difference is, is the main difference here is in dictionary, 以及如何定义字典。区别在于 ，这里的主要区别在于字典，
because one element consists of two values rather than one. Okay, let's print that and 因为一个元素由两个值而不是一个 值组成。好的，让我们打印出来
see the types let's print all the types sprint died off. So let's paint them. That type of 查看类型让我们打印所有类型 sprint 消失 了。所以让我们画它们。那种
L is. So the table L is just printed. That's L, let's print that. Let's see the other types, L是。所以表 L 刚刚打印出来。那是 L， 让我们打印出来。让我们看看其他类型，
let's print the rest as well. So just copy them and B is the type of list L is that the 让我们也打印其余的。所以只需 复制它们，B 是列表的类型 L 是
type of topple is D. And that's a D, then we have s and then we can just replace this 倒塌的类型是 D。那是 D，然后 我们有 s 然后我们可以替换它
to the s. And then we have, let's say, D dictionary. And that's, that's D. Okay, so that's been, 到 s。然后我们有，比方说，D 字典。那 就是，那是 D。好的，就这样，
so the type of L is less the type of t is topple the time of s is set. The dive of D 所以L的类型少了t的类型推翻 了s的时间。 D的潜水
is dictionary. Oh, great. So that's how you can define these lists. You can define list 是字典。哦，太好了。这就是您可以定义 这些列表的方式。您可以定义列表
you can find topple, you can define set, and you can define dictionary, no problem. Next, 你可以找到topple，你可以定义set，你可以 定义dictionary，没问题。下一个，
let's see how to access different elements from from these data structures. What are 让我们看看如何从这些数据结构 中访问不同的元素。什么是
the way for example, to access an element from a list, let's say the element number 例如，从列表中访问元素的 方式，让我们说元素编号
element that indexed with one remember the element that index with one is element number 以 1 为索引的元素记住以 1 为索引的元素是元素号
two, because indexing starts from zero. So you can access that using the square brackets. 二，因为索引从零开始。所以 你可以使用方括号访问它。
If you want to access from topple again from the square brackets exactly like the list. 如果您想从与列表完全一样的 方括号再次从 topple 访问。
In set, for example, you cannot index it because the set has no ordering. First, second third 例如，在集合中，您不能索引它，因为 集合没有排序。第一第二第三
element is no longer there. But you can you can, you can check whether a particular element 元素不再存在。但是你可以，你可以 ，你可以检查一个特定的元素是否
is there in the set or not using in keyword. In dictionary, for example, if you want to 是否存在于集合中或未使用 in 关键 字。在字典中，例如，如果你想
check whether a particular element or if you want to access value, for a particular key, 检查特定元素或是否要访问 值，对于特定键，
you just create the dictionary variable name and then write the key and it will return 您只需创建字典变量名称，然后 写入密钥，它就会返回
the value. Okay, so let's practice this in in Jupiter. Let's just practice this in Jupiter. 价值。好的，让我们在木星上练习 一下。让我们在木星上练习一下。
So let's say list value at index one. So that's brand new, this list added next one, the value 因此，让我们说索引 1 处的列表值。所以这 是全新的，这个列表添加了下一个，价值
should be printed as three brand topple at index one, again, the way of accessing the 应在索引一处打印为三个品牌 倒塌，再次，访问方式
same Brent Brent, whether three in s or not, the return value will be the return value 相同的布伦特布伦特，无论是否三 个在s中，返回值都会是返回值
will be true or false. So print will be true or false. And then print the and just access 将是真的或假的。所以打印将 是真或假。然后打印并访问
the value with the key 23. So let's see what happens. So l added index one is three tier 键为 23 的值。让我们看看会发生什么 。所以我添加的索引一是三层
index one is three s, three years in S Yes. 索引一是三个s，三年在S 是的。
And what is the value with the key 23? The value is the value is two three. Let me just 键 23 的值是多少？该值 是值是二三。让我只要
describe more about this D. What is the value at index B for example, now we have to give 描述更多关于这个 D. 例如，索引 B 的值是多少，现在我们必须给出
the index B in the string format. That's 43. Yeah, so that's how we can access that. Let's 字符串格式的索引 B。那是 43。是的， 这就是我们可以访问它的方式。让我们
sprint s also let's see s because when we have defined as we have defined this duplicate sprint s 也让我们看看 s 因为当我们 定义为我们已经定义了这个重复
three But if you see the elements of s, there are no duplicates. And it does not maintain 三 但是如果你看到 s 的元素， 就没有重复的了。它不保持
even any ordering, I mean, we have defined s in a different way, it is maintaining everything 即使是任何排序，我的意思是，我们 以不同的方式定义了 s，它维护了一切
maybe in a different way, one three. Yeah, oh, the ordering this way is the same, but 也许以不同的方式，一三。是的， 哦，这样的顺序是一样的，但是
there is no index for the first or second or third element and so on. Okay, so that's 第一个或第二个或第三个元素没有 索引，依此类推。好的，就是这样
about the defining, declaring or accessing different elements. In the next video, we 关于定义、声明或访问不同的元素 。在下一个视频中，我们
will see more about about the data structures actually, actually want to spend some time 实际上会看到更多关于数据结构 的信息，实际上想花一些时间
on the data structures because that will be a basic building block for for the data science 关于数据结构，因为这将 是数据科学的基本构建块
packages, too. If we if we know very well about these data structures, these data structures, 包也是。如果我们非常了解 这些数据结构，这些数据结构，
we will be very fluent in the data science packages and working with those. Okay, hope 我们将非常流利地使用数据科学 包并与之合作。好的，希望
to see you in the next video. Okay, in the last video, we define less topple set and 下个视频见。好的，在上一个视频 中，我们定义了 less topple set 和
dictionary and we actually access different values. In this video, I'm going to actually, 字典，我们实际上访问不同的值 。在这个视频中，我实际上要
I'm going to actually introduce more indexing, how to access list and topple in particular, 我将实际介绍更多的索引，特别是 如何访问列表和推翻，
because the both are very, very easily indexable like strings. And I want to show you that 因为两者都非常非常容易索引，就 像字符串一样。我想告诉你
all kinds of indexing that you have seen in strings, exactly works and list as well as 您在字符串中看到的各种索引 ，完全有效，列表以及
in tupple. So let's go to Jupiter, and see what a list is, for example, a list, if you 在元组中。所以让我们去木星，看看什么 是列表，例如，一个列表，如果你
print the list, that's the list, it has these kinds of values, if you just see the list, 打印列表，就是列表，它有这些类型 的值，如果你只看到列表，
for example, starting from index one, ending at index three, that that means the same big 例如，从索引 1 开始，到索引 3 结束，这意味着相同的大
a slice for example. So index one value is three, index to value is 4.9. And the last 例如切片。所以索引一值是 三，索引值是 4.9。而最后
element is not included. So, if you get that you get three and 4.9. So exactly the same, 元素不包括在内。所以，如果你得到了， 你就会得到 3 和 4.9。所以完全一样，
the same kind of indexing that you have seen in strings, exactly there is working here 您在字符串中看到的相同类型 的索引，正是在这里工作
as well. So for example, if I say list, start from the beginning go to N but then I just 以及。例如，如果我说列表，从 头开始转到 N 但然后我只是
give minus one it will reverse the whole list, I mean the whole list will be reversed. I'm 给减一它将反转整个列表，我的意思 是整个列表将被反转。我是
in all the same all the things that that we saw in in string indexing stays exactly the 同样，我们在字符串索引中 看到的所有内容都保持不变
same in list as well as in topple, so topple For example, let's access element from let's 在 list 和 topple 中相同，所以 topple 例如，让我们从 let 访问元素
say from the very beginning till the till the third element, that's not the third element 说从一开始直到第三个 元素，那不是第三个元素
till index three, which is actually the fourth element. So topple unless they are exactly 直到索引三，实际上是第四个元素 。所以推翻除非他们完全
they will be exactly index as as it as it is. So all the slicing all the indexing all 它们将完全按照原样进行索引。 所以所有的切片所有的索引都
the sub sub listings, all all the sub topples, they can be accessed exactly the same way 子子列表，所有子子列表，它们 可以完全相同的方式访问
as you as you've gone through through the through the strings. One difference here that 就像你一样，你已经通过了 字符串。这里的一个区别是
I will explain later on, because list is mutable it is changeable, I will discuss one thing 我稍后会解释，因为列表是可变的 它是可变的，我将讨论一件事
that one use when you slice it, when you get a sub list then actually it refers to the 切片时使用的那个，当你得到一 个子列表时，它实际上是指
same memory and if you change the sub list contents, the actual list chord changes. That 相同的内存，如果您更改子列表内容 ，实际列表和弦会发生变化。那
is that is true for list in slicing. And that is true for sets and dictionaries, in the 切片中的列表也是如此。对于 集合和字典也是如此，在
copying the references and so on. So I will discuss that later on. But rest of the things 复制引用等。所以我稍后会 讨论这个。但剩下的事情
are roughly the same as as they're in string indexing. Actually, indexing is almost the 与它们在字符串索引中的大致 相同。实际上，索引几乎是
same everywhere in Python, it has this kind of slicing is almost the same if you know 在 Python 中到处都是一样的，如果你知道 的话，它的这种切片几乎是一样的
the index, how to index planes, you know how to index lists, if you know how to index lists, 索引，如何索引平面，你知道如何索引列表 ，如果你知道如何索引列表，
you know how to index couples and strings and, and everything. And by the way, if you 您知道如何索引对和字符串以及 所有内容。顺便说一句，如果你
know how to index strength lists, you will be very fluent and NumPy. That's the very 知道如何索引强度列表，您将非常 流利和使用 NumPy。这就是非常
powerful data structure. That's very powerful kind of array processing package. with with 强大的数据结构。这是一种非常 强大的数组处理包。与
with some defenses that we will see but 我们会看到一些防御措施，但是
even the indexing is same in pandas when you are working with large amount of data data 当您处理大量数据时，即使 在熊猫中索引也是相同的
file and stuff like so the indexing is more or less the same that you've seen in instruments 文件和诸如此类的东西索引或多或少 与您在仪器中看到的相同
we will we will cover indexing, masking and fancy kind of indexing in much more detail 我们将更详细地介绍索引 、屏蔽和奇特的索引
in NumPy. But this stays the same as, as you've seen in in, in strengths Okay, so now can 在 NumPy 中。但这与你在中看到的一样 ，在优势上 好的，现在可以了
we can we expand the list can we add more elements? Can we insert more elements to the 我们可以扩展列表 我们可以添加更 多元素吗？我们可以插入更多元素到
list? The answer is yes. Because list is changeable. New trouble you can insert more elements. 列表？答案是肯定的。因为列表是可变的。 新麻烦你可以插入更多的元素。
One way of inserting there is just to call an add operator, you can just add plus and 插入那里的一种方法是调用添加 运算符，您可以添加加号和
you just insert in other lists like like two strings are concatenated by plus two lists 您只需插入其他列表，就像两 个字符串由加两个列表连接
can be concatenated, or combined together again by plus, but there is a faster function 可以连接，或者通过加号再次组合 在一起，但有一个更快的功能
called append l dot append. That is sometimes faster than using this operator we will see 称为追加 l 点追加。这有时比我们 将看到的使用此运算符更快
that topple because it is immutable. You cannot touch any content of the double you cannot 那会推翻，因为它是不可变的。你不能 触及你不能触及的替身的任何内容
actually insert any element to a topple you cannot delete any element to a tupple. There 实际上将任何元素插入到翻转中，您 不能将任何元素删除到元组中。那里
are workarounds for example, convert a tupple to a last change it then convert the list 例如，是变通方法，将元组转换为 最后一次更改，然后转换列表
to a tupple. There are ways to do that. But tupple in its true sense, in the literal sense, 到一个元组。有办法做到这一点。但是 真正意义上的 tupple，在字面意义上，
it is immutable. You cannot insert any elements you cannot delete any element you cannot change 它是不可变的。你不能插入任何元素 你不能删除任何你不能改变的元素
any element. However, you can combine two tuples. Together, you can concatenate two 任何元素。但是，您可以组合两个 元组。在一起，你可以连接两个
tuples together again by plus operator and save the result into a new double that's possible 通过加号运算符再次将元组组合在一起 ，并将结果保存到可能的新双精度中
set. The you can insert elements using an add function add function allows you to just 放。您可以使用 add 函数插入 元素 add 函数允许您只
insert one element. If you want to insert more than one elements, then you can call 插入一个元素。如果你想插入 多个元素，那么你可以调用
an update function that actually accepts more than one that accepts another set that need 一个实际接受多个的更新函数， 该函数接受另一个需要的集合
to be inserted. That's possible dictionary, you can insert a new key by just the new key 被插入。那是可能的字典， 您可以仅通过新键插入新键
equals to that you just assign a new value to a new key and key value pair is just inserted 等于您只是为新键分配了一个 新值，并且刚刚插入了键值对
there great, you can delete or remove any element from the list using D l Command D 太好了，您可以使用 D l Command D 从列表中删除或删除任何元素
l l one that means the this particular element is deleted from the list that is possible. l l 表示从可能的列表中 删除此特定元素。
Deleting particular element from the tupple is not possible However, you can delete the 从元组中删除特定元素是不 可能的但是，您可以删除
whole variable whole topple that is possible, you can remove elements from the set using 整个变量整个推翻是可​​能的， 您可以使用从集合中删除元素
remove function as dot remove, and then you just give the element that you want to remove 删除功能为点删除，然后 您只需提供要删除的元素
that as possible, it will be removed and you can delete the whole delete the whole variable 尽可能将其删除，您可以 删除整个删除整个变量
that is always available. Similarly, you can delete a particular item from the dictionary 那总是可用的。同样，您可以 从字典中删除特定项目
by just deleting by just calling the D of the value for example, whatever the key is, 例如，通过调用值的 D 来 删除，无论键是什么，
so you call with the key and call the Delete and it will delete everything I want to mention 所以你用钥匙调用并调用删除 它会删除我想提到的所有内容
here for to remove items from the list there are other methods and functions that are also 这里用于从列表中删除项目 还有其他方法和功能
available that I mean there is a remove function, there is a pop function, these are available. 可用我的意思是有一个删除功能，有一 个弹出功能，这些都是可用的。
Similarly, from removing elements from the dictionary, there are other functions that 同样，从字典中删除 元素，还有其他功能
are available. But just to compare them together, I am using this de l command, although there 可用。但只是为了比较它们，我使用 了这个 de l 命令，虽然有
are other ways of doing the same stuff, as well. So let's let's let's let's end this 也是做同样事情的其他方式。所以 让我们让我们结束这一切
video here. And in the next video, I will show you all these operations that concatenating 视频在这里。在下一个视频中 ，我将向您展示所有这些连接操作
together, inserting more elements, deleting different elements, I will show you all these 一起，插入更多的元素，删除不同 的元素，我会告诉你所有这些
things in in Python. So So hope to see you in the next video. Okay, in the last video, Python中的东西。所以希望在下一个视频 中见到你。好的，在上一个视频中，
we saw how to insert different elements to different data structures. And we for example, 我们看到了如何将不同的元素插入 到不同的数据结构中。我们例如，
in the case of tuples, it is not possible. And we also saw how to how to actually delete 在元组的情况下，这是不可能的 。我们还看到了如何实际删除
different elements wherever possible. So let's go to our friend Jupyter Notebook and see 尽可能使用不同的元素。所以让我们 去我们的朋友 Jupyter Notebook 看看
all these concepts in a running form. So let's go. Okay, so let's say for example, we have 所有这些概念都以一种运行的形式存在。所以我们 走吧。好的，让我们举个例子，我们有
list, that's our list. Let's append an element to the list or maybe more elements, that is 清单，这是我们的清单。让我们将一个元素 或更多的元素附加到列表中，即
L plus. Let's say we can have another list for example, how L加。假设我们可以有另一个列表 ，例如
are 是
that's six, and then you that's and these two lists will be appended and the new list 那是六个，然后你就是这样，这 两个列表将被附加到新列表中
will be as you can see this similarly we can append an item using append function for example 将如您所见，我们可以使用 append 函数附加一个项目，例如
6.8 that will also be appended and this will contain these kind of values. So yeah, so 6.8 也将被附加，这将包含这些 类型的值。是的，所以
both arrays are fine. This plus is this plus can be used to append to append to lists and 两个阵列都很好。这个加号是这个 加号可以用来追加到列表和
this append function can be used to simply append a list with a with an element. Okay, 此 append 函数可用于简单地将带有 元素的列表附加到列表中。好的，
great topples. You cannot change the topple, you cannot change the topple. But what you 伟大的倾覆。你不能改变倒塌， 你不能改变倒塌。但是你什么
can do is you can have two tuples for example, T two is a different couple. Let's say a A 可以做的是你可以有两个元组，例如，T two 是不同的一对。假设一个 A
and B, and let's say you have four or five, that's it that's supposed to, then you can 和 B，假设你有四五个，那 就是应该的，然后你可以
have a third double, that is just the combination of double one and double two. And in this 有第三个双，也就是双一和 双二的组合。而在这
case, you have double three, which is this. Yeah, so double one and double two are combined 情况下，你有双三，就是这样。 是的，所以双一和双二合二为一
together, but you cannot actually insert into the assembly, the tuple is immutable, you 在一起，但你不能真正插入到程序 集中，元组是不可变的，你
cannot insert another element, you cannot delete existing elements, you cannot update 不能插入另一个元素，不能 删除现有元素，不能更新
any element and so on. Similarly, as the set, let's see the state of the set, that's the 任何元素等等。同理，作为集合 ，我们看看集合的状态，就是
set set God add function, you can add anything, let's if the six that is added there, and set set God add 功能，你可以添加任何东西， 让我们如果在那里添加六个，以及
the new state of assets this, or you can call the update function. If you update method, 新的资产状态这个，或者你可以调用 更新函数。如果你更新方法，
if you want to insert more elements, for example, if you have multiple elements to be inserted 如果要插入更多元素，例如 ，如果要插入多个元素
23. Again, and let's say you wanted to insert an element that is already there. So for example, 23. 再一次，假设您想插入一 个已经存在的元素。例如，
one, then the duplicates will no longer be there, but the new elements will be inserted. 一，那么重复项将不再存在 ，但将插入新元素。
Now let's see the state of D, the state of D is this. If you want to add another key 现在让我们看看D的状态，D的状态 是这样的。如果要添加另一个键
value pair, you can add a key here, for example, the key might be new key, for example, new 值对，你可以在这里添加一个键，例如 ，键可能是新的键，例如，新的
key and the value might be the value might be, for example, a new value. Well, and now key 和 value 可能是 value 可能是， 例如，一个新值。那么，现在
if you see D, the D, the contents of the D has changed. Well, that's simple. Yeah, great. 如果你看到D，D，D的内容就​​变 了。嗯，这很简单。很好。
Can you concatenate two dictionaries together using a plus operator? Is it possible? Is 您可以使用加号运算符将两个字典 连接在一起吗？是否可以？是
it possible to concatenate two dictionaries together? Let's see I have another I have 可以将两个字典连接在一起吗？ 让我们看看我有另一个我有
another dictionaries dictionary D two. That is that say the key is why. and the value 另一个字典D字典二。那就是说 关键是为​​什么。和价值
is why why? And then we have another key letter Z. and the value is. Let's sit down, can I 为什么？然后我们有另一个关键字母 Z. 其值是。我们坐下，我可以吗
can get an A D and D two together? Can I? Can I just update my D and add these values? 可以将 A D 和 D 两个放在一起吗？我可以 吗？我可以更新我的 D 并添加这些值吗？
insert these values also there? Okay. I left you with this question. You try to answer 在那里也插入这些值？好的。我把这个 问题留给了你。你试着回答
this. And in the next video will answer this question. But try to answer this question 这个。在下一个视频中将回答这个 问题。但是试着回答这个问题
yourself. And one way to try that is just to go in Jupiter and just dive and check whether 你自己。一种尝试的方法是 进入木星并潜水并检查是否
plus is working or not. Or maybe there is another method and stuff like so. Okay, great. 加号是否有效。或者也许有另一种 方法和类似的东西。好的，太好了。
Hope to see you. Oh, I have not used the D l delete and all that stuff, and so on. So 希望能看到你。哦，我没用过 D l delete之类的东西。所以
this question is there, let me use the removing the elements. So let's say l is this list. 这个问题就在那里，让我使用删除元素 。所以让我们说 l 是这个列表。
If I want to remove an element, let's say element number three, if I want to remove 如果我想删除一个元素，让我们 说第三个元素，如果我想删除
element at index three, which is this string name, I can use simply this delete. And the 索引三处的元素，即这个字符串名称 ，我可以简单地使用这个删除。而
L is everything but without that element. Similarly, I can remove if I want to remove L 是一切，但没有那个元素。同样 ，如果我想删除，我可以删除
any element from S, I can call the function remove. And whatever I want to remove, let's S 中的任何元素，我都可以调用函数 remove。无论我想删除什么，让我们
say want to remove game, and the game will no longer be there. 说要删除游戏，游戏将不 再存在。
Great. If I want to remove some element from dictionary, again, let's say that's the that's 伟大的。如果我想从字典中删除一些 元素，再一次，让我们说那是
the view of dictionary. I can call the Add I can I can remove the element with key let's 字典的视图。我可以调用 Add I can I can remove the element with key let's
say C, whatever the element is with key C, delete that element, and the dictionary has 说 C，无论带有键 C 的元素是什么 ，删除该元素，字典就有
this particular state with this item, this particular item is gone. Okay, great. I can 这个项目的这个特殊状态，这个特殊的 项目消失了。好的，太好了。我可以
do that. But But d L is not the only way of doing that. There are so many methods. I mean, 去做。但是 d L 并不是这样做的唯一 方法。有这么多方法。我的意思是，
a lot of methods to do that. But just to just to compare all these, I'm just giving you 有很多方法可以做到这一点。但只是 为了比较所有这些，我只是给你
the most similarities and differences wherever available. Okay, great. So I have asked you 尽可能多的相同点和不同点。好 的，太好了。所以我问过你
a question in this particular video. Can we concatenate two dictionaries together, particularly 这个特定视频中的一个问题。我们 可以将两个字典连接在一起，特别是
with a plus operator? If yes, then we are done. If not, then Are there other ways and 带加号运算符？如果是，那么我们就完成 了。如果没有，那么还有其他方法吗？
stuff like so that's the question. So hope to see you in the next video with more on 这就是问题所在。所以希望在下 一个视频中见到你更多关于
these data structures. 这些数据结构。
Okay, I asked you a question last time. Can we concatenate this two dictionaries together 好的，我上次问过你一个问题。我们 可以将这两个字典连接在一起吗
with a plus operator? So what's your answer? Yes or no? The answer is Nope, yeah, so we 带加号运算符？那么你的答案是什么？是还 是不是？答案是否定的，是的，所以我们
cannot concatenate them together, we cannot insert another dictionary to this dictionary 无法将它们连接在一起，我们无法 在此字典中插入另一本字典
using a plus operator. Because this plus operator is not defined for dictionary, what we can 使用加号运算符。因为这个加号运算符 不是为字典定义的，我们可以
do is we can call an update function, because dictionary is also a set, I mean, a set of 做的是我们可以调用一个更新函数，因为字典 也是一个集合，我的意思是，一组
key value pairs. But at the end of the day, it's a set with specialized function, of course, 键值对。但归根结底，它是一 个具有专门功能的集合，当然，
but we can call update functions, and insert the whole new dictionary inside dictionary 但是我们可以调用更新函数， 并在字典中插入整个新字典
as as as follows. Yeah, so the answer is using plus operator No, but there is a way using 如下。是的，所以答案是使用加号运算 符否，但是有一种方法可以使用
update method. Right. So next, we focus on the copy function, the copy function is available 更新方法。对。那么接下来，我们 重点介绍复制功能，复制功能可用
for less the copy function is available for set, the copy function is available for dictionary. 对于较少的复制功能可用于 设置，复制功能可用于字典。
So let's see the need of this copy function here, I want you to be very careful. Because 所以这里让我们看看这个复制功能 的需要，我希望你非常小心。因为
that's, that's really important. Let's say we have a list, let's say, That's list. And 就是，这真的很重要。假设我们有一 个列表，比方说，那就是列表。和
by the way, the same goes with set and dictionary as well, whatever I'm going to do with list, 顺便说一下，set 和dictionary 也是一样 ，不管我要对list 做什么，
let's see a list. Now, what you do is you copy the list or you just make another variable, 让我们看一个列表。现在，你要做的 是复制列表 或者只是创建另一个变量，
like you can assign the value of l to another variable l two, what you do is that now l 就像你可以将 l 的值赋给另一个变量 l 2，你现在所做的就是 l
two is also has this, now these are two different variables, L is this variable, l two is this 二是也有这个，现在这是两个不同的 变量，L是这个变量，l二是这个
variable. So you might be thinking l two is separately a completely a new thing. And Alice 多变的。所以你可能会认为我两个 是一个全新的东西。还有爱丽丝
new thing, you might be thinking that both are independent. But Python internally manages 新事物，您可能会认为两者都 是独立的。但是 Python 内部管理
the data structures, most of the data structures in a way that because the data structure is 数据结构，大多数数据结构的 方式是因为数据结构是
a collection of a lot of data it has it is consuming a lot of memory, what it does is 它拥有大量数据的集合消耗 大量内存，它的作用是
when you assign a variable, or data structure to to another variable, it does not actually 当您将一个变量或数据结构分配给 另一个变量时，实际上并没有
copy all the contents, it does not actually make a new memory, and store the contents 复制所有内容，它实际上并没有 创建新的内存，并存储内容
in this. It actually this variable also actually points to the same memory as this. and and, 在这。实际上这个变量实际上也指向 与这个相同的内存。并且，
and and the consequence of that if you change any value, for example, in L two, let's say 以及如果你改变任何值的结果， 例如，在 L 2 中，让我们说
you change the index to value from this, the index to values 4.9. Now you're working in 您将索引从此更改为值，将索引 更改为值 4.9。现在你在工作
L two, let's say you change this L to value from 4.9. To Let's 4.9. Let's see you do that. L 二，假设您将这个 L 值从 4.9 更改为 值。让我们 4.9。让我们看看你这样做。
So you might be thinking that this happens in L two, well, in L two, that has happened. 所以你可能会认为这发生在 L 2 中 ，嗯，在 L 2 中，这已经发生了。
But what it also does is it does the same thing in L as well. So l also changes. The 但它也做的是它在 L 中也做同样 的事情。所以我也会改变。这
reason is L and L two, they both are pointing to this structure in the memory. And whether 原因是L和L两个，它们都指向内存 中的这个结构体。以及是否
you approach that structure through L, or you approach that structure two l two, you're 你通过 L 接近那个结构，或者 你接近那个结构 2 l 2，你是
approaching the same memory anyway. And that is called referencing I mean, it does not 无论如何接近相同的记忆。这就是所谓 的引用，我的意思是，它不
create the data, it actually create a reference in the memory to actually create a new name 创建数据，它实际上在内存中创建一 个引用来实际创建一个新名称
for the same memory. And both are pointing to or accessing to the same memory. And if 对于相同的内存。并且两者都指向 或访问相同的内存。而如果
you really want the behavior so that l two becomes different than L and what I what I 你真的想要这样的行为，让我 两个变得不同于 L 和我什么我
do with L two, that should not affect L, then you should call copy function. l two is L 用L做两个，那不应该影响L，那么你 应该调用copy函数。我两个是L
dot copy. Yeah. So that's the function, I'll copy. Now you have l two. Now you do whatever 点复制。是的。这就是功能，我会复制 。现在你有我两个。现在你做什么都行
with L two, it will not affect L. So l two, for example, index at index two, you again 用L 2，它不会影响L。所以L 2， 例如，索引在索引2，你再次
say okay, this is 4.9. So l two changes. Now, l two changes, but l doesn't change, l doesn't 说好吧，这是4.9。所以我有两个变化。现在 ，我有两个变化，但我没有改变，我没有
change, l stays the same. Now this is different copy, same concept, go with the set. And same 改变，我保持不变。现在这是不同的副本 ，相同的概念，随同一套。和一样
concept go with with the dictionary. If you if you just make another way will s two n 概念与字典一致。如果你只是 换一种方式将是两个 n
equals two s, then if you change the contents of s two s will change. If you don't want 等于两个s，那么如果你改变s的内容 ，两个s就会改变。如果你不想
that, then copy it similarly copy the dictionary, because the contents of the topple they are 那，然后复制它 类似复制字典 ，因为推翻它们的内容
not changeable. The copy function is not available for double. Because even if you assign this 不可改变。复制功能不适用于 double。 因为即使你分配这个
T to T two, you can now not change D two because it is immutable. So having a copy function T 到 T 2，你现在不能改变 D 2 因为它 是不可变的。所以有复制功能
doesn't make sense in tupple. Wait. 在元组中没有意义。等待。
One more thing regarding slicing. Let's say you have let's say you have Dell that's available 关于切片的另一件事。假设 您有 假设您有可用的戴尔
to you like so that's L and let's say you make l three another list by slicing Let's 对你来说，那是 L 假设你通过 切片制作了另外三个列表 Let's
say a list from let's say one to five, let's say. So you start from index one, which is 说一个列表，让我们说一到五，让我们 说。所以你从索引一开始，也就是
three, and you go to five by not including five, this way, the L three is automatically 三个，你不包括五个就到五 个，这样，L 三个是自动的
a copy, it is not a sub list, which is referencing. So l three. So l three is a different l two 一个副本，它不是一个子列表，它是引用。 所以我三个。所以我三是不同的我二
is a completely new list, a new memory view, if you change the contents in L, three, if 是一个全新的列表，一个新的内存视图 ，如果改变L中的内容，三，如果
you change the contents in L three, for example, l three, or index zero, it should go from 你改变L三中的内容，例如，L三 ，或索引零，它应该从
three to let's say, three, if you change the contents in L three, these contents, these 三 比方说，三，如果你改变 L 三 中的内容，这些内容，这些
change will not reflect an L. So if you do the slicing, slicing picks a copy by default, 更改不会反映 L。因此，如果您进行 切片，则切片默认会选择一个副本，
it does not pick a reference. And that's a huge difference between this list and a NumPy 它不选择参考。这是这个列表 和 NumPy 之间的巨大差异
array, when you end it, we'll see that when we will see a NumPy array, the slicing actually 数组，当你结束它时，我们会看到当 我们看到一个 NumPy 数组时，切片实际上
also, again refers to the same memory location. And that might be one difference in indexing, 此外，再次引用相同的内存位置。 这可能是索引的一个不同之处，
indexing in the whole Python, whenever you do slicing, you get a copy. But in NumPy, 在整个 Python 中建立索引，无论何时进行切片 ，都会得到一份副本。但是在 NumPy 中，
when we'll see NumPy in detail, in NumPy, when you do slicing, you get again a view 当我们详细了解 NumPy 时，在 NumPy 中， 当您进行切片时，您将再次获得视图
not a copy, and if you change in the slice torian anything the actual the actual contents 不是副本，如果您在切片 torian 中更改任何实际内容
also changed. And there is a reason to do that there is a there are efficient reasons 也变了。并且有理由这样 做有一个有效率的理由
to do that and stuff like so, again, the dot copy function becomes the copy function become 为了做到这一点，再一次， 点复制函数变成了复制函数
much more applicable there as well. So, so, so you need to know that even if you do if 在那里也更适用。所以，所以，所以 你需要知道，即使你这样做，如果
you do slicing in general in Python in any collection in any array, in any, if you do 你通常在 Python 中的任何数组中的任何 集合中进行切片，如果你这样做
select a collection for even for mutable objects like list, you get a copy, but in NumPy array, 甚至为像列表这样的可变对象选择一个集合， 你会得到一个副本，但是在 NumPy 数组中，
the things the things these things, this particular thing with with a lot of other things this 这些东西，这些东西，这个特别的 东西，还有很多其他的东西
but this indexing scheme actually changing, changes with with this kind of slicing. Okay, 但是这种索引方案实际上在变化 ，随着这种切片而变化。好的，
so I am this video here, I mean, you can explore much more functions of lists tupple, seven 所以我是这里的这个视频，我的意思是，你 可以探索列表元组的更多功能，七
dictionary and what you can do with each of them, and what you I mean, in which scenario, 字典以及你可以用它们中的每一个做什么 ，以及你的意思，在哪种情况下，
what kind of thing is more suitable for the other that completely depends upon the problem 什么样的东西更适合 对方完全看问题
at hand. But what we can do in what what we will do what we'll be doing in the less next 在眼前。但是我们能做什么我们 将做什么我们将在接下来的更少
video, we will be seeing some using some functions of just list. And then I will be just just 视频，我们将看到一些使用 just list 的一些功能。然后我就只是
letting you to explore the the tupple set and dictionary and all their functions on 让您探索元组集和 字典及其所有功能
your own. And to see what function or what method is doing what for what, which kind 你自己。并查看什么功能或什么方法 在做什么，为了什么，哪种
of data structure. So in the next video, we will be seeing some methods just for list 的数据结构。所以在下一个视频中， 我们将看到一些仅用于列表的方法
data structure. Hope to see you in the next video. Like in screens. Let's Let's explore 数据结构。希望在下一个视频中见到你 。就像在屏幕上一样。让我们一起探索
a lot of functions in list. Although in, in in sets and dictionaries and tuples tuples, 列表中有很多功能。虽然在， 在集合和字典和元组元组中，
as well. But many more functions are available in list. And by the way, let's see how many 以及。但是列表中还有更多功能可用。 顺便说一下，让我们看看有多少
things are there in this list. And let's say l dot tab, and tab will open up a lot of things 东西在这个列表中。让我们说 l 点 选项卡，选项卡会打开很多东西
with me for me abanda we know already clear copy, copy, we know already count, we don't 对我来说，阿班达我们知道已经清楚复制 ，复制，我们知道已经计数，我们不知道
know count, extend, index insert, pop remove reverse some of these functions. They make 知道 count、extend、index insert、pop remove 逆向这些函数中的一些。他们做了
sense by the adjuster name. But let's see one by one. Let's see some of those. What 通过调节器名称来感知。但是让我们一一 看看。让我们看看其中的一些。什么
they do. One way to do that is go to internet and see some book or tutorial or something 他们是这样。一种方法是上网 看一些书或教程或其他东西
like So another way is just write this apply. Maybe, maybe help function maybe apply a help 所以另一种方法就是写这个应用程序 。也许，也许帮助功能也许应用帮助
function, it may help you how to use that. Great this help function is great. So abandoned 功能，它可能会帮助您如何使用它。 很棒，这个帮助功能很棒。如此遗弃
object method of building list in stance about an object to end of the list. Oh, it appends 以对象的立场构建列表的对象方法 到列表的末尾。哦，它附加
an object to the end of the list. Which means 一个对象到列表的末尾。意思是
we may be able to append another list to to a list maybe. Have you thought about that. 我们也许可以将另一个列表附加 到列表中。你有没有想过。
The append method just takes 111 object. Maybe it takes a whole lot of list. But then it append 方法只需要 111 个对象。也许 它需要很多列表。但后来它
may be possible that a list is appended inside another list and that whole list becomes becomes 一个列表可能被附加到另一 个列表中并且整个列表变成
one element because list can contain other lists as elements are that's a problem. Yeah. 一个元素，因为列表可以包含其他列表 作为元素，这是一个问题。是的。
So let's see more functions. Yeah, so let's see clear what this clear What is this clear 所以让我们看看更多的功能。是的，所以 让我们看看清楚这清楚什么这是清楚
what it does? Sometimes I use help, sometimes it's used that remove all items from the list, 它能做什么？有时我使用帮助，有时 使用它从列表中删除所有项目，
oh my god, if you call the clear that the list is empty, okay? If you just call clear 哦，天哪，如果你明确表示列表是空 的，好吗？如果你只是打电话清除
function on a list will become empty. Be careful. Okay, great. What else? So that see I have 列表中的函数将变为空。当心。好的，太 好了。还有什么？所以看到我有
this function maybe, Bob, what does Bob does watch. So let's see. So Bob removes and returns 这个功能可能，鲍勃，鲍勃看什么。 所以让我们看看。所以 Bob 移除并返回
item at index defaulted the last, which means if you also that's the default value remember 索引中的项目默认为最后一个，这 意味着如果您也是默认值，请记住
the default value. So, if you call a part function without an index, it will return 默认值。所以，如果你调用一个没有 索引的部分函数，​​它会返回
it will remove the index it will delete the last item and it will give you that it will 它会删除索引 它会删除最后 一个项目 它会给你它会
return that are if you give an index, it will remove that value at that index. And it will 如果您提供索引，则返回该索引， 它将删除该索引处的该值。它会
after removing it will return you that. So you can use it wherever you want. So there 删除后它会返回给你。所以你可以在 任何你想要的地方使用它。所以有
are many more functions for example, you can see all of them one by one remove function, 例如还有更多功能，您可以 一一查看所有删除功能，
for example, reverse reverse, like, like, like the name suggests, if you call the reverse 例如，reverse reverse，like，like， 顾名思义，如果你叫reverse
function, the list will be reversed. Yeah, and remember, we have reversed the list in 功能，列表将被颠倒。是的， 请记住，我们已经颠倒了列表
the following way as well, we have a way of reversing any way, this way. So now if you 下面的方式也是如此，我们有办法扭转任何 方式，这种方式。所以现在如果你
see the list is again reversed. So I guess both of them are working like so same. Similarly, 看到列表又被颠倒了。所以我 想他们两个都在工作。相似地，
you can explore several functions from a set, you go and say add Clear. Clear might be working 您可以从一组中探索多个功能， 然后说添加清除。清除可能有效
as same as intersection intersection and update is destroyed is a subset of the other. Yeah, 与交集交集和更新被破坏相同 的是另一个的子集。是的，
add by default or update by default, actually take a union. So I'm not seeing update function. 默认添加或默认更新，实际上采取 联合。所以我没有看到更新功能。
Here it is update. Oh, union is there update is there, which means the list you're seeing 这是更新。哦，工会在那里更新 在那里，这意味着您看到的列表
is here is not a complete list you may be writing, what are the functions that start 这里不是您可能正在编写的完整 列表，启动的功能是什么
from you. So here are the and and several others. Similarly, you can go to dictionary 从你。所以这里是 和 和其他 几个。同样，你可以去字典
and call for several functions clear copy from keys get items. That item might be might 并调用几个函数从键中清除 副本获取项目。该项目可能是
be interesting. What is this item? what it does? Oh, it has an error? What? So how can 有趣。这个项目是什么？它能做什么 ？哦，有错误吗？什么？那怎么能
you use this? How can you use this function? Let's see, oh, this is just an object, it 你用这个？你如何使用这个功能？让我们 看看，哦，这只是一个对象，它
is not a function? I don't know. 不是函数吗？我不知道。
Let's see again, are it is not listed anywhere? Oh, it is items not item. Okay, items. That's 再看看，是不是哪里都没有列出来？哦， 是物品不是物品。好的，物品。那是
a function maybe. So these are all the items 23 with this, be with that new key with that, 也许是一个功能。所以这些是所有 项目 23 和这个，用那个新的钥匙，
and so on. Great. So actually, the purpose here is not to tell you each and every function, 等等。伟大的。所以实际上，这里 的目的不是告诉你每一个功能，
what it does, it will take a whole lot of time. You can go and explore all these functions. 它会做什么，需要很多时间 。您可以去探索所有这些功能。
The purpose here is to tell you what kind of data structure has, what kind of properties 这里的目的是告诉你有什么样 的数据结构，有什么样的属性
and what are the similarities and differences in between. So if you remember this one slide, 以及它们之间有什么相同点和不同点 。所以如果你还记得这张幻灯片
for list, double seven dictionary and some text that is written out above, you'll be 对于列表，双七字典和上面 写出的一些文本，您将
having very good knowledge of where to pick what kind of data structure in practice. So 非常了解在实践中在哪里选择 什么样的数据结构。所以
in the next video, I'll be actually going to Jupyter Notebook as our as our style and 在下一个视频中，我将实际使用 Jupyter Notebook 作为我们的风格和
I will be coding or solving some problem for you that will involve list topple set or dictionary 我将为您编码或解决一些涉及 列表倒置集或字典的问题
are one of them or we will be choosing based on problem what kind of data structure is 是其中之一，或者我们将根据 问题选择什么样的数据结构
well and what so we'll be doing that. But before that, I just want to I just want to 好吧，所以我们会这样做。 但在那之前，我只想我只想
I just want to mention that list tupple set or dictionary they can contain any items inside 我只想提到列表元组集或字典 ，它们可以包含其中的任何项目
any kind of type, which means a list can contain another list. A list can contain a set a list 任何类型，这意味着一个列表可以包含另一个 列表。一个列表可以包含一个集合列表
can contain a dictionary, a list of dictionary can contain a list which itself contains a 可以包含字典，字典列表可以包含一 个列表，该列表本身包含一个
dictionary, I mean, this is all abstract, this is all abstract, one thing can contain 字典，我的意思是，这都是抽象的 ，这都是抽象的，一件事可以包含
the other one thing can contain an instance of I mean, a list can contain multiple lists. 另一件事可以包含一个实例，我的意思 是，一个列表可以包含多个列表。
And those lists can contain more or less and so on. So before actually going to problem 这些列表可以包含更多或更少等等 。所以在真正解决问题之前
solving, let me give you a flavor of that how abstract these things are. Let me give 解决，让我给你一个味道，这些 东西是多么抽象。让我给
you a flavor of that in in just just in a couple of examples. So in the next video I'll 仅举几个例子，您就可以体会到 这一点。所以在下一个视频中我会
be giving you a couple of examples based on the abstract mess of these data structures. 给你几个基于这些数据结构 的抽象混乱的例子。
And from the next next video, we'll be probably, we will be doing some problem solving based 从下一个视频开始，我们 可能会基于解决问题
on that. So next two videos are completely on Jupyter notebooks. So get ready, I hope 在那。所以接下来的两个视频完全在 Jupyter notebook 上。所以准备好，我希望
to see you in the next video. Okay, let's see the abstractness of all these data structures. 下个视频见。好的，让我们看看 所有这些数据结构的抽象性。
Let's see just one example. Let's say we have l as the list, we have all rich top all that 我们只看一个例子。假设我们有 l 作为列表，我们有最富有的人
stuff. So let's say we have set that set, let's say n, we have dictionary, that's a 东西。所以假设我们已经设置了那个集合 ，假设 n，我们有字典，那是一个
dictionary. Okay? So let's say we have all these things that say available somewhere. 字典。好的？所以假设我们有所有 这些可以在某处使用的东西。
So let's make another dictionary. For example, let's say D, D, Ma, that's a D tool. And that 所以让我们制作另一本字典。例如，假设 D、D、Ma，这是一个 D 工具。然后
dictionary has key value pairs less The key is a and the value is whole list l master 字典有键值对 less 键是 a， 值是整个列表 l master
value is possible. Let's say the key is B. and the value is just to topple the whole 值是可能的。假设关键是 B. 价值只是为了推翻整体
topple, that's the value. Let's say the key is C, and the value is the set. And let's 推翻，这就是价值。假设键 是 C，值是集合。让我们
say the key is D, and the value is the dictionary, the whole dictionary D it is possible. I mean, 说键是D，值是字典，整个字典D 都是可能的。我的意思是，
you can just do that, that that is just one example, oh, what's Oh sorry, I should have 你可以这样做，那只是一个例子 ，哦，哦，对不起，我应该有
I should have incorporated this way. Okay, so this is possible. Now, for example, if 我应该以这种方式合并。好的，所以 这是可能的。现在，例如，如果
I access, if I access the element with, let's say, a, I will, I will get the whole list. 我访问，如果我访问元素，比方说，a， 我会，我会得到整个列表。
And not only that, I can again access the whole element. And then after that, for that 不仅如此，我还可以再次访问整个 元素。然后在那之后，为此
element, I can access for example, the third element, the element at index three. So this 元素，例如，我可以访问第三个元素 ，即索引三处的元素。所以这
particular, this particular first level will extract the list. And that will in that is 特别是，这个特定的第一 级将提取列表。那将是
just the indexing or for that list. See, for example, if 只是索引或该列表。看，例如 ，如果
I access D two, and inside the tool, if I access the dictionary that is inside, and 我访问 D 两个，在工具里面， 如果我访问里面的字典，并且
let's say I save that dictionary in k, then it I can see the contents of K but I can just 假设我将该字典保存在 k 中，然后 我可以看到 K 的内容，但我只能
for example, this or I can just access all elements of this dictionary, or k by just 例如，this or I 可以访问这本字典 的所有元素，或者 k by just
having 4x in gay brand, for example, x and k of x, just do that i can i can just do that 有 4x 同性恋品牌，例如，x 和 x 中的 k， 就这样做吧，我可以，我可以这样做
we have done that in loops as well. So I want to tell you that the these even if for example, 我们也在循环中做到了这一点。所以 我想告诉你，这些即使例如，
if you want to create a list l let's say l three let's say you want to create a list 如果你想创建一个列表，让我们说 l 三个假设你想创建一个列表
that can contain a whole list that can contain what will get Oh, I mean one element is the 可以包含一个完整的列表，可以包含什么 将得到哦，我的意思是一个元素是
list another element is to pull another element is the whole dictionary inside and then you list another element is to pull another element is the entire dictionary inside 然后你
have some other elements let's Lee's game and that's perfectly fine i get i mean you 有一些其他元素让我们李的游戏 ，那很好，我明白我的意思是你
can do that, these data structures are much more abstract I mean now if you for example, 可以做到这一点，这些数据结构要抽象 得多，我的意思是，如果您例如，
access element at index two which is dictionary, that is completely a dictionary if you if 访问索引二处的元素，即 字典，如果您如果
you check the type of that element that that will be a dictionary object and you can extract 您检查将成为字典对象的元素 的类型，然后您可以提取
that element and play the way you want to play and whatever. One more thing if you can, 那个元素，按照你想玩的方式玩 什么的。如果可以，再做一件事
for example lists we can let's say we want to make a list list very quickly for example 例如列表，我们可以说我们想 非常快速地制作一个列表列表
list off all the squares till till starting from zero list of all the squares till till 列出所有方块直到从零开始 列出所有方块直到
10 for example zero square one square to square let's say we want a list of that. So one way 10 例如零平方一个平方到平方假设我们 想要一个列表。所以一种方式
of doing that is a quick shortcut is to just use the loops so in loops, for example, we 这样做的快捷方式是只使用循环 ，例如，在循环中，我们
right okay, x square for x in range. Then for example, so it will start from zero go 好吧，x 平方表示范围内的 x。 然后例如，所以它会从零开始
till nine, including nine and you will get x one by one. And all this index is for making 到九点，包括九点，你会一一得到 x。所有这些索引都是为了制作
a list of x squares where x starts from zero and go to go to including nine go to nine x 方格的列表，其中 x 从零开始 并转到包括九个转到九个
one by one and that's how you can make a list and I'm in these kind of these are kind of 一个接一个，这就是你可以列一个 清单的方式，我就是这样的人
shortcuts. Again, you can make a sale For example, let's say you want to make a set 捷径。同样，您可以进行销售 例如，假设您想制作一套
of all the squares for x in range, let's say, starting from starting from two, ending at 在范围内 x 的所有正方形中 ，比方说，从 2 开始，到
20. And you want to take a step of, let's say three. So, start from index two go till 20. 你想迈出一步，比方说三步 。所以，从索引二开始直到
20 do not include 20, but take the step of three, and you can now have a set, which is 20不包括20，走三步，现在 可以有一套了，就是
which is this. I mean, there are, there are a lot of ways of working these working with 这是这个。我的意思是，有很多 方法可以与这些一起工作
these. One, one can explore more and more about these things, but what what what the 这些。一，人们可以越来越多地探索 这些东西，但是什么什么是什么
basic thing about these data structures are, they are very, very abstract, they can I mean, 这些数据结构的基本内容是，它们 非常非常抽象，我的意思是，
a list can contain a dictionary, and that dictionary can contain a topple and that will 一个列表可以包含一个字典 ，该字典可以包含一个倒置
have an element which is another list and so on. It is that abstract, it allows you 有一个元素是另一个列表等等 。就是那么抽象，它让你
to do each and everything in that way. Okay, so I end this video here in the next video, 以这种方式做每一件事。好的，所以 我在下一个视频中结束这个视频，
we will actually solve a problem using these one of these data structures or we will try 我们将实际使用这些数据结构之一 解决问题，或者我们将尝试
to choose one of those. And that video naby lengthy may be small, because we may have 选择其中之一。那个视频可能 很长，因为我们可能有
bugs inside. And we will we will play around with these data structures in the next video. 里面的虫子。我们将在下一个 视频中使用这些数据结构。
So do attend the next video because it's really the practice and you will get your hands you 所以一定要参加下一个视频，因为 这真的是练习，你会得到你的手
will get a very good grip on the data structures in the solving the next problem that we are 在解决我们要解决的下一个问题 时，将很好地掌握数据结构
that we are launching for you, okay, hope to see you in the next video. Okay, let's 我们正在为您推出，好的，希望在下 一个视频中见到您。好的，让我们
see a problem just to get comfortable with these data structures. So let's let's design 看到一个问题只是为了适应这些 数据结构。所以让我们来设计
some problem and solve that problem here using using these data structures. So the problem 一些问题并在这里使用这些数据 结构解决该问题。所以问题
that I'm thinking is, let's say the following. Let's say let's say you are you a teacher, 我在想的是，让我们说以下 。假设你是老师，
should I type all these things? Okay? Let's say you're a teacher, you are a teacher. And 我应该输入所有这些东西吗？好的 ？假设你是老师，你是老师。和
you have 你有
different student records to learn records containing containing ID of a student and 不同的学生记录来学习 包含学生ID的记录和
the mark marks list in each subject, where different students have taken different number 每个科目的分数列表，其中 不同的学生采取了不同的数字
of subjects. And all these records all these records are in hardcopy. You want odd copy, 的科目。所有这些记录 所有这些记录 都是硬拷贝。你想要奇怪的副本，
you want to enter all the data in computer and want to compute the average marks of each 您想将所有数据输入计算机 并计算每个数据的平均分数
student. And display. That's the problem. So the problem let's say is, you have for 学生。并显示。那就是问题 所在。所以问题是，你有
example, you have a hardcopy you have you have some papers, upon which you have different 例如，你有一份硬拷贝，你 有一些文件，上面有不同的
students, each student have a different ID. Some students may have taken seven subjects, 学生，每个学生都有不同的ID。 有些学生可能选了七门科目，
some student may have taken three subjects, some student may have taken eight subjects 有些学生可能选了三门科目， 有些学生可能选了八门科目
and so on different students may have taken different subjects. Regardless there, you 等等，不同的学生可能选择了不同 的科目。不管在那里，你
want to first enter each for each student, you want to first enter the records, I mean 想先录入每个学生，你要 先录入记录，我的意思是
all the data that is in and then you want to compute from that data, you want to compute 所有的数据，然后你想从 这些数据中计算，你想计算
the average marks of each student. For example, if a student have taken five subjects, then 每个学生的平均成绩。例如，如果 学生选修了五门科目，那么
the marks for all the five subjects are available, you just add all the marks and divide by five 所有五个科目的分数都可用，您只 需将所有分数相加并除以五
and that's, let's say, the average marks. So first of all, let's ride away two way to 这就是平均分。所以首先 ，让我们骑车走两条路
compute for example, the to just collect the data, how to collect the data. So let's write 计算例如，只是收集数据，如何 收集数据。所以让我们写
a function for that. So let's say define a function, let's say get data From user or 一个功能。所以让我们说定义一个函数 ，让我们说从用户那里获取数据或
teacher, let's say, let's say that function, and it returns data. Okay? So what I do really 老师，让我们说，让我们说那个函数， 它返回数据。好的？所以我真正做的
is I say, okay, while 我是说，好吧，而
true, 真的，
I made a loop while true, just take the data from the from the user, and the data is in 我做了一个循环，while true，只是 从用户那里取数据，数据在
the form of you first say, okay, ID, student ID, let's say that is inter, or actually input, 你先说的形式，好吧，身份证，学生证 ，我们说是inter，或者实际输入，
enter student ID. So he enters the the person enters the student ID. Yeah. So adopt, you 输入学生证。所以他输入的人输入学生证 。是的。所以采用，你
might have define a dictionary, maybe a dictionary D, that is empty right now. But you may, you 可能已经定义了一个字典，也许是一个字典 D，它现在是空的。但你可能，你
may add and remove different values. So what you do is, you add a student ID, you get a 可以添加和删除不同的值。所以你要做的 是，你添加一个学生证，你会得到一个
student ID, and in the string form, and then you get the you get, for example, the input 学生ID，并以字符串形式，然后 你得到你得到的，例如，输入
as the marks list. So marks list as input. Enter the marks, 作为标记列表。所以将列表标记为输入 。输入标记，
by 经过
comma 逗号
separated values. So enter the marks using for example, if you have five subjects, just 分离的值。所以输入分数，例如 ，如果你有五个科目，只需
write the five subject marks by separating each with the comma, okay, then this, let's 写五个主题标记，用逗号分隔每个 标记，好的，那么这个，让我们
see 看
more 更多的
students is equal to let's say input, 学生等于让我们说输入，
enter, 进入，
yes, or no. 是还是不是。
for 为了
adding more students, so if for example, you have more data to insert, then press Yes, 添加更多学生，例如，如果您有 更多数据要插入，请按是，
otherwise personnel. So that's, for example, our setup. So we will keep on getting more 否则人员。例如，这就是我们的设置 。所以我们会继续获得更多
and more, we will keep on getting more and more data from the user user will keep on 并且更多，我们将继续从用户那里 获得越来越多的数据用户将继续
increasing the data. But one thing that we must know is that if for example, a student 增加数据。但是我们必须知道的 一件事是，如果例如，一个学生
ID, student ID is already in D, if that is already in D, then we should give a message ID，学生证已经在D里了，如果已经 在D里了，那么我们应该给个消息
brand. brand that student ID is already inserted. So that might be a message else. ls we want 牌。已插入学生证的品牌。所以这 可能是其他信息。我们想要吗
to do something else, what we want to do is the following. What we want to do else is 要做别的事情，我们想做的 是以下。我们还想做的是
we will make a dictionary, we already have a dictionary with a student ID as our key, 我们将制作一本字典，我们已经有了 一本以学生 ID 为关键字的字典，
that's our key. And at that key, what we do is be the pick the marks list, and just split 那是我们的钥匙。在那个关键上，我们 所做的是选择标记列表，然后拆分
it using comma because you're expecting and all the marks they will be saved as a list. 它使用逗号，因为您期望它们 将被保存为列表的所有标记。
So that will return a list. List of string values. These are not indeed values, these 所以这将返回一个列表。字符串值列表 。这些确实不是价值观，这些
are string values. But all these lists they are tagged by this ID. So that is a dictionary 是字符串值。但是所有这些列表都 用这个 ID 标记。所以这是一本字典
that will be that we'll be getting populated on and on and on. Further if we check F for 那将是我们将不断地被填充 。此外，如果我们检查 F
example, more students dot lower, for example, let's call the lower function because the 例如，更多的学生点低，例如， 让我们调用lower函数，因为
user may interest at a lower form or if that is equal to let's say no, that is equal to 用户可能对较低的形式感兴趣，或者 如果这等于让我们说不，那就等于
No, if this is the case, or if there is no enter for example. 不，如果是这种情况，或者例如 没有输入。
No 不
inter no inter Know, to quit when insertion, insertion into node with insertion. So let's inter no inter 知道，插入时退出 ，插入节点插入。那么让我们
say that's your message. So wherever the user inserted, if that's a no, then you return 说这是你的信息。所以无论用户插入到 哪里，如果那是否，那么你就返回
the and that's it. Otherwise, you keep on moving. So that's the whole goal. So you keep 就是这样。否则，你继续前进 。这就是整个目标。所以你保持
on asking the, the, you keep on asking more and more values. If whenever the teacher enters 在询问，该，您不断询问越来越 多的值。如果每当老师进来
a no, then you just return. Otherwise, you keep an up, you make another equation, you 不，那你就回来。否则，你 继续，你做另一个等式，你
make another equation and keep on moving. That's how you get the data. So the data will 做另一个等式并继续前进。这就 是您获取数据的方式。所以数据会
be available to you. Once you are done with that, then after that, we will see how to 可供您使用。一旦你完成了，那么 在那之后，我们将看到如何
once we have this data collected from the user, then we will see how to compute marks 一旦我们从用户那里收集了这些数据 ，那么我们将看到如何计算分数
for each student individually average marks and so on. So let's just check whether this 每个学生的平均分数等等 。所以让我们看看这是否
function works or not. So let's say we have our dictionary that says student student data 功能是否有效。所以假设我们有我们 的字典，上面写着学生学生数据
is equal to get data from user, let's just call that function. Let's see what happens. 等于从用户那里获取数据，让我们调用 该函数。让我们看看发生了什么。
Okay. Enter student ID, let's say ID is 12. Okay, in remarks by comma separated values, 好的。输入学生 ID，假设 ID 是 12。 好的，在用逗号分隔值的备注中，
let's say, well, one, let's say 让我们说，好吧，一个，让我们说
24, 24,
comma 65, comma 87, let's say the first two in just the first tool and just have these 逗号 65，逗号 87，让我们说第一个 工具中的前两个，然后有这些
three subjects, then internode width, so I will enter something else. And oh, what's 三个科目，然后节间宽度，所以我 会输入别的东西。哦，是什么
the problem? There is a problem. If more students taught lower is more student is not defined. 问题？有一个问题。如果教的学生越 多，则学生越多，则未定义。
More student that's, I guess, more students, more student here, oh, the spelling mistakes. 更多的学生，我猜，更多的学生 ，更多的学生，哦，拼写错误。
That's a huge mistake. So I just copy there, these bugs are there. That's part of life. 这是一个巨大的错误。所以我只是复制那里， 这些错误就在那里。那是生活的一部分。
Part of programming life, actually. So I guess now it will work. So let's do the process 实际上是编程生活的一部分。所以我想现在 它会起作用。所以让我们做这个过程
again. So 12, let's say, and the marks are the six comma 45, comma, let's say a bad subject 再次。所以 12，让我们说，标记是六 个逗号 45，逗号，让我们说一个坏主题
with let's say, 13. into no to quit. No, I will intro something else, I will keep on 比方说， 13. 进不退出。不，我会 介绍一些别的东西，我会继续
moving. The other student is the student ID is 45, let's say. And the marks that this 移动。另一个学生是学生 ID 是 45，比方说。而这标志着
student has gained, actually, let's say this student has, has registered has already registered 学生已经获得了，实际上，假设 这个学生已经，已注册已经注册
seven subject or let's say five subjects. And the marks are, let's say 44 to five, six 七个科目或让我们说五个科目 。分数是，比方说 44 到 5，6
to 677. And let's see a bad subject, let's say four. Okay, then internodal, quit. No, 到 677。让我们看一个不好的主题，让我们 说四个。好的，那么节点间，退出。不，
I want to insert one more, so do anything else other than No. So student ID, let's say 我想再插入一个，所以做除 No 之外的 其他任何事情。所以学生 ID，让我们说
now the student ID is 12. Again, let's say, let's say want to insert another ID again. 现在学生 ID 是 12。再说一次， 假设想再次插入另一个 ID。
And whatever the marks, let's say 45, and 45. Again, that's a now internode width, no 不管是什么标记，比方说 45 和 45。 同样，这是现在的节间宽度，不
something else. But now, the message is there, the 12 is already inserted, because the ID 别的东西。但是现在，消息在那里 ，12已经插入了，因为ID
the key value index, now you cannot repeat, and so is the student value. So it does not 键值索引，现在不能重复了 ，学生值也是。所以它不
inserted the because this may be my mistake, so it asks again. So now let's say I enter 插入了因为这可能是我的错误，所以 它再次询问。所以现在假设我输入
ID, let's say 23. That's the ID or maybe a different ID. That's the ID and the marks ID，比方说 23。那是 ID 或者可能 是不同的 ID。那是ID和标记
are let's say 45, comma, 45. That's it. And internodal grid. So let's say I enter No. 比方说 45，逗号，45。就是这样。和节点 间网格。所以假设我输入了 No。
And that's it. So now I have received the student data, if I show you the student data, 就是这样。所以现在我收到了学生 数据，如果我给你看学生数据，
that student data is student data. That's a dictionary, that's a dictionary with the 那个学生数据就是学生数据。 那是一本字典，那是一本字典
with key 12. And that's a list. But this list contains all the values that are our string 使用键 12。这是一个列表。但是这个 列表包含我们字符串的所有值
type, we will see how to handle that. That's a 45 as a key value, that's ID and that's 类型，我们将看到如何处理。那是一 个 45 作为键值，那是 ID，那是
the marks list. And that's the ID in that small list. Okay, great. Now we have student 标记列表。这就是那个小列表中的 ID。好的，太好了。现在我们有学生
data. Let's write another function that helps us working on the student data, basically, 数据。让我们编写另一个函数来帮助 我们处理学生数据，基本上，
we want to find out the average marks of each student. And then we want to print those. 我们想找出每个学生的平均成绩 。然后我们想打印这些。
So let's define another function and get average marks of each student. And that function actually 所以让我们定义另一个函数并获得每 个学生的平均分数。这个功能实际上
receives this dictionary, let me call it as D, any any variable, that's a local variable. 收到这本字典，让我称它为 D， 任何变量，都是局部变量。
Okay, so what we want to do with that is the following. Average marks for each student's, 好的，所以我们想要做的是以下 内容。每个学生的平均分，
so we will define another dictionary, let's see everage marks dictionary, let's say that 所以我们将定义另一个字典，让我们 看看everagemarks字典，让我们说
is empty in the beginning, maybe, and then what we do for x in D, let's icreate over 一开始是空的，也许，然后我们对D 中的x做了什么，让我们创建一遍
x and d, what we really do is we go to the we find out the list of located at ELLs are x 和 d，我们真正做的是去我们 发现位于 ELL 的列表是
located at x L is basically D sub x. So that's it, that's our list. That's our list that 位于 x L 基本上是 D sub x。就是这样，这 就是我们的清单。这是我们的清单
is located there. So then what we do for i in L. So for all i that is an L or let me 位于那里。那么我们在 L 中为 i 做什么 。所以对于所有是 L 的 i 或让我
call it for marks, marks in L. In this particular list, what you do is you actually have this 称其为标记，L 中的标记。在这个特定列表 中，您所做的是您实际上拥有这个
sum of sum is equal to zero right now, sum的总和现在等于零，
there is no marks. So what you do is s plus equals two marks, but convert the marks to 没有标记。所以你所做的是 s plus 等于 两个标记，但将标记转换为
integer because they are already in string format. We have we have saved everything instinct 整数，因为它们已经是字符串格式 。我们已经拯救了一切本能
string format, so you populate all the list. Once you are done with this loop, the S will 字符串格式，因此您可以填充所有 列表。完成此循环后，S 将
contain the sum of all the marks, then what you do is you compute the average and just 包含所有分数的总和，然后你要 做的是计算平均值，然后只是
save that average in ABG. Marks decked dictionary, let's say on average marks, just just don't 将平均值保存在 ABG 中。标记装饰字典 ，让我们说平均分数，只是不要
use the word deck, for example, you can but let's stay gradual and add x, you just write 使用单词deck，例如，您可以但让 我们保持渐进并添加x，您只需写
the average marks. And the average marks can can be computed by s divided by length of 平均分数。平均分数可以 通过 s 除以长度来计算
the list, whatever the list is. So that's what the list is. Yeah, so that's the average 清单，无论清单是什么。这 就是清单。是的，这是平均值
marks. And once you have an N one by one, all the average marks will be populated. And 分数。一旦你一个一个地有了 N， 所有的平均分数都会被填充。和
once we receive all these, we will then begin then we can then just display by populating 一旦我们收到所有这些，我们将开始 然后我们可以通过填充来显示
the average marks. So let's see, let's call that function. So let's call that function. 平均分数。所以让我们看看，让我们调用 那个函数。所以让我们调用这个函数。
So ABG marks for example, equals to get a VG marks, and let's bond these student data 所以举个例子，ABG 分数，就等于拿到了 VG 分数，让我们把这些学生数据绑定起来
inside. And if there is no error, then it will return everything. Then just print the 里面。如果没有错误，那么它将 返回所有内容。然后只需打印
average marks for each student for x in a Vgm. brand, let's say student and Brand X 每个学生在 Vgm 中 x 的平均分数 。品牌，让我们说学生和品牌 X
God average marks as then you just Brandt okay ABG m of x, x, and that will display 上帝平均标记为那么你只是 Brandt OK ABG m of x, x，然后会显示
everything Oh, if there is an error, non type object is not equipped. I prefer nine type 一切哦，如果有错误，非类型对象 没有配备。我更喜欢九型
object why non time object? We have done some mistake. Yes. Maybe. Let's see. Let's see, 对象为什么非时间对象？我们犯了一些错误。是 的。也许。让我们来看看。让我们来看看，
for example, when we run this, so let's run this and create a cell Let's run using alt 例如，当我们运行它时，让我们运行它并 创建一个单元格让我们使用 alt 运行
Enter to create a cell everage m What is that thing? Oh, that's nothing. Why oh, we haven't 回车创建一个单元格everage m 那是什么东西 ？哦，那没什么。为什么哦，我们没有
returned anything. That's a bad programming. Really bad programming. We have not returned 返回任何东西。这是一个糟糕的编程 。真是糟糕的编程。我们还没有回来
actually. The the value that we need. So the default value is none. raid actually not so 实际上。我们需要的价值。所以默认值 是none。突袭实际上并非如此
great. Okay, great. You have this and now we have something in Emirates marks. Yes, 伟大的。好的，太好了。你有这个，现在 我们有阿联酋航空标志的东西。是的，
this is and now we can just populate that and we have this student 12 got average marks 这是，现在我们可以填充它，我们 让这个学生 12 获得了平均分
38 student 45 core average marks 90 49.2 and student 20 He got average marks as 45.0 Okay, 38 学生 45 核心平均分 90 49.2 学生 20 他的平均分是 45.0 好的，
great. So that was just a review of split function of string, type and marine through 伟大的。所以这只是对字符串， 类型和海洋的拆分功能的回顾
int, and functions in general input function, and, and dictionary and list and all that int, 和一般输入函数中的函数 , and, 字典和列表等等
stuff. So although it was a just a tiny problem, but it gives a good flavor of the data structures 东西。所以虽然这只是一个小问题，但 它提供了一个很好的数据结构的味道
and strings and all that stuff. Okay, that's about the data structures. From the next video, 和字符串之类的东西。好的，这 就是数据结构。从下一个视频，
we are actually diving into the data science packages. And we will start from NumPy and 我们实际上正在深入研究数据 科学包。我们将从 NumPy 开始
we will spend some time on NumPy and then we will be moving towards pandas, which is 我们将花一些时间在 NumPy 上， 然后我们将转向 Pandas，也就是
very, very powerful built on top of NumPy and after that, we'll be moving towards matplotlib 非常非常强大，建立在 NumPy 之上 ，之后，我们将转向 matplotlib
and we will also try to give you some snapshots of psychic learn as well. So hope to see you 我们还将尝试为您提供一些通灵 学习的快照。所以希望见到你
in the next video. Okay, the next few videos will I will discuss NumPy which is the which 在下一个视频中。好的，接下来 的几个视频我将讨论 NumPy
is the very very popular package for numerical Python. Actually NumPy is like list but it 是非常流行的数值 Python 包。 实际上 NumPy 就像 list 但它
is much much faster than list. 比列表快得多。
One one restriction if we restrict the list of Remember, a list actually is a collection 一一限制 如果我们限制了列表 记住，列表实际上是一个集合
of a lot of data objects. That was so abstract, as we saw in previous videos, if for example, 大量的数据对象。这太抽象了，正如我们 在之前的视频中看到的那样，例如，
we restrict a list that all the objects they must have same type all elements in the list 我们限制列表中的所有对象必须具有 相同类型的列表中的所有元素
for example, they have same type then that list with all the same type, there is what 例如，它们具有相同的类型，然后该 列表具有所有相同的类型，有什么
the NumPy looks like, but NumPy is very, very more faster. And the reason is, even if you NumPy 看起来像，但 NumPy 非常 非常快。原因是，即使你
define a list with all the elements that are let's say of same type Yeah, but because list 定义一个列表，其中包含相同类型 的所有元素 是的，但是因为列表
in abstract way can handle heterogeneous kind of objects, the functions that we will apply 以抽象的方式可以处理异构类型 的对象，我们将应用的功能
on these items, they will no longer be faster further to store each element we have to store 在这些项目上，他们将不再更快 地存储我们必须存储的每个元素
that information or metadata for that element in NumPy, it is both I mean, it is efficient NumPy 中该元素的信息或元数据 ，我的意思是，它是有效的
with respect to memory, because if the type is saying we need not to save information 关于内存，因为如果类型 说我们不需要保存信息
about each element, because we need just to save the information about the type because 关于每个元素，因为我们只需要 保存有关类型的信息，因为
the type is same for all elements further when the type is same, we can write functions 当类型相同时，所有元素的类型 都相同，我们可以编写函数
that are much more faster than then then a list. So NumPy is very, very popular, it has 这比列表要快得多。所以 NumPy 非常非常流行，它有
very very fast universal functions available the methods that are available in NumPy. And NumPy 中可用的方法提供了 非常快速的通用函数。和
it's a package i mean it's it's a whole directory structure containing a lot of packages inside 这是一个包，我的意思是它是一个完整 的目录结构，里面包含很多包
a lot of modules and so much at the end of the day, it's it's it's simply or in laymen 很多模块，在一天结束时有很多 ，它只是简单的或外行的
terms, it is like a list with all the same type objects and it is much more useful when 术语，它就像一个包含所有相同类型对象 的列表，并且在以下情况下更有用
all these objects are numeric type, although you can have a NumPy array with with spring 所有这些对象都是数字类型，尽管您 可以使用带有 spring 的 NumPy 数组
data types, I mean all the strings are all general objects as well, but the the most 数据类型，我的意思是所有的 字符串都是一般对象，但最
the power mill the power of NumPy array will be will become much more evident when we will NumPy 数组的威力将变得 更加明显，当我们
be working on numeric type data. So in this particular in this particular course we will 正在处理数字类型数据。所以 在这个特定的课程中，我们将
focus more on numeric data then other kind of data. So that's how you you write import 更多地关注数字数据而不是其他类型的 数据。所以这就是你编写 import 的方式
NumPy is installed or if you if you have installed Python using Anaconda NumPy is already installed NumPy 已安装，或者如果您使用 Anaconda 安装了 Python，则 NumPy 已安装
there it is in the side packages kind of a built in package. So import NumPy we can stay 它位于内置包的侧面包中。所以 导入 NumPy 我们可以留下来
as it is but we can rename this NumPy just NP that's most popular name, we can write 照原样，但我们可以将这个 NumPy 重命名 为最流行的 NP，我们可以这样写
any other name but if you see the books or internet or somewhere this NP somehow becomes 任何其他名称，但如果您看到书籍或互联网 或某个地方，这个 NP 不知何故变成
much more popular. Okay. Now we can define an array for example NP dot array that array 更受欢迎。好的。现在我们可以定义 一个数组，例如 NP 点数组该数组
is just a method of NP kind of function. And we can define an array using list this is 只是一种 NP 类函数的方法。我们可以 使用列表定义一个数组，这是
the list of several numbers or we can define array as as a topple as well. So whether we 几个数字的列表，或者我们也可以将 数组定义为倒塌。那么我们是否
give a topple whether we give a list an array is defined and then we can see the contents 给一个推翻是否我们给一个列表一个 数组被定义然后我们可以看到内容
of this array, this NP array so let let's just go to our friend Jupyter Notebook and 这个数组，这个 NP 数组，所以让我们 去我们的朋友 Jupyter Notebook 和
get our hand Well dripped on, on this NumPy. So first of all, we need to import NumPy package. 让我们的手在这个 NumPy 上滴水不漏 。所以首先，我们需要导入 NumPy 包。
And we may rename as for future use as NP. So let's say that is imported. So now let's 我们可能会更名为 NP，以备将来使用。 所以假设它是进口的。所以现在让我们
say a is an array, let's say NP dot array, that's a function and we may have a list and 说 a 是一个数组，让我们说 NP 点数组， 那是一个函数，我们可能有一个列表和
say, let's say 12357. Let's say that that's right, we can also define the array using 比如说，让我们说 12357。让我们说这 是对的，我们也可以使用定义数组
a topple rather than a list, it's our choice. Which way we define the array either way. 推翻而不是列表，这是我们的选择 。我们以哪种方式定义数组。
235 Let's, that's, that's another array for example. So if we print for example, a it 235 让我们，也就是说，这是另一个数 组。所以如果我们打印，例如，它
will give us a but if we just see the type of a it will no longer be list it will be 会给我们一个，但如果我们只看到 a 的 类型，它将不再是列表，它将是
an ND array numpy.md array that n dimensional array, okay, great. So, there are so many 一个 ND 数组 numpy.md 数组，那个 n 维数组 ，好吧，太好了。所以，有这么多
attributes of this a and this B. Same. Similarly, if you see the type of B although we have 这个a和这个B的属性一样。同样，如果 你看到 B 的类型，尽管我们有
defined this be using the tupple. But the type is the same the it's a NumPy object rather 定义这是使用元组。但类型是相同 的，它是一个 NumPy 对象而不是
than a list or a topple. 比列表或推翻。
So that's how you can create the the array 1111 more thing that is that is important 所以这就是你如何创建数 组 1111 更重要的事情
is to check the attributes of a for example, k dot d type, that will tell us the data type 是检查a的属性，例如k dot d类型 ，它会告诉我们数据类型
in a so for example, a stores all the data that is integer 32. At defined time, for example, 例如，a 存储整数 32 的所有 数据。例如，在定义的时间，
we can we can specify the data type if we want we can specify the type if we want. For 如果我们愿意，我们可以指定数据类型 如果 我们愿意，我们可以指定类型。为了
example, in teacher that means as in teacher here, we can here we can define, for example, 例如，在老师这意味着就像在老师这里 一样，我们可以在这里定义，例如，
the type as float, for example, so data type becomes float. There are several other other 例如，类型为浮点数，因此数据 类型变为浮点数。还有其他几个
options that are available to define the data type but, but even if we don't define the 可用于定义数据类型的选项， 但是，即使我们没有定义
data type can be defined automatically based on contents. That's what the dynamic typing 可以根据内容自动定义数据 类型。这就是动态类型
means. So if we now define type that is, if we, if we now check the type of a that is, 方法。所以如果我们现在定义类型，如果我们 ，如果我们现在检查 a 的类型，即，
again in digit 32, but if you check the type of be the type that that might be a float 再次在数字 32 中，但是如果您检查 类型是可能是浮点数的类型
number, yes, that's float 32. Again, there are 64 bit support as well, I mean, we can 数字，是的，这是浮点数 32。同样，也 有 64 位支持，我的意思是，我们可以
define here there are several options here available. So that's the that's how we can 在这里定义 这里有几个可用的 选项。所以这就是我们能做的
define the NumPy array that's just getting started with NumPy array. In the next video, 定义刚刚开始使用 NumPy 数组的 NumPy 数组。在接下来的视频中，
we will play with these arrays a bit more. So hope to see you in the next video. Okay, 我们将更多地使用这些数组。所以希望 在下一个视频中见到你。好的，
in the last video, I introduced NumPy. And we actually declared a NumPy array using a 在上一个视频中，我介绍了 NumPy。 我们实际上使用了一个 NumPy 数组
list as well as a topple. In this particular video, we will be seeing some of the properties 列表以及推翻。在这个特定的 视频中，我们将看到一些属性
of the NumPy array variable or sometimes called the object that variable there are several NumPy 数组变量或有时称为 对象的变量有几个
properties, but I will discuss for example, last time I discussed one property which is 属性，但我将讨论例如，上 次我讨论了一个属性，它是
d type a dot d type, and that store actually the that actually stores the information of d type a dot d type, and that store 实际上 实际存储的信息
the data type of the elements of the array of NP array, remember NP array, all elements NP数组的数组元素的数据类型 ，记住NP数组，所有元素
of NP array they must have same data type it cannot store heterogeneous arrays as it NP 数组，它们必须具有相同的数据类型 ，它不能像它那样存储异构数组
is. Okay. Now, there is another property sometimes called the dimensions are n them. That tells 是。好的。现在，还有另一个属性 有时称为维度是 n。这说明
actually, what are the dimensions of of the array, I need to explain this term dimensions 实际上，数组的维度是多少 ，我需要解释这个术语维度
with the following example. Let's say for example, that's, that's that's an array just 用下面的例子。比方说， 那是，那只是一个数组
consider that a list for example, 123, that's one list. And if it is if it is an array, 考虑一个列表，例如 123，这是一 个列表。如果它是一个数组，
for example, if np.if this is NP dot array. With that list, we will say that array as 例如，如果 np.if 这是 NP 点阵。有了 这个列表，我们会说这个数组为
a one dimensional array, because we only need one index to access that. For example, if 一个一维数组，因为我们只需要一 个索引来访问它。例如，如果
you need to access any element in this array, you only need one index either 01 or two, 你需要访问这个数组中的任何元素 ，你只需要一个索引 01 或 2，
only one index, that's okay. So in this case, we have just one dimensional array. On the 只有一个索引，没关系。所以在这种 情况下，我们只有一维数组。在
other hand, for example, if you see here, that's one array or one list, that's another 另一方面，例如，如果你在这里看到， 那是一个数组或一个列表，那是另一个
array, another list. And that's another list that contains lists inside for example. Let's 数组，另一个列表。这是另一个 包含列表的列表，例如。让我们
say that array one, and that's array two. And that is simply an array of two different 说数组一，那是数组二。 这只是两个不同的数组
arrays. That's, that's an array and that's an array. For example, a One is this array 数组。也就是说，这是一个数组，那是一 个数组。例如，一个 One 就是这个数组
and a two is this array. Now if we need to access any element in this particular array, 一个二是这个数组。现在如果我们需要 访问这个特定数组中的任何元素，
we need two indices. First of all, we have to locate whether we are going to talk about 我们需要两个索引。首先， 我们要确定我们是否要谈论
a one or a two, we need one index for that, for example, if we want to locate a one, that 一或二，我们需要一个索引，例如 ，如果我们想定位一个，那
means we are going to access with elements zero, let's say this, this whole array is 意味着我们将使用零元素访问 ，比方说，整个数组是
a So first of all, we say okay, zero means we are going to access from from a one and a 所以首先，我们说好的， 零意味着我们将从一个和
a to one of those. So zero means the first one, okay, now a one. Now inside a one which a 到其中之一。所以零意味着第一个， 好吧，现在是一个。现在在一个里面
element, this is the zeroeth element, this is the first element, this is a second element, 元素，这是第零个元素，这是 第一个元素，这是第二个元素，
let's say we want to access the first element. So that means we are going to talk about we 假设我们要访问第一个元素。所以 这意味着我们要谈论我们
are talking about this. So very loosely speaking, the total number of indices that are required 正在谈论这个。所以非常松散地 说，所需的索引总数
to access an element inside the array is called dimension of the array. And m them that actually, 访问数组内的元素称为数组 的维数。而他们实际上，
that actually defines that that actually describes the this property, the total number of dimensions. 这实际上定义了实际上描述 了这个属性，维数的总数。
Consider, for example, this is a 2d array or two dimensional array, let's head out to 考虑一下，例如，这是一个二维数组 或二维数组，让我们开始
two dimensional array A one, and let that's another two dimensional array a two, that's 二维数组 A 一个，让那是另一 个二维数组一个 2，那就是
another two dimensional array, a three, for example, and let's say this is an array of 另一个二维数组，例如一个 三，假设这是一个数组
two dimensional arrays, let's say NP dot array. Now, that's that whole array, whatever that 二维数组，比方说 NP 点数组。现在， 这就是整个数组，不管那是什么
array is a three dimensional array. And the reason is to access any element, we need three 数组是一个三维数组。原因是 访问任何元素，我们需要三个
indices. First index will define which one of these we are selecting, for example, let's 指数。第一个索引将定义我们选择 其中的哪一个，例如，让我们
say you're selecting that. So one index is needed that index is one for example, then 说你正在选择那个。所以需要一 个索引，例如索引是一，然后
inside this structure like so, we need two more indices to locate a particular particular 在像这样的结构内部，我们需要 另外两个索引来定位特定的特定
index. For example, because it is a two dimensional array, it has two one dimensional array, so 指数。比如因为是二维数组，所以 有两个一维数组，所以
which one dimensional array you are, it has more, it has many one dimensional arrays, 你是哪个一维数组，它有更 多，它有很多一维数组，
so which one dimensional array you want to pick, let's say the sixth one will index with 所以你想选择哪个一维数 组，假设第六个将用
index five, now you have located the fifth or sixth array. Now in that array, what element 索引 5，现在您已经找到了第五个或第六 个数组。现在在那个数组中，什么元素
let's say the eighth element. So we need three indices to access a particular element. So 让我们说第八个元素。所以我们需要三个 索引来访问一个特定的元素。所以
the dimensions of this array is three. So let's play with that in Jupyter, notebook 这个数组的维度是三。所以让我们 在 Jupyter，notebook 中使用它
just to get more comfortable with with the term dimensions. So let's say for example, 只是为了更适应术语维度 。所以让我们说，例如，
we have an array, let's say a is NP dot array. And let's say it contains a list, let's say 我们有一个数组，假设 a 是 NP 点数 组。假设它包含一个列表，假设
123. And then we have another array, one dimensional array, let's say four, five, and six, that's 123. 然后我们有另一个数组，一维数组 ，比方说四、五和六，那就是
another array. And that is an array of these two arrays. So that is basically a two dimensional 另一个数组。这是这两个数组的 数组。所以这基本上是一个二维的
array. It is array of arrays. list of lists, equal entries. So that's a for example, oh, 大批。它是数组的数组。列表列表，相等 的条目。所以这是一个例子，哦，
what's the problem? Oh, we haven't imported NumPy, we should have. So import, import NumPy 有什么问题？哦，我们还没有导入 NumPy， 我们应该导入。所以导入，导入NumPy
as NP? Okay, we need not to import that every time. Actually, I'm recording this video after 作为NP？好的，我们不需要每次都导入 。实际上，我是在录制此视频之后
a few after a few hours. And I'm really I have restarted all these things. So I have 几个小时后。我真的重新开始 了所有这些事情。所以我有
to import now for the first time. But once imported in the notebook, as long as a notebook 现在第一次导入。但是一旦在 笔记本中导入，只要一个笔记本
is running, you need not re import anything. Okay, so a DOD for example, and then Iraq 正在运行，您无需重新导入任何内容。 好的，例如国防部，然后是伊拉克
and them. So that is to hear because there are two dimensions. For example, if I want 还有他们。所以这是听，因为有 两个维度。例如，如果我想要
to access element number three, this element, so this element is located in the first array 访问第三个元素，这个元素，所以 这个元素位于第一个数组中
of the two arrays, which has so the first array, there are two arrays with index zero 在具有第一个数组的两个数组 中，有两个索引为零的数组
or one. So I am going to look into the first array, which is 123. And in that array, I'm 或一个。所以我要查看第一个数组 ，它是 123。在那个数组中，我
going to look for the element number two element with index two. So that's how you can access 将查找索引为 2 的元素编号为 2 的元素 。这就是你可以访问的方式
the elements of multi dimensional arrays are arrays with more, more kind of dimensions. 多维数组的元素是具有更 多、更多维数的数组。
Let's say we have another array just to just to get more familiar with NP array, let's 假设我们有另一个数组只是为了 更熟悉 NP 数组，让我们
say, and we have a list. And that list actually contains that list actually contains three 说，我们有一个清单。该列表实际上 包含该列表实际上包含三个
one dimensional arrays. Not only that, actually Oh, I'm confusing you a lot. Let me know Let 一维数组。不仅如此，实际上哦 ，我让你很困惑。让我知道让
me just, let's say we have 123. Let's say we have three one dimensional arrays. Let's 我只是，假设我们有 123 个。假设 我们有三个一维数组。让我们
say we have another 2459. The the sizes of arrays, maybe, maybe, maybe, I mean, maybe 假设我们还有另一个 2459。数组的大小， 也许，也许，也许，我的意思是，也许
different. Yeah. Is that true? maybe different? Yes or no? Let's see, for example, the first 不同的。是的。真的吗？也许不同？是还 是不是？例如，让我们看看第一个
array has size three, and the second array has total size. Does that okay? I guess, yes. 数组的大小为三，第二个数组 的总大小。可以吗？我猜是。
And now if we want to access, for example, an element of an element with a, let's say, 现在如果我们想访问，例如， 一个元素的元素，让我们说，
I want to access this element five, so that is in the secondary index with one, and then 我想访问这个元素五，所以 在二级索引中有一个，然后
in that array, it has index two. So I've accessed this element, oh, we're not too many indices 在该数组中，它的索引为 2。所以我访问了 这个元素，哦，我们没有太多的索引
for an array. Why? 对于数组。为什么？
Why is that? Why too many indices, for for an array, B selects a B dot n dems. And then 这是为什么？为什么索引太多，对于一 个数组，B 选择了一个 B 点 n dems。进而
that is one y one dimensional, I have to, I have this one dimensional array. And this 那是一维的，我必须，我 有这个一维数组。和这个
is another one dimensional array. And I have made a list out of it. I'm in this is 1d array 是另一个一维数组。我已经列出 了它。我在这是一维数组
and another 1d array of concatenate them together, so I shouldn't have accessed this element. 和另一个将它们连接在一起的一维数组 ，所以我不应该访问这个元素。
The problem is when you are going to define multi dimensional arrays, the the number of 问题是当你要定义 多维数组时，
elements for each dimension, they should stay consistent. For example, if the first array 每个维度的元素，它们应该保持 一致。例如，如果第一个数组
has three elements, the second array must have three elements, or if the secondary has 有三个元素，第二个数组必须有 三个元素，或者如果第二个数组有
four elements, and the first must have four elements. If that is not the case, the array 四个元素，第一个必须有四个元素 。如果不是这种情况，则数组
will not be defined like a multi dimensional array. For example, if we, for example, extend 不会像多维数组那样定义。例如 ，如果我们，例如，扩展
our first array with let's say, minus one. Now, B will be having two dimensions, no problem. 我们的第一个数组，比方说，减去一 个。现在，B 将有两个维度，没问题。
And now we will be able to access for example, this element five, like so. So we will go 现在我们将能够访问例如这个元素 五，就像这样。所以我们会去
to B again, we will see okay, select array number two, and in that array, select index, 再次到 B，我们会看到好的，选择第二 个数组，然后在该数组中，选择索引，
select the value indexed by two, which is five. So accessed no problem. And that stays 选择由 2 索引的值，即 5。 所以访问没有问题。就这样
true if you if you're going to define for example, a three dimensional array, let me 如果您要定义例如一个 三维数组，那么请让我
just give you an example of three dimensional array that's a C equals NP dot array. And 只是给你一个三维数组的例子，它 是一个 C 等于 NP 点数组。和
let's say we have one, two and three. And then we have another array, for example. 456, 假设我们有 1、2 和 3。然后我们 有另一个数组，例如。 456,
remember or so let's say that, that we can have one more for example, we can have one 记住或者让我们说，例如，我们可以 再拥有一个，我们可以拥有一个
more list, why not? So let's say we have a 00 minus one, let's say, and that is what 更多清单，为什么不呢？所以假设我们 有一个 00 减 1，让我们说，这就是
that is. That is a two dimensional array. That's a two dimensional array. Great. Let's 那是。那是一个二维数组。那是 一个二维数组。伟大的。让我们
say we have another two dimensional array. Let's say we have another two dimensional 假设我们还有另一个二维数组 。假设我们有另一个二维
array with same kind of consistency, the number of elements and stuff. Let's say these elements 具有相同一致性的数组，元素的 数量和东西。让我们说这些元素
are our minus of the, the other ones, let's say there's minus, minus, minus and this is 是我们的减号，其他的，假设有 减号，减号，减号，这是
plus one. And now we have this, if you see this thing, that's a 2d array. That's a two 加一。现在我们有了这个，如果你看到这个 东西，那就是一个二维数组。那是两
dimensional array, that is also a two dimensional array. An array of two dimensional arrays 维数组，也就是二维数组 。二维数组的数组
is basically a three dimensional array. Now, that's a three dimensional array. This one, 基本上是一个三维数组。现在， 这是一个三维数组。这个，
C, so if you Oh, we have some, Oh, I should have defined this with commas. Rather than C，所以如果你哦，我们有一些，哦， 我应该用逗号来定义它。而不是
rather than spaces. Actually. Yeah. The reason I did that is MATLAB. I worked in MATLAB also. 而不是空格。实际上。是的。我这样做 的原因是 MATLAB。我也在 MATLAB 工作过。
So MATLAB allows this space separated list, but I just confuse the things with with Python 所以 MATLAB 允许这个空格分隔的列表 ，但我只是把这些东西与 Python 混淆了
as well. But Python requires comma, they're okay. With MATLAB. By the way, just as a side 以及。但是 Python 需要逗号，它们没问题 。用 MATLAB。顺便说一下，作为一个方面
note, MATLAB allows you to have commas as well as spaces, but this Python is just restricts 注意，MATLAB 允许你有逗号和 空格，但这个 Python 只是限制
everything to comma. That's great. Okay, that is C. So now, if you check c dot n them that 一切以逗号。那太棒了。好的，那是 C。 所以现在，如果你检查 c dot n them that
is three, if you for example, want to access this particular element, what should you do? 第三，如果你想访问这个特定 的元素，你应该怎么做？
First of all, you select the, the one of the 2d arrays, there are two 2d arrays. So this 首先，您选择 2d 数组之一， 有两个 2d 数组。所以这
is the first 2d array and that's the second 2d array. And if you For example, want to 是第一个二维数组，这是第二个 二维数组。如果你例如，想要
access this particular element, this particular element, which is minus three, if you want 访问这个特定的元素，这个特定的元素 ，它是负三，如果你想的话
to access that, you first have to access one of the two 2d, two dimensional arrays. 要访问它，您首先必须访问两 个二维二维数组之一。
So let's access the second one with the index one. Now you are in this particular 2d array 所以让我们用索引一访问第二个。 现在你在这个特定的二维数组中
in that array with list which 1d array you're talking about. So I'm talking about the very 在该数组中列出您正在谈论的一维数 组。所以我说的是非常
first 1d array, so the very first 1d array is indexed by zero, and in that one D array, 第一个一维数组，所以第一个一维数 组的索引为零，在那个 D 数组中，
which element you are talking about. So I'm talking about this element that has index 你在谈论哪个元素。所以我 说的是这个有索引的元素
two in this particular array. So now, if you press enter, you will get minus three Wow. 两个在这个特定的数组中。所以现在，如果 你按回车键，你会得到负三个哇。
So that is basically how and by the way, you can make a four dimensional array, a four 所以这基本上是如何以及顺便说一下，你可以 制作一个四维数组，一个四维数组
dimensional array will be an array of three dimensional arrays, and so on, you can make, 维数组将是一个由三个维数组组成 的数组，依此类推，您可以制作，
you can make, for example, n dimensional arrays, and that's one reason why we call this as 例如，您可以制作 n 维数组 ，这就是我们称其为
nd array, n dimensional array, not the type of C's nd array n dimensional array, you can nd数组，n维数组，不是C的nd 数组n维数组的类型，可以
add as many dimensions as you want. Great, we will continue exploring this NumPy more 添加任意数量的维度。太好了 ，我们将继续探索这个 NumPy
and more in in the upcoming videos in particular, I will talk about this shape property of this 尤其是在即将发布的视频中 ，我将讨论这个形状属性
NumPy we have already discussed D type we have discussed and then in the next video, NumPy 我们已经讨论过我们讨论过的 D 类型，然后在下一个视频中，
we will talk about shape and we will discuss more about about NumPy. So hope to see you 我们将讨论形状，我们将更多地 讨论 NumPy。所以希望见到你
in the next video. Okay, in the last video, we discussed this number of dimensions or 在下一个视频中。好的，在上一个视频 中，我们讨论了这个维度数或
ending property of any any NumPy array. And we also saw an example of defining a three 任何 NumPy 数组的结束属性。我们 还看到了一个定义三的例子
dimensional array in Jupyter. notebook. Let let's discuss another property which is which Jupyter 中的维数组。笔记本 。让我们讨论另一个属性
is the shape property. Let's see what what this shape actually represents. So let's go 是形状属性。让我们看看这个形状 实际上代表什么。所以我们走吧
to Jupyter Notebook and see what actually this shape represents. For example, you have 到 Jupyter Notebook，看看这个形状 到底代表什么。例如，你有
seen this C as in the last video, we define the C as a three dimensional array that contains 在上一个视频中看到了这个 C，我们 将 C 定义为一个三维数组，其中包含
two arrays of 2d. And each 2d array contains three 1d arrays, and each 1d array contains 两个二维数组。每个二维数组包含三 个一维数组，每个一维数组包含
three elements. So what do we mean by shape? So if we just say shape? What is that thing? 三个要素。那么我们所说的形状是什么意思呢？ 那么，如果我们只说形状呢？那个东西是什么？
So shape is 233. And let me tell you what that means. The return is tuple. So that's 所以形状是 233。让我告诉你这意味 着什么。返回是元组。所以那是
a tuple. That is returned to three and three. This two means how many two dimensional arrays 一个元组。那就是回到三和三。 这两个表示有多少个二维数组
are there? Here we have two. So in each two dimensional array, how many 1d arrays are 在那里？我们这里有两个。那么在每 个二维数组中，有多少个一维数组
there? Well, three in each one, the array? How many elements are there? Well, three. 那里？那么，每一个三个，阵列 ？有多少个元素？嗯，三个。
So basically, this C dot shape, zero, tells you the total number of two dimensional arrays, 所以基本上，这个 C 点形状， 零，告诉你二维数组的总数，
that is too. And this shape. For example. One tells you in each 2d array, how many 1d 那也是。还有这个造型。例如。一个 告诉你在每个 2d 数组中，有多少个 1d
arrays are there, these many? And this shape, for example, to tells you in each one the 阵列在那里，这么多？而这个形状 ，例如，告诉你在每一个
array, how many elements are there? Well, three grade? That's awesome. Yeah. Can I tell 数组，有多少个元素？嗯，三 年级？棒极了。是的。我能告诉
you 111 screens kind of thing? You can you can define a NumPy array, for example, a as 你的111屏是什么东西？您可以定义 一个 NumPy 数组，例如，作为
NP dot array with just one element, let's say two. That's an array raid. What's the 只有一个元素的 NP 点数组，假设 有两个。那是阵列突袭。是什么
number of dimensions here? What do you think? What is that? Is that a 1d array? What are 这里的维数？你怎么认为？那是什么 ？那是一维数组吗？什么是
the number of dimensions? Strange? It's a 1d array. Yeah, it is. see another thing? 维数？奇怪的？这是一个一维数组。 是啊，就是。看到另一件事了吗？
For example, b is equal to NP dot array. And you define it with let's say three. And what 例如，b 等于 NP 点阵。你用 三个来定义它。还有什么
are the dimensions of B, it looks like the same, the dimension of B should be one as 是B的维度，看起来一样 ，B的维度应该是一
as their the dimension of A is one, it looks like the dimension of B is also one. No, it's 因为他们的A的维度是一，所以看 起来B的维度也是一。不，它是
zero. Because that's an array. If you pass it as as a list. It's an array of one D if 零。因为那是一个数组。如果您将其作为 列表传递。它是一个 D 的数组，如果
you just define just one number that can be defined as an array NumPy allows you that 您只需定义一个可以定义为 数组的数字 NumPy 允许您
but that one number is just as a yo D array. Now if you can get in it, a lot of zero days, 但那个数字就像一个 yo D 数组。 现在如果你能进去，很多零日，
you get one day if you concatenate the last one days, you get a duty. If you're getting 如果你连接最后一天，你得到一天 ，你得到一个职责。如果你得到
a lot of duties, you get a 3d and so on. Get a look and feel Yeah. So that's what it is. 很多职责，你得到一个 3d 等等。看看 感觉 是的。所以就是这样。
So yes, In this video, I discuss the shape there is another There is there are so many 所以是的，在这个视频中，我讨论 的形状还有另一个 有这么多
properties, let me let me discuss some properties, let's size that actually tells the total number 属性，让我来讨论一些属性， 让我们实际告诉总数的大小
of elements complete total number of elements in the array. So, how many elements are there of elements 完成数组中元素的 总数。那么，有多少个元素
that is size. There is also I guess m bikes property, that tells the how many total number 那就是尺寸。还有我猜 m 自行车 属性，它告诉总数有多少
of bytes that the destructor is taking inside the memory. And there are several other I 析构函数在内存中占用的字节 数。还有其他几个我
mean properties, if you just apply a tab and get certain things, you will see a lot of 意思是属性，如果你只是应用一个选项 卡并获得某些东西，你会看到很多
functions. And you can you can check a lot of properties that some of these functions 职能。您可以检查其中 一些功能的许多属性
we will explore later on. Sometimes they are called the universal functions, we will see 我们稍后会探讨。有时它们被 称为通用函数，我们会看到
them because they are very, very fast. And these functions the vectorized implementation 因为它们非常非常快。而 这些函数是向量化的实现
of these functions. That is the reason why NumPy is so so fast, and why it is so popular. 这些功能。这就是 NumPy 如此之快的 原因，也是它如此受欢迎的原因。
Anyways, so in the next video, we will go to explore the NumPy a bit more. And we'll 无论如何，在下一个视频中，我们 将更多地探索 NumPy。我们会
show you more fun stuff with the NumPy. So hope to see you in the next video. NumPy actually 使用 NumPy 向您展示更多有趣的东西。所以 希望在下一个视频中见到你。 NumPy 实际上
provides a lot of functions to create arrays, special kinds of arrays just for testing. 提供了很多创建数组的函数，特殊 类型的数组只是为了测试。
And sometimes just for. I mean, there are a lot of ways to create arrays from scratch, 有时只是为了。我的意思是，有 很多方法可以从头开始创建数组，
for example, what if you want to create an array containing all zeros, so there is a 例如，如果你想创建一个包含 全零的数组，那么有一个
function in NumPy NP dot zeros that tells you how to do that. Similarly, if you want NumPy NP 点零中的函数告诉你如何 做到这一点。同样，如果你想
to generate a lot of generate an array containing a lot of ones or all ones, there is a function 生成很多生成一个包含很多个或 所有一个的数组，有一个函数
to do that and stuff like so, there are some functions that are actually used a lot and 要做到这一点，像这样的东西，有 一些功能实际上使用了很多，
I want to discuss those. One function is NP dot arrange, actually, this is a single R, 我想讨论这些。一个功能是NP点 排列，实际上，这是单个R，
this is not a two Rs, this is single r NP dot arrangement, one R and NP dot arranged 这不是两个 Rs，这是单个 r NP 点排列，一个 R 和 NP 点排列
function, what it does is it creates an array for example, if you say NP dot arrange, it 函数，它的作用是创建一个数组， 例如，如果你说 NP 点排列，它
creates an array for example, if you say okay, 100. So it creates an array that it creates 创建一个数组，例如，如果你说好的，100。 所以它创建一个它创建的数组
a 1d array that starts from the the values in that array starts from 012, all up to 99. 一个一维数组，从该数组中的值 开始，从 012 开始，一直到 99。
So that's an array. That's a quick way to create an array with all the numbers till 所以这是一个数组。这是创建包含 所有数字的数组的快速方法，直到
100. Yeah, so let's see, let's see running example of this NP arrange method in Jupyter 100. 是的，所以让我们看看，让我们看看 在 Jupyter 中运行这个 NP 排列方法的例子
Notebook just to get a better look and feel of how it works. So let's see. So let's say 笔记本只是为了更好地了解它的工作原理 。所以让我们看看。所以让我们说
we have a equals NP dot arrange. And let's see 100. So that's it. If you want to see 我们有一个等于 NP 点排列。让我们 看看 100。就是这样。如果你想看
what is inside a, you can see this is an array with all the values starting from zero up 里面是什么，你可以看到这是一个数 组，所有的值都是从零开始的
to 99. Maybe you want to create an array that starts from a particular number ends at a 到 99。也许你想创建一个数组，从 一个特定的数字开始，结束于
particular number. Maybe those two numbers are different. And maybe this arrange function 特定号码。也许这两个数字 不同。也许这个安排功能
actually allows that. Let's say I want to start with 20. And I want to end at 100. And 实际上允许。假设我想从 20 开始 。我想在 100 结束。然后
I want to create all the array that does that. So let's say this. So that's okay, start from 我想创建所有这样做的数组。所以 让我们说这个。所以没关系，从
20 and 100. But the last element last index is not included. That's possible. Last but 20 和 100。但不包括最后一个元素最后 一个索引。这是可能的。最后但
not the least, if you want for example, to start from 20 and add 100. And let's say you 至少，例如，如果您想从 20 开始并添加 100。假设您
want to take a jump of three. That's possible. Remember, does this does this resemble with 想跳三。这是可能的。请 记住，这是否类似于
something that you know already? Remember that? Yeah, let me pause for a minute, but 你已经知道的东西？还记得吗 ？是的，让我暂停一下，但是
not for a minute, just for some seconds. Let me pause. Do you remember this arrange NP 不是一分钟，只是几秒钟。让我暂停 一下。你还记得这个安排NP吗
dot brains function? It looks like something like what? Remember that for i in range? Yes. 点脑功能？它看起来像什么？ 还记得 i 在范围内吗？是的。
for i in range, for example, start from 20. Go 200. Take example three. Remember that? 例如，对于范围内的 i，从 20 开始。转到 200。以示例三为例。还记得吗？
So it has some resemblance with range function? Yeah. Although range is an arbitrator. 那么它与范围函数有一些相似之处吗？是 的。虽然 range 是一个仲裁者。
What's an arbitrator? why I'm telling you that? Okay, let me tell you an arbitrator 什么是仲裁员？我为什么要告诉你 ？好吧，让我告诉你一个仲裁员
as well here, just just just just spend a few seconds on on this range function. You, 同样在这里，只需在此范围 功能上花几秒钟即可。你，
you might be thinking when we call this range, let's say starting from, let's say range them, 当我们调用这个范围时，你可能会想， 假设从它们开始，假设它们的范围，
you might be thinking that it returns a list of numbers, starting from zero to nine, but 你可能会认为它返回一个数字 列表，从零到九，但是
that doesn't happen. It returns nothing. Actually, when you actually call it when you actually 这不会发生。它什么都不返回。 实际上，当你真正调用它时
call it it returns just an object. When you call it in a for loop or somewhere. It progressively 调用它它只返回一个对象。当您 在 for 循环或某处调用它时。它逐步
do. rounds one by one element one by one. So it returns an element, then it hydrates 做。一个一个元素一个一个地舍入。 所以它返回一个元素，然后它水合
and return another element that it never creates a list of elements, it now creates a list 并返回另一个从不创建元素列表的 元素，它现在创建一个列表
for you. That's awesome. Actually, it generates numbers, it generates the next number and 为你。棒极了。实际上，它生成数字 ，它生成下一个数字，然后
the next number as you move on. So it saves a lot of memory and these kind of objects, 继续前进时的下一个数字。所以它节省 了大量的内存和这些类型的对象，
they are called I craters that I played, they they never played. But if you want, for example, 他们被称为我玩过的陨石坑，他们 从来没有玩过。但如果你想，例如，
to get a list, if you really want to get a list, then what you can do is you can call 得到一个列表，如果你真的想得到一个列表 ，那么你可以做的就是你可以打电话
the range, let's say in the same way, and you can just write a list. So provide me a 范围，让我们以同样的方式说，你 可以写一个列表。所以给我一个
list don't just provide me an ID. And that will give you a list. How cool is that? Right? list 不只是给我提供一个 ID。这会 给你一个清单。多么酷啊？对？
Anyways, that was just a side note. It has nothing to do with this arrange function anyways. 无论如何，这只是一个旁注。 无论如何，它与此排列功能无关。
So NP dot arrange, it actually returns an array does not it is not like an iterator, 所以NP点排列，它实际上返回 一个数组，它不像迭代器，
it returns an array, complete array the way you want. So that's what this arrange is it 它返回一个数组，以您想要的方式 完成数组。所以这就是这个安排
has resemblance with this built in range function that mostly used in in for loops. Okay. Next, 与这个主要用于 for 循环的内置范围 函数相似。好的。下一个，
let's discuss this NP dot random dot permutation NP dot random is a package. And P is a package, 让我们来讨论这个 NP 点随机点排列 NP 点随机是一个包。而 P 是一个包，
it has a lot of sub packages inside random as a package. Random has a lot of modules 它有很多子包作为一个包随机 内部。 Random有很多模块
one module is permutation. There are a lot of other modules. So let's see this random. 一个模块是排列。还有很多其他模块 。所以让我们看看这个随机。
Let's see what it does. So for example, let's say a equals NP dot random dot, permutation, 让我们看看它的作用。例如，假设 一个等于 NP 点的随机点，排列，
let's say permutation. And what I do is I say okay, np dot arrange, let's see 10 what 让我们说排列。我做的是我说好的 ，np dot排列，让我们看看10个什么
it does is, this NP dot arrange will return an array containing all the values zero to 它确实是，这个 NP 点排列将返回 一个数组，其中包含所有零到
nine, these are 10 values, and then this permutation function that resides in the package and P 九，这些是10个值，然后是这 个包中的置换函数和P
dot random that is in the random packet of MP, it actually shuffles all the values and MP 的随机数据包中的 dot random， 它实际上将所有值打乱并
rearrange all the values in random fashion. And he will now be an array containing the 以随机方式重新排列所有值 。他现在将是一个包含
same elements, but in a different order in a different random order. So let me know print 相同的元素，但以不同的随机 顺序排列。所以让我知道打印
this a, it will be having all the elements from zero to nine bought in a really shuffled 这一个，它将在一个真正洗牌的 过程中购买从零到九的所有元素
away. And that shuffling is completely random. Yeah, you see that? Sometimes you may you 离开。这种洗牌是完全随机的。是 的，你看到了吗？有时你可能
may call some function, you may want to write some function on arrays. And you may want 可能会调用一些函数，你可能想在数组 上写一些函数。你可能想要
arrays that are that that do not have a particular ordering, there are just random arrays, just 没有特定顺序的数组，只有 随机数组，只是
to test your code just to test how it works on any kind of array. In that case, one way 测试您的代码只是为了测试它如何在任何类型 的数组上工作。在这种情况下，一种方法
of getting shuffled kind of array. One quick way is to just use NP dot random dot permutation 获得洗牌的数组。一种快速的 方法是只使用 NP 点随机点排列
function. The NP dot random package does not only have this permutation, there are a lot 功能。 NP点随机包不仅有 这个排列，还有很多
of other functions and be random, for example, np dot random random dot Rand int, for example, 其他函数的随机数，例如，np dot random random dot Rand int，例如，
Rand int, that creates a random integer. That's, for example, if I that's that, let me call Rand int，创建一个随机整数。那就是，例如 ，如果我就是那样，让我打电话
this and we have, how can it be used? Okay, you can give a low value from the very start, 这和我们有，如何使用？好的， 你可以从一开始就给一个低值，
we can give a high value, I mean, and it creates actually, random integers starting from low 我们可以给出一个高值，我的意思是，它 实际上创建了从低开始的随机整数
ending at high. So that's how it can be used. For example, let me call it as NP dot random 高位结束。这就是它的使用方式。 例如，让我将其称为 NP 点随机
dot Rand int, create a random number between 20 and 30, create some random integer, and dot Rand int，创建一个 20 到 30 之间的随机 数，创建一些随机整数，然后
it will return some random integer between 20 and 30. If we call it again, it may return 它会返回一些 20 到 30 之间的随机整数 。如果我们再次调用它，它可能会返回
some other is it is returning 30 again, 29. Again, and again. Now two turns 2932. Maybe 另一个是它再次返回 30、29。一次 又一次。现在两个回合 2932. 也许
we want to maybe want to generate random integer between 20 and 30. So it creates a random 我们可能想要生成 20 到 30 之间的随机 整数。所以它创建了一个随机
integer. One thing that you might be noticing what is the what is the return value? the 整数。您可能会注意到的一件 事是什么是返回值？这
return value? Is we for example, what should be the type of E or do you think? Is this 返回值？例如，我们应该是 E 的类型还是您认为？这是
V is an array? No, it is a number. It's an integer, the type of VA should be an integer V 是一个数组？不，它是一个数字。它 是一个整数，VA的类型应该是一个整数
because it is returning a random integer it is returning an integer but it is selecting 因为它返回一个随机整数它 返回一个整数但它正在选择
that integer randomly from 20 to 300. So it should be integer and it is Yes. Wow. 那个整数从 20 到 300 随机。所以 它应该是整数，是的。哇。
Yeah, 是的，
so we will be exploring some more functions in the random package of NP and then we will 所以我们将在 NP 的随机包中探索 更多的函数，然后我们将
be moving towards this fascinating function score function called V shape. So there is 正在朝着这个称为 V 形的迷人 功能评分函数迈进。所以有
more to come for NumPy so hope to see you in the next video. Okay in the last video 更多关于 NumPy 的内容，所以希望在下一 个视频中见到你。好的在最后一个视频
we saw a range function that's a very useful function to just create a test testing array 我们看到了一个 range 函数，这是一个非常 有用的函数，用于创建一个测试测试数组
and just see see the output of a particular operation or algorithm, just on different 并且只是查看特定操作或算法 的输出，只是在不同的
kinds of arrays. Further we saw permutation functions permutation function in NP dot random 数组的种类。进一步我们看到了 NP dot random 中的置换函数 permutation function
package. And we saw that this this permutation function, actually, it reshuffles, it shuffles 包裹。我们看到这个置换函数， 实际上，它重新洗牌，它洗牌
different kinds of odd if if array is applied to this permutation function, it actually 如果数组应用于这个置换函数 ，它实际上是不同的奇怪
shuffles all the, all the elements of that array in a random way in a completely random 以完全随机的方式随机 打乱该数组的所有元素
way. Today, we will explore this random package a bit more, and then we will see a reshape 道路。今天，我们将更多地探索这个随机包 ，然后我们将看到一个重塑
function, but that reshape does basically this reshape, for example, if you have an 功能，但 reshape 基本上是这种 reshape，例如，如果你有一个
array, let's say, array, is let's say we have an array with, let's say, 10 elements, and 数组，比方说，数组，比方说，我们有 一个数组，比方说，10 个元素，和
if we call a dot reshape, and we give, let's say, two by five, so it will make a two dimensional 如果我们调用一个点重塑，我们给， 比方说，2乘5，所以它会形成一个二维
array out of a, which is B, and that will be a two by five matrix R, that will be an a 中的数组，也就是 B，这将是一 个二乘五的矩阵 R，这将是一个
array, or a matrix with two rows and five columns. And now we can, we can just work 数组，或具有两行五列的矩阵。现在 我们可以了，我们可以工作了
with this B, just like it's a two dimensional array, and we can just, we can just treat 有了这个B，就像它是一个二维数 组，我们可以，我们可以处理
this B as a two dimensional array and work with that. It is it becomes handy sometimes 这个 B 作为一个二维数组并 使用它。是有时变得好用
if for example, we want to, we want to test certain operations on on matrices. A quick 例如，如果我们想要，我们想要在 矩阵上测试某些操作。一个快速
way to make a matrix is just to call arrange function, and then whatever the result is 制作矩阵的方法就是调用排列 函数，然后无论结果如何
just reshape it into the desired order matrix and test the algorithm. So let's go to the 只需将其重塑为所需的顺序矩阵 并测试算法。所以让我们去
let's go to Jupyter Notebook and check this random package a bit more and then see the 让我们去 Jupyter Notebook 再检查 一下这个随机包，然后看看
reshape function. So let's go to Jupyter. notebook. Yes, so there are a lot of ways 重塑功能。那么让我们来看看 Jupyter。 笔记本。是的，所以有很多方法
to generate these random numbers. One for example, we already have seen Rand int. And 生成这些随机数。一个例子， 我们已经看到了Rand int。和
other way for example, array, an array can be generated, like MP dot random dot RAND 其他方式例如数组，可以生成 数组，如 MP dot random dot RAND
function. So now, if we create this, if we create, let's if we pass let's say 1000, random 功能。所以现在，如果我们创建这个，如果 我们创建，让我们如果我们通过假设 1000，随机
value array will be generated in a and a each value of a will be a random number between 值数组将在 a 和 a 中生成， a 的每个值将是一个随机数
between zero and one. So all these numbers are just random between zero and one each 零和一之间。所以所有这些数字 都只是零到一之间的随机数
number is zero and one random number. And, and this distribution basically is the distribution number 是零和一个随机数。 而且，这个分布基本上是分布
of this random number is all the distribution is uniform. If for example, you want to plot 这个随机数的所有分布都是均匀 的。例如，如果您想绘制
the histogram, the histogram or the distribution of a it will look like uniform. Let me just 直方图，直方图或分布看起来 像均匀的。让我只要
give you give you one or two plots, using matplotlib package, although we will see matplotlib 给你一两张图，使用 matplotlib 包，虽然我们会看到 matplotlib
package later on. But let's assume that this is just a plotting package. This is just a 稍后打包。但是让我们假设这只 是一个绘图包。这只是一个
package that helps us plotting just import that import mat plot lib.pi plot as PLT import 帮助我们绘图的包只需导入导入 mat plot lib.pi plot 作为 PLT 导入
that. And after importing that, you just plot a histogram PLT dot hist, for example, and 那。导入后，您只需绘制直方图 PLT 点直方图，例如，
pass a and you can see the histogram is roughly uniform. I mean, everything is equally likely 通过 a，您可以看到直方图大致均匀 。我的意思是，一切都有可能
we can make more bands, for example, we can have bands, equals let's say 100. And we can 我们可以制作更多条带，例如，我们 可以有条带，等于 100 个。我们可以
see almost all events they are I mean just look like uniform. If we make more and more 看到几乎所有的事件他们是我的意思只是 看起来像制服。如果我们做的越来越多
data set, then they will all look uniform. One more thing we can we can have, for example 数据集，那么它们看起来都是统一 的。我们可以拥有的另一件事，例如
this. And let's say B equals NP dot random dot Rand n, and that generates normal random 这个。假设 B 等于 NP 点随机点 Rand n，这会生成正常随机点
numbers, or Gaussian random numbers, let's say which which the distribution of the numbers 数字，或高斯随机数， 让我们说哪个数字的分布
are is the bell shaped curve, for example, so let's just PLT dot haste B. And then let's 例如，是钟形曲线，所以让我们 只是 PLT 点急速 B。然后让我们
say equal to 200. And we can see a bell shaped curve because the distribution of this data 说等于 200。我们可以看到一个钟形曲线 ，因为这个数据的分布
is is Gaussian distribution looks like so. So this this random packages, this NP dot 是高斯分布看起来像这样。所以 这个这个随机包，这个NP点
random is really important package. It has different, it can create different kinds of 随机是非常重要的包。它有不同 的，它可以创造不同种类的
random numbers from following from different distributions and doing in machine learning 来自不同分布的随机数 并在机器学习中进行
or in statistics, sometimes we need to generate these kinds of random numbers for sometimes 或者在统计学中，有时我们需要为 有时生成这些类型的随机数
for testing purposes, sometimes for adding noise of a particular type to test our model 用于测试目的，有时用于添加特定 类型的噪声来测试我们的模型
and stuff like so. So it's good to have a good grip on NP dot random package. Okay. 和这样的东西。所以掌握好 NP点随机包就好了。好的。
Next we see reshape function. One more thing. For example, if you want to create, for example, 接下来我们看到reshape函数。还有一 件事。例如，如果您想创建，例如，
a two dimensional array of just random numbers, let's say you can call NP NP dot random dot 一个仅包含随机数的二维数组，假设 您可以将 NP NP 点称为随机点
Rand. And you can just call a, you can just pass two arguments, for example, two by three, 兰德。你可以只调用a，你可以只传递 两个参数，例如，两个乘三个，
and the C will be a two by three matrix. If you see the C, it will be a two by three matrix 而 C 将是一个二乘三的矩阵。如果 您看到 C，它将是一个二乘三矩阵
of four random values. If you see c dot, and then it will be having the dimensions are 四个随机值。如果你看到 c 点，那么它的尺寸是
two. And it's a two dimensional array. Further, we can create, for example, a four dimensional 二。它是一个二维数组。此外，我们 可以创建，例如，一个四维
array c equals NP dot random dot Rand, maybe two by three by four by two. And that's a 数组 c 等于 NP 点随机点 Rand，可能 是二乘三乘四乘二。这是一个
four dimensional array with this particular order. So if you see this C dot m, then that 具有此特定顺序的四维数组。所以 如果你看到这个 C 点 m，那么
will be level b, this. Yeah, so let me let me just give you an interpretation of what 将是B级，这个。是的， 让我让我给你解释一下
that thing is. There are two arrays that are three dimensional. And there are two of those. 那件事是。有两个三维数 组。其中有两个。
Okay? Now, each three dimensional array has three two dimensional arrays. Wow. 好的？现在，每个三维数组都 有三个二维数组。哇。
So each 所以每个
two dimensional array has four one dimensional arrays, and each one dimensional array has 二维数组有四个一维数 组，每个一维数组有
two elements in it. So that's what the structure is. Yeah, get a good look and feel. So let's 其中的两个元素。所以这就是结构。是的， 获得良好的外观和感觉。那么让我们
see the reshape function. For example, let's say we have d equals NP dot range. Let's say 请参阅重塑功能。例如，假设我们 有 d 等于 NP 点范围。让我们说
we have 100 values. And then we say reshape these 100 values to let's say, let's say four 我们有 100 个值。然后我们说重塑这 100 个值，让我们说，让我们说四个
by 25. So this D will be a four by 25 matrix. So if we just get the shape of D, so that 乘以 25。所以这个 D 将是一个四乘 25 的矩阵。 所以如果我们只是得到 D 的形状，那么
will be a four by 25 matrix or a two dimensional array with four rows and 25 columns. Yeah, 将是一个四乘 25 的矩阵或一个四 行 25 列的二维数组。是的，
so sometimes we want to work on matrices, and we just, we can just plug in these arrays 所以有时我们想要处理矩阵，我们 只是，我们可以插入这些数组
function to generate a bunch of numbers. And then we can reshape those and build a matrix 函数生成一堆数字。然后我们 可以重塑它们并构建一个矩阵
quickly, and then just test the performance of our algorithm or stuff like so. So, not 很快，然后测试我们算法的性能 或类似的东西。所以，不
only the reship not only returns the, the I mean, you can you can reshape a matrix, 只有 reship 不仅返回，我的意思 是，你可以重塑一个矩阵，
and you can reshape an array into more than two dimensional array if you want to, for 如果您愿意，您可以将数组重塑 为二维以上的数组，例如
example, arrange 100, let's say dot reshape, maybe or as four by five by five, it's a three 例如，排列 100，让我们说点重塑， 也许或作为四乘五乘五，这是一个三
dimensional array. Now, this D will be a three dimensional array containing different values. 维数组。现在，这个 D 将是一 个包含不同值的三维数组。
Yeah, so now you can access it and do whatever you want to do. So not only the reshape, arrange 是的，所以现在您可以访问它并做任何 您想做的事情。所以不仅重塑，安排
and permit random, there are other functions as well NP dot zeros. For example, if you 并允许随机，还有其他功能以及 NP 点零。例如，如果你
press z, and you just see the zeros, and then you just press the question mark, you will 按z，你只看到零，然后你 只要按问号，你就会
know what that function is how can we use it and so on. Similarly, you can have several 知道那个函数是什么，我们如何 使用它等等。同样，你可以有几个
other function there is an important function once for example, you can call that function, 其他函数有一个重要的函数， 例如，你可以调用那个函数，
and that will generate an array of all ones, you can see how to call that function here. 这将生成一个包含所有 1 的数组，您 可以在此处查看如何调用该函数。
There is NP dot empty, there is NP dot empty, like there are so many functions just to create 有 NP 点空，有 NP 点空，就像 有这么多功能只是为了创造
some matrices very quickly. And you want to test your core algorithms based on those. 一些矩阵很快。并且您想基于 这些来测试您的核心算法。
So yeah, so there are a lot of functions that we want to that we can work on. So next, so 所以是的，所以有很多我们想要的 功能我们可以处理。那么接下来
there are a lot of functions that can quickly create a NP array and an n dimensional array. 有很多函数可以快速创建 NP数组和n维数组。
That we can quickly create an array test or algorithm or use the array wherever we want 我们可以快速创建数组测试或算法 或在任何我们想要的地方使用数组
to like we're everyone to use. And we can move on just a few functions like arranged 喜欢我们每个人都可以使用。我们 可以继续进行一些功能，例如排列
ones zeros, they are there are random dot Rand random dot Rand n, and other functions 一个零，它们有随机点Rand随机 点Rand n，以及其他函数
they are available. For In the next video we will be seeing we will be seeing the indexing 他们是可用的。在下一个视频 中，我们将看到我们将看到索引
or slicing inside NumPy array and we will also be seeing the difference of that indexing 或在 NumPy 数组中切片，我们 还将看到该索引的差异
with or slicing from the array In the list or or are the ordinary data structures? What with or slicing from the array 在列表 中还是普通数据结构？什么
is the difference in? What is the difference of slicing in NumPy? with for example, with 区别在于？ NumPy中切片的 区别是什么？例如，与
the list, we will see that in the in the next video, hope to see you in the next video. 列表，我们将在下一个视频中看到， 希望在下一个视频中见到您。
Okay? 好的？
Here is my favorite topic in NumPy slicing. Actually, indexing or slicing in NumPy is 这是我在 NumPy 切片中最喜欢的主题。 实际上，在 NumPy 中索引或切片是
the way you access sub arrays is just the same as the way you access sub strings or 访问子数组的方式与访问子 字符串的方式相同，或者
sub lists. And you already have seen, how can we how can we use the slicing or indexing 子列表。你已经看到了， 我们如何使用切片或索引
in lists and in strings, the difference here in NumPy is in list for example, if you slice 在列表和字符串中，NumPy 中的区别 在于列表，例如，如果您切片
you get, for example, let's say B equals a one colon five, if you slice that thing, from 你得到，例如，假设 B 等于一个冒号 5，如果你把那个东西切片，从
NumPy, then B is not a copy, it is actually accessing the same memory view as an A. Now, NumPy，那么 B 不是副本，它实际上是 访问与 A 相同的内存视图。 现在，
if you change any element in B, the corresponding element in a will change as long as as a NumPy 如果你改变了 B 中的任何一个元素，a 中对应 的元素就会改变，只要是一个 NumPy
array. However, if A is a list or any other data structure, ordinary data structure, then 大批。但是，如果 A 是一个列表或任何 其他数据结构，普通数据结构，那么
the slicing this, this kind of slice gives a copy rather than a view. So that's an important 切片这个，这种切片给出了一个副本 而不是一个视图。所以这是一个重要的
difference, we need to know that rest of the indexing technique is almost the same. You 不同之处，我们需要知道其余 的索引技术几乎相同。你
do this kind of indexing that is how you can reverse this a start and step all all the 做这种索引，这就是你如何扭转 这一开始并逐步完成所有
things are same, except How can play How can we play with the two dimensional arrays. Let's 事情是一样的，除了如何玩我们 如何玩二维数组。让我们
let let's see that. Let's see some examples of indexing one by one in in Jupyter Notebook 让我们看看。来看看在 Jupyter Notebook 中一一索引的一些例子
and see how the slicing actually creates a view rather than a copy. So let's go to our 并查看切片实际上如何创建视图而 不是副本。所以让我们去我们的
Jupyter Notebook and see how can we play with different indices, let's say a is NP dot arrange, Jupyter Notebook 看看我们如何玩不同 的索引，假设 a 是 NP 点排列，
and B dot arranged, let's say 100. And let's shuffle them. Let's say as it is, let's say 和 B 点排列，比方说 100。让我们把它们 洗牌。让我们照原样说，让我们说
that's a now a, let's say, let's bring some certain things. Let's A B equals a big all 那是现在，比方说，让我们带来 一些东西。让我们 A B 等于全部
the elements starting from index three, ending at index nine, Sudan is not included. That's 从索引三开始到索引九结束的元素 ，苏丹不包括在内。那是
B, that's blank v. Let's see what's B. So b is this array. Okay? Now what I'm going B，那是空白 v。让我们看看 B 是什么。所以 b 就是这个数组。好的？现在我要做什么
to do is I'm just changing the contents of b, this NumPy array is mutable, you can change 要做的是我只是改变b的内容，这个 NumPy数组是可变的，你可以改变
the elements inside, no problem. So I'm going to change the elements, let's say one element 里面的元素，没问题。所以我要 改变元素，让我们说一个元素
in B, let's say, I'm going to change element numbers zero, and B, which is three, and I'm 在 B 中，比方说，我要更改元素编号 为零，而 B，也就是三，我要
just placing that element as minus 100 minus 1200. That's it. That's the case. Okay, now 只需将该元素放置为负 100 减 1200。就 是这样。就是这样。好的，现在
the contents of B has been changed. We are but now let's see the contents of a the contents B 的内容已更改。我们是， 但现在让我们看看内容的内容
of a also has changed. That's a big difference between slicing an ordinary Lester adini data 的一个也变了。这与切片普通的 Lester adini 数据有很大的不同
structure or slicing a list, when you slice a list, you get us you get another label, 构造或切片列表，当你切片一个列表时 ，你得到我们，你得到另一个标签，
but that label or that variable is accessing the same memory, the memory actually is not 但是那个标签或那个变量正在访问 相同的内存，内存实际上不是
copied. There is one memory view. And these two different names, whether you access those 复制的。有一种内存视图。这两 个不同的名字，无论你访问那些
elements using B, or you access those elements using a the same memory is being accessed 使用 B 的元素，或者您使用正在访问 的相同内存访问这些元素
if you change the memory using B or A you will see the effect in both of the variables. 如果您使用 B 或 A 更改内存， 您将在两个变量中看到效果。
So that's one difference. Now, after having knowledge of this difference, if we really 所以这是一个区别。现在，在了解 了这种差异之后，如果我们真的
want this behavior to not happen, one thing that we can call is we can say okay, a, for 希望这种行为不会发生，我们可以称之为 的一件事是我们可以说好的，a，因为
example, a, let's say three to 10. And then we can call our famous function, remember 例如，a，比方说 3 到 10。然后我们 可以调用我们著名的函数，记住
that copy, you can copy that and now B is completely a different array. It's it's a 那个副本，你可以复制那个，现在 B 是一个完全不同的数组。它是一个
different memory view, if you change B now, the effect will not be seen in a so copy function 不同的内存视图，如果现在更改 B，在so copy函数中将看不到效果
is there whenever you need copy. One thing if you are not going to change elements the 需要复印的时候就在那里。如果 你不打算改变元素的一件事
number is applies you very fast implementation of slicing by not changing the memory view number 是通过不更改内存视图 来非常快速地实现切片
if if you are aware, your algorithm is not going to change the elements slicing will 如果你知道，你的算法 不会改变元素切片
give you much much efficient access to the elements or the or the sub blocks or sub arrays 为您提供对元素或子块 或子数组的高效访问
without actually making the copies inside the memory which can take time and space both. 无需在内存中实际制作副本 ，这可能需要时间和空间。
So this is one plus of NumPy Over the over the other data structure that we have seen 所以这是 NumPy 的一个优势，而不 是我们已经看到的其他数据结构
so far in Python, okay, let's play with indices, 到目前为止，在 Python 中，好吧，让我们使用索引，
let's say what do you think? What is that thing? colon, colon to what? Or colon colon, 让我们说你怎么看？那个东西是什么 ？冒号，冒号是什么？或结肠结肠，
let's say five, what it will do, it will start from the very first index, which is zero, 让我们说五个，它会做什么，它会 从第一个索引开始，它是零，
it will go to the last index, but it will pick every fifth element. So let's see. So, 它将转到最后一个索引，但它会选择每 五个元素。所以让我们看看。所以，
it picks zero then five then 10, then 15, because the jump is five break, what do you 它选择零，然后是 5，然后是 10，然后 是 15，因为跳跃是五个中断，你怎么办
think what this will do? Let me just let me just teach you by example, what this will 想想这会做什么？让我就让我通过 例子来教你，这会是什么
do. Yeah, what it will do remember, if you apply a minus here, the end and the start 做。是的，它会做什么记住，如果 你在这里应用减号，结束和开始
and end they just get swept, and this becomes a step from from the end. So, what will happen 和结束他们只是被横扫，这成为距离 结束的一步。那么，会发生什么
is the same kind of impact, you start from the very end, then you take the step of minus 是同一种冲击，你从最后 开始，然后你一步减
one from the end, and you just based every element, so this is kind reversing the array 从最后一个，你只是基于每个 元素，所以这是一种反转数组
with with kind of step starting at the end rate. So, another way of reversing the array 以一种从最终速率开始的步骤。 所以，另一种反转数组的方法
is if you want to reverse the array as a whole display minus one, which means start from 是如果你想将数组作为一个整体 显示减去一，这意味着从
the end and pick every element from the end till the beginning and the end, and the array 结束并选择从结尾到开头和 结尾的每个元素，以及数组
will be reversed. This element is there, remember that this is there, let's chain that element. 将被逆转。这个元素在那里，记住这个 就在那里，让我们链接那个元素。
Let's chain that element. So, so a adds position. So, I want to find out the index, where this 让我们链接那个元素。所以，所以增加了 位置。所以，我想找出索引，这里
minus 1200 is located. So Id x is equal to a dot index I guess there is a function index 负1200位于。所以Id x 等于一个 点索引我猜有一个函数索引
Yes, he has a no index Oh, there is no index there. Is there an MP dot index and P dot 是的，他有一个没有索引哦，那里没有 索引。是否有 MP 点索引和 P 点
index? I want to find out the index where so in DAX there is no index function indices 指数？我想找出在 DAX 中 没有索引函数索引的索引
or something, I want an index function is there any index function I want to find out 或者什么，我想要一个索引函 数有没有我想找出的索引函数
the index? Where minus 200 is located? There are several ways but I want to find one. So 指数？负 200 在哪里？有几种方法 ，但我想找到一种。所以
for example, for example, let me see whether there is an index function and not available 比如我看看有没有 索引功能不可用
in NumPy or not. No, it is no longer there. But there is in the CS function, I guess. 在 NumPy 中与否。不，它已经不在 了。但我猜在 CS 功能中有。
So in the CS, what that does, I guess that does the same job. Let me see MPR indices 所以在 CS 中，它的作用是什么，我想它也 能完成同样的工作。让我看看 MPR 指数
returns an array representing the indices of a grid, okay. So I have to give a grid 返回一个表示网格索引的数组， 好吧。所以我必须给一个网格
and then it returns for example, the indices of all that grid, how can I use that? Well, 然后它返回例如所有网格的索引 ，我该如何使用它？好，
it becomes it becomes difficult, there may be a find function, or how can you locate 变得很困难，可能有查找 功能，或者如何定位
the index where the minus 200? Is, is located? How can I How can I do that? 负200的指数在哪里？是，位于？我 怎么办 我怎么办？
Huh? 嗯？
Yeah, very difficult. Seems like very difficult. Oh, why don't I rather than finding out a 是的，非常困难。好像非常困难 。哦，我为什么不找一个
function? Why don't I just play with play with the NumPy? Why not? So let's say a equal 功能？为什么我不玩玩 NumPy？为什么 不？所以让我们说一个相等的
equals minus 1200. That gives me a Boolean array comparing each and every element with 等于负 1200。这给了我一个 布尔数组，将每个元素与
minus 1200. So, the array the returning array, let me call the index array or the Boolean 减去 1200。所以，数组返回数组， 让我调用索引数组或布尔值
array, let's be that array is true or false array or zero or one array, wherever there 数组，让我们将该数组是真或假数组 或零或一个数组，无论在哪里
is minus 1200, that index is one that value is one otherwise it is zero, completely zero. 为负 1200，该索引为 1，该值 为 1，否则为零，完全为零。
And then what I do is, I just multiply that with with NP dot arrange NP dot arrange with 然后我要做的是，我只是将其 乘以 NP 点排列 NP 点排列与
with saying that a dot A dot A dot size, so whatever the size of A is, so because these 说一个点 A 点 A 点的大小，所以 不管 A 的大小，所以因为这些
are the indices Okay, then what that's point wise multiplication grade. So, when I will 是指数 好的，那么点乘法等级 是什么。所以，我什么时候
multiply them together, what I will get is is what I will get from multiplication, I 将它们相乘，我将得到的是 我将从乘法中得到的，我
will get, how can I How can I find out actually, a train lost here literally, how can I find 会得到，我怎么能我怎么才能发现，一列火车 真的在这里迷路了，我怎么能找到
out how can I find out the index where Where am I? So that will give me what? Let's see, out 我怎样才能找到我在哪里的索引？ 那会给我什么？让我们来看看，
what is B. Now, the B is B is just an array. B is just an array, and there is this three. 什么是B。现在，B is B 只是一个数组 。 B 只是一个数组，有这三个。
That is looking at it. So how can I find out? Where is this three? How can I, again, the 那就是看着它。那我怎样才能知道呢？ 这三个在哪里？我怎样才能再次
problem is finding out the index. Okay, that's, that's really a bad thing. Can I call this 问题是找出索引。好吧，那就是，这真的 是一件坏事。我可以叫这个吗
aid dot indices? And just give a minus 1200. And everything just worked out? No, there 援助点指数？只需给一个负 1200。 一切都解决了吗？不在这里
is an error, there is an error. Oh, I'm lost here. Literally, I'm lost here, I need to 是错误，有错误。哦，我在这里迷路了 。从字面上看，我迷路了，我需要
know how to find out the index where this particular element minus 1200 lies. So 知道如何找出这个特定元素减去 1200 所在的索引。所以
that's a 那是一个
question for you as well. I'm also lost. So let's see you in the next video. And we first 也问你。我也迷路了。那么让我们 在下一个视频中再见。而我们首先
will solve this problem to finding out the index of a particular element, or maybe a 将解决这个问题以找出特定 元素的索引，或者可能是
lot of elements. And then we will continue from there onwards to see more indexing. Okay, 很多元素。然后我们将继续从 那里开始查看更多索引。好的，
great. So hope to see you in the next video by first solving the problem, how to find 伟大的。所以希望在下一个视频中 看到你首先解决问题，如何找到
out the index of a particular element in a NumPy array, or maybe more than one elements 找出 NumPy 数组中特定元素的索引 ，或者可能不止一个元素
in a NumPy array. And then we will be practicing more about these slicing examples. Okay, hope 在 NumPy 数组中。然后我们将更多地 练习这些切片示例。好的，希望
to see you in the next video. Okay, let's say this element is there. And let's say we 下个视频见。好的，假设这个 元素在那里。假设我们
want to, we want to locate that element in the array, we want to just know where this 想要，我们想要在数组中定位 那个元素，我们只想知道这个
element is in the array. So array has this element. Let's let me paint array as it is, 元素在数组中。所以数组有这个 元素。让我按原样绘制数组，
this array has this particular element, and we want to know where what is the index of 这个数组有这个特定的元素， 我们想知道它的索引在哪里
this element inside the array, there are several ways of doing this. One way is to find out 数组中的 this 元素，有几种方法可以 做到这一点。一种方法是找出
their index is simply you call the function arc where arc where for example, org, where 他们的索引只是你调用函数 arc where arc where 例如，org, where
A is equal to minus 1200. And that will return a 2d array. And if you just want any one index, A 等于负 1200。这将返回一个二维数 组。如果你只想要任何一个索引，
then you return that kind of thing. So if you write this thing, you will get the index 然后你返回那种东西。所以如果 你写这个东西，你会得到索引
exactly of the element that is there. So the index is three, if you want to change that 正是那里的元素。所以索引 是三，如果你想改变它
value, for example, the value should be three here, if you want to change that value, what 值，例如这里的值应该是3，如果 你想改变那个值，怎么办
you can do is you can right, okay, ie x is equal to three, and is reverse to its position 你可以做的是你可以对，好吧， 即 x 等于 3，并且与它的位置相反
wherever it was created, okay, great. Now, let's play with the two dimensional indices. 无论它在哪里创建，好吧，太好了 。现在，让我们使用二维索引。
Let's do dimensional arrays, let's say we have a equals NP dot random dot, Rand, let's 让我们做多维数组，假设我们有一 个等于 NP 点的随机点，Rand，让我们
say, let's say we have a five by four matrix, let's say a two dimensional array, let's round 比方说，假设我们有一个五乘四的矩阵 ，假设一个二维数组，让我们四舍五入
all the values by multiplying them to 10. What it does is because all the values this 所有的值都乘以 10。它 的作用是因为所有的值
RAND function, all the values it generates are the values between zero and one, what RAND函数，它生成的所有值 都是0到1之间的值，什么
this multiplied by 10, what it does is, it actually scales up all the values to 10. And 这乘以 10，它的作用是，它实际上 将所有值放大到 10。并且
then round function, actually, round downs are actually rounds the values to the integers. 然后 round 函数，实际上，舍入 实际上是将值四舍五入为整数。
Now a will be worse the problem round that third round method is no longer there. Okay, 现在，第三轮方法不再存在 的问题将变得更糟。好的，
maybe there is NP naught round, maybe that NP dot round, maybe NP dot round is their 也许有 NP 零圆，也许那个 NP 圆点圆 ，也许 NP 圆点圆是他们的
Yes, and B dot round. So round function of NP. So this a is a is this array, for example, 是的，还有 B 点圆。所以 NP 的圆函数 。所以这个 a is a is this 数组，例如，
that's five by four, a four, five rows and four columns. So let's say I want to access 那是五乘四，四，五行和 四列。所以假设我想访问
the second row. First of all, let's say I want to access this particular entry. This 第二行。首先，假设我想 访问此特定条目。这个
particular entry is second row and third column, which means the index is one comma two, because 特定条目是第二行第三列，这意味 着索引是一个逗号二，因为
second row means the row row first has index zero. row two has index one. Similarly, column 第二行表示第一行的索引为零 。第二行有索引一。同样，列
one has index zero, column two has index two, a one and column three has index two. So that 一有索引零，第二列有索引二 ，一和第三列有索引二。以便
is what this particular entry is. What if we want to access the whole second row, for 就是这个特定的条目。如果我们 想访问整个第二行怎么办，对于
example, we want the second row. So that's how you call that's how you slice. A normal 例如，我们想要第二行。所以这就 是你所说的切片方式。一个正常的
meaning of this is you the role should be one and the columns, all the columns, so That's 这意味着你的角色应该是一 列，所有的列，所以那就是
how you access the whole second row. If you want to, for example, access the whole third 您如何访问整个第二行。例如 ，如果您想访问整个第三个
row, for example, or a whole second column, let's say that means you say this, okay, the 例如，行，或者整个第二列，假设 这意味着你说这个，好吧，
column number second, and all the rows, which means the whole second column that is accessed. 列号秒和所有行，这意味 着访问的整个第二列。
That if you see, that's the whole second column six, four to 10. And one, that's what the 如果你看到了，那就是整个第二列第六 、四到十。还有一，这就是
second column is. Further, once you have a, you can, you can, for example, access a sub 第二列是。此外，一旦你有一个， 你可以，例如，你可以访问一个子
matrix, let's say you want, you want row number one to rule number three, not including three. 矩阵，假设你想要，你想要第一 行来规则第三，不包括三。
And then of these rows, you want column number two to column number 然后在这些行中，您希望第二 列到列号
four, let's say. And if you do that, you access the whole sub matrix. First, it actually picks 四，说吧。如果你这样做，你就可以访问 整个子矩阵。首先，它实际上选择
row number two and row number three, because row number two starts from one. And then of 第二行和第三行，因为第二 行从一开始。然后是
those rows, it picks these columns, and you can just pick the pick the sub matrix inside 那些行，它选择这些列， 你可以选择里面的子矩阵
more, you can, you can do a lot of processing on these matrices. For example, this is matrix 更多，你可以，你可以对这些矩阵 做很多处理。例如，这是矩阵
A, if you just type a dot transpose, that these four transpose, the matrix just is taken A、如果只打一个点转置， 那这四个转置，矩阵刚好取
transpose of it. Further, there is a complete library, linear algebra library in NumPy. 转置它。此外，NumPy 中有一个 完整的库，线性代数库。
For example, if you just import NumPy NumPy dot linear algebra, as a for example, then 例如，如果您只是导入 NumPy NumPy 点线性代数，例如，那么
this linear algebra library in NumPy, has a lot of functions, Eigen values, chelski NumPy 中的这个线性代数库，有 很多函数，特征值，chelski
decomposition, computing determinant of a matrix, finding out inverse of a matrix and 分解，计算矩阵的行列式 ，找出矩阵的逆和
what not. For example, let's say we have la dot inverse, and here is NP dot random dot 什么不是。例如，假设我们有 la dot inverse，这里是 NP dot random dot
Rand, let's say, some three by three matrix. So what it returns is, it returns the inverse 兰德，比方说，一些三乘三矩阵 。所以它返回的是，它返回逆
of this matrix, and this linear algebra library, and there are other libraries as well. But 这个矩阵，这个线性代数库 ，还有其他库。但
this is one scientific library, that may be most of data science experts who actually 这是一个科学图书馆，实际上 可能是大多数数据科学专家
want to do research, they might be thinking, this linear algebra library, that that specifies 想做研究，他们可能会想 ，这个线性代数库，它指定
a lot of functions related to related to these matrices or two dimensional arrays. So that 很多与这些矩阵或二维数组 相关的函数。以便
is there. Okay, so that's about indexing. We can play with these indices a lot if we 在那儿。好的，这就是索引。如果 我们可以经常使用这些指数
want. One more thing, just just one. One last thing, let's say this is our a. And what we 想。还有一件事，只是一件事。最后一 件事，让我们说这是我们的 a.而我们
want to do is let's say we want to sort this A with respect to the columns, we want each 想要做的是假设我们要根据列对这个 A 进行排序，我们希望每个
column to be sorted individually, what we can do is we can call sort function, and we 要单独排序的列，我们可以做的 是我们可以调用排序函数，我们
can pause X's equals zero, access equals zero, that means sort all the columns individually 可以暂停 X 等于零，访问等于零， 这意味着单独对所有列进行排序
and the result will be if you see the result, the result will be every column is sorted 结果将是如果您看到结果，结果 将是每一列都已排序
individually. If we want to sort for example, every row individually, we will say okay, 个别。例如，如果我们想对每一行 单独排序，我们会说好的，
sort x is equals one, and every row will be sorted individually. And if this is a multi sort x 等于1，每一行都将单独 排序。如果这是一个多
dimensional array more than three more than two dimensions, then x is can be two x's can 多维数组多于三个多于二维， 那么x是可以是两个x的可以
be free. So which with respect to whatever axes you want, your sorting can happen. It 是自由的。因此，对于您想要的任何 轴，您的排序都可以发生。它
can do that, if A is one dimensionally, then dot sort function without an access, just 可以做到这一点，如果 A 是一维的， 那么点排序功能无需访问，只需
sorts just sorts the one dimensional array from beginning to the end. And if you want sorts 只是从头到尾对一维数 组进行排序。如果你愿意
to descending order a sword just sought them sorted first and then reverse it using indexing. 以降序排列剑只是先将它们排序 ，然后使用索引将其反转。
Great, I mean, there is a lot to discuss, there is a lot to discuss, I'm ending this 太好了，我的意思是，有很多要讨论 的，有很多要讨论的，我要结束了
slicing here. In the next video, I'm going to show you kind of masking or sometimes called 在这里切片。在下一个视频中， 我将向您展示某种掩蔽或有时称为
the fancy indexing that is much more powerful and useful in a lot of different contexts. 在许多不同的上下文中更强大 和有用的花哨索引。
So hope to see you in the next video with more NumPy indexing. Okay, there is another 所以希望在下一个视频中看到更 多 NumPy 索引。好吧，还有一个
way of indexing a NumPy array. In the last video we saw we can, we can do slicing notation, 索引 NumPy 数组的方法。在我们看到的 最后一个视频中，我们可以做切片符号，
for example, start from here and here and stuff like so. There is another way of accessing 例如，从这里和这里开始， 诸如此类。还有一种访问方式
a NumPy array as we have an array and we can just give the give an index array inside for 一个 NumPy 数组，因为我们有一个数组 ，我们可以在里面给出一个索引数组
example. Let's say a is one dimensional array and then we just give 146 that means big element 例子。假设 a 是一维数组，然后 我们只给出 146，这意味着大元素
at index one, pick the element at index four, pick the element at index six. So this kind 在索引 1 处，选择索引 4 处的元素， 选择索引 6 处的元素。所以这种
of array inside can be a list or an array. That is called an index array. And you can 里面的数组可以是列表或数组 。这称为索引数组。你可以
just pick the elements that you want to pick, for example, you want to pick all all elements, 只需选择您要选择的元素， 例如，您要选择所有元素，
you want to pick first element, fifth element and 17th element, you can just create an index 你想选择第一个元素、第五个元素和 第 17 个元素，你可以创建一个索引
array and pass it. And in an index your and access your elements using that index array 数组并传递它。并在索引中使用 该索引数组访问您的元素
that's possible in NumPy array. Further, you can access different elements using a Boolean 这在 NumPy 数组中是可能的。此外， 您可以使用布尔值访问不同的元素
mask as well. So Boolean array, for example, true, true, false false, wherever there is 面膜也是如此。所以布尔数组，比如 true、true、false false，只要有
a true pick that element wherever there is a false, don't pick that element and return 一个真正的选择那个元素，只要有一 个错误，不要选择那个元素并返回
the elements that are picked. For example, assuming here that you have an array, which 选取的元素。例如，假设 这里有一个数组，它
is one dimensional array, let's say, assume that has eight elements, 12345678 elements. 是一维数组，假设有八个 元素，12345678 个元素。
Now you pass a Boolean mask inside, where with with obviously, eight elements, a true 现在你在里面传递一个布尔掩码， 其中显然有八个元素，一个真正的
or false values, wherever there is true. So pick the very first value, pick the second 或假值，只要有真值。所以选择 第一个值，选择第二个
value, pick the don't pick the third value, don't pick the fourth value, pick the fifth 值，选择不选择第三个值，不 选择第四个值，选择第五个值
value, pick the sixth value, pick the seventh value, and don't pick the last value. So that 值，选择第六个值，选择第七个 值，不要选择最后一个值。以便
is also possible in in NumPy. One thing that is important is if you do this kind of indexing, 在 NumPy 中也是可能的。重要的 一件事是如果你做这种索引，
which is sometimes called masking, if you do that, if you do if you supply an array 这有时被称为掩蔽，如果你这样 做，如果你提供一个数组
index, or index in a Boolean form, you by default get a copy as as as compared to slicing 索引或布尔形式的索引，与切片 相比，默认情况下您会获得一个副本
in slicing, you get a view that's a separate copy, you need not to call a dot copy function, 在切片中，您会得到一个单独副本 的视图，您无需调用点复制函数，
it is by default, a different copy. And this is a difference between the ordinary slicing 默认情况下，它是一个不同的副本 。而这就是普通切片的区别
that you do, for example, start from one go till 50, take a jump of let's say two, if 例如，你这样做，从一次开始到 50 次 ，跳一跳，比如说两次，如果
that is your indexing style, that is called a slicing, the return value is a different 那是您的索引样式，称为 切片，返回值不同
view having the same memory. However, if you do the, if you use the array index, or the 视图具有相同的内存。但是，如果你这样 做，如果你使用数组索引，或者
Boolean array called masks, then you get a copy of rather than also so which means if 布尔数组称为掩码，那么您将获得一 个而不是这样的副本，这意味着如果
you if you get a new array, you change the elements in the new array using the array 如果你得到一个新数组，你可以 使用数组更改新数组中的元素
indices. You're not getting that change happen to the original array. So that's the difference 指数。你不会让原始数组发生 这种变化。所以这就是区别
between slicing and masking. Okay, this kind of Boolean indexing becomes really handy. 在切片和遮罩之间。好的，这 种布尔索引变得非常方便。
For example, what if you want to exit? What if you want to get all elements that are smaller 例如，如果您想退出怎么办？如果 你想获得所有较小的元素怎么办
than eight, one way to do that is just write a and then apply a condition is less than 比八，一种方法就是写一个 然后应用一个条件小于
eight, well, a is less than eight, we'll create a Boolean array. And everywhere where the 八，好吧，a 小于八，我们将创建一 个布尔数组。而且到处都是
element is smaller than eight, there will be a true otherwise it will be false. Now, 元素小于八，则为真 ，否则为假。现在，
the inside array is a Boolean array, and you access all the elements with respect to that 内部数组是一个布尔数组，您可以 访问与该数组相关的所有元素
condition. So it will return all elements that are smaller than eight. How how fancy 健康）状况。所以它会返回所有 小于八的元素。多么花哨
is that? Further, you can you can have these conditions in a combined way. There is one 就是它？此外，您可以组合 使用这些条件。有一个
difference there is an AND operator A and D and, and there isn't an operating in a different 不同之处在于有一个 AND 运算符 A 和 D and，并且没有一个不同的操作
way. So I'm going to discuss the difference of this and this and as well in this in this 道路。所以我将讨论这个和 这个以及这个和这个的区别
whole in this video. So let's go to Jupyter Notebook our fan and see how can we play with 整个视频中。所以让我们去我们的 粉丝 Jupyter Notebook 看看我们如何玩
this masks. 这个面具。
So let's say a is again and B dot arrange, arrange, let's say 100. That's it. That's 因此，让我们再次说 a 和 B 点排列，排列 ，让我们说 100。就是这样。那是
our a. And what we now do is we access the elements of A, B access, for example, the 我们的而我们现在所做的就是 访问A，B访问的元素，例如，
third element and the fifth element and the sixth element. Let's say we want to do that. 第三个元素和第五个元素和第六 个元素。假设我们想要这样做。
And that's our B. So that happens, let's say, so what B is B is this, something that you 那就是我们的 B。所以发生了，让我们 说，所以 B 是什么 B 是这个，你
need to know is if you change the elements of B now, because that's a copy, let's say 需要知道的是，如果你现在改变 B 的 元素，因为那是一个副本，让我们说
minus four, that change does not happen in eight that happens in B for sure. But that 减去四，这种变化不会发生 在 B 中的 8 中。但那
doesn't happen in a, a does not contain any value that is minus four. Because using these 不会发生在 a 中，a 不包含任何 负四的值。因为使用这些
kinds of indices, the array index By default, the result is a copy rather than a view. Further, 索引种类，数组索引 默认情况下 ，结果是副本而不是视图。更远，
let's say you have this a and you want to access all the elements that are smaller than 假设你有这个 a 并且 你想访问所有小于
let's say that are smaller than let's say 40, access all elements that are smaller than 假设小于 40， 访问所有小于
40. So that is possible now even contain only the elements that are smaller than 40. All 40. 所以现在甚至可以只包含 小于 40 的元素。所有
the elements while further if you want to access all elements that are that are smaller 如果您想访问所有较小的 元素，则进一步访问元素
than 40 that are smaller than 40. And they are bigger than they are smaller than 40. 小于 40 小于 40。它们 大于小于 40。
And they are bigger than 30. Let's say you want to access all the elements that are between 它们大于 30。假设您想访问 介于两者之间的所有元素
30 and 40. You can just access those elements like so there is a problem. A dot any a dot 30 和 40。你可以像这样访问那些元素 ，所以有问题。一个点任何一个点
all what's the problem here? The truth value of an array with more than one element is 这里有什么问题吗？具有多 个元素的数组的真值是
ambiguous use a.ne or a dot all. Okay, this a is less than 40 is a Boolean array is greater 歧义使用 a.ne 或点 all。好的，这个 a 小于 40 是一个布尔数组更大
than 40. That's a Boolean array. So what's the problem? What, why can't we not use this? 比 40. 那是一个布尔数组。所以有什么问题 ？什么，为什么我们不能使用这个？
What's the problem? We should have used that. So use and, and, yeah, I guess we were missing 有什么问题？我们应该使用它。所以使用 和，而且，是的，我想我们失踪了
these, we were missing these brackets because it might be confusing this 40 with this a 这些，我们遗漏了这些括号，因为 它可能会混淆这个 40 和这个 a
and stuff like so. So use parenthesis rate. Now, B contains only the elements that are 和这样的东西。所以使用 括号率。现在，B 只包含
between 30 and 40. Now, one thing, what's the difference between this particular and 在 30 到 40 之间。现在，有 一件事，这个特殊的和
and this symbol and the difference is this and AMD an operator It is used when both of 而这个符号和区别就是这个和AMD 的一个操作符 当两者都用的时候
the sides of this end has what is one object and it has one true value either true or false. 这一端的两侧有一个对象， 它有一个真值，真或假。
And this particular symbol is used when the left side and the right side can be arrays, 当左侧和右侧可以是数组 时使用这个特殊符号，
and each element of that array can be true or false. And so, so, you can think of this 并且该数组的每个元素都可以为真或 为假。所以，所以，你可以想到这个
and is using arrays, however, this is used when both the sides are single objects. So 并且正在使用数组，但是，当双方 都是单个对象时使用。所以
that's the difference. Other variants of and I mean, the end is like this, that these are 这就是区别。的其他变种，我的 意思是，结局是这样的，这些是
these are the same things, but remember the use this is used for arrays, this is used 这些是相同的东西，但请记住 this 用于数组，this 用于
for single objects. Similarly, there are other symbols like 对于单个对象。同样，还有其他符号 ，如
or 或者
that is used this way or or that is used that way. Similarly, there is a not not for arrays 以这种方式使用或以这种方式使用 。同样，对于数组也有一个 not not
is used like this way and not for otherwise, is used like that way. So remember these the 像这样使用而不是其他方式， 像那样使用。所以记住这些
left side, I have symbols, they are used for arrays, the right kind of symbols, they are 左侧，我有符号，它们用于数 组，正确的符号，它们是
used for single objects that has true or false values. So these, this kind of masking is 用于具有真值或假值的单个对象 。所以这些，这种掩蔽是
really, really powerful. Later, we will see in pandas accessing different kinds of data 真的，真的很强大。稍后，我们将在 Pandas 中看到访问不同类型的数据
with particular kind of conditioning, that becomes really handy if we if we are comfortable 有了特殊的条件，如果我们 感到舒服，这会变得非常方便
with these kinds of indexing. And that's really powerful indexing. Okay. So, I've told you 使用这些类型的索引。这是非常强大的 索引。好的。所以，我告诉过你
the difference here between Aaron and I've told you that this is copy rather than a view. Aaron 和我之间的区别我已经告诉 过你这是复制而不是视图。
So just bear with me some more time on NumPy. And I will tell you some more truths about 因此，请在 NumPy 上多花些时间 。我会告诉你更多的真相
NumPy. And then we will move towards another package called pandas. So before pandas more NumPy。然后我们将转向另一个名为 pandas 的包。所以在熊猫之前更多
NumPy is coming, I hope to see you in the next video. Okay, in the last video, we saw NumPy 来了，我希望在下一个视频中见到 你。好的，在上一个视频中，我们看到
masking, which is sometimes called the fancy indexing as well. And here we are going to 掩码，有时也称为花式 索引。我们将在这里
discuss one more feature of NumPy, which is very powerful feature called broadcasting. 讨论 NumPy 的另一个功能，这是一 个非常强大的功能，称为广播。
I think, for example, you have an array, let's say two, three, a matrix, that's a two dimensional 我想，例如，你有一个数组，比方 说二，三，一个矩阵，那是一个二维
array 235 and nine, and you want to add, in every element, you want to add a number, let's 数组 235 和 9，你想添加，在每个元素 中，你想添加一个数字，让我们
say five. So one way to do that is create another array with 5555. And just apply this 说五个。所以一种方法是用 5555 创建另一个数组。然后应用这个
add operator and you are done. Great. But this NumPy allows you to just write let's 添加运算符，您就完成了。伟大的。 但是这个 NumPy 允许你只写让我们
say this is array, a NumPy allows you to just do this particular thing. And this five is 说这是数组，NumPy 允许你做这个 特定的事情。而这五个是
automatically broadcasted to match with the dimensions of its other operand. And addition 自动广播以匹配其另一个 操作数的维度。和加法
happens you need not to do this explicitly. And this broadcasting is not just one scalar 碰巧你不需要明确地这样做。而且 这种广播不仅仅是一个标量
value. For example, if you have one variable, let's say a is this and you want to add, for 价值。例如，如果您有一个变量，假设 a 是这个，并且您想添加，例如
example, this particular column, let's say one three, you want to add this particular 例如，这个特定的列，比方说 一三，你想添加这个特定的
column in the first column as well as in the second column, but then you need this one 第一列和第二列中的列 ，但是你需要这个
three to be copied again and make a bigger array and then you do that well, broadcasting 三个要再次复制并制作一个更大 的数组然后你做得很好，广播
allows you if you just write this as a plus one three, it will be automatically broadcasted 允许你如果你只是把它写成 加一三，它会被自动广播
to match the size of the other operand, wherever the book broadcasting is possible, there are 为了匹配另一个操作数的大小， 只要有可能播放书籍，就有
certain rules to to know when broadcasting is possible it is not possible each and every 要知道何时可以进行广播的 某些规则并非每次都可能
time. For example, if you have this matrix 239 and Jeff 421 Let's at this matrix and 时间。例如，如果你有这个矩阵 239 和 Jeff 421 让我们在这个矩阵和
you want for example, two one and six two, for example, if you want to do that, the broadcasting 你想要例如，二一和六二， 例如，如果你想这样做，广播
may not happen because in this way, if I want to broadcast this structure, the structures 可能不会发生，因为这样，如果 我想广播这个结构，结构
should be if if the structure is broadcasted to in horizontal way, the the two columns 应该是如果结构以水平 方式广播到，两列
will be arrayed and the addition cannot happen. If it expands to a vertical way still the 将被排列并且添加不会发生。如果 它扩展到垂直方式仍然
addition cannot happen. So, this here you will get an error because broadcasting is 加法不可能发生。所以，在这里 你会得到一个错误，因为广播是
cannot happen, but in several cases when you want to add for example, a scalar multiply 不可能发生，但在某些情况下， 当您想要添加例如标量乘法时
with a particular thing wherever possible this broadcasting is possible and broadcasting 在任何可能的情况下，通过特定 的事情进行这种广播是可能的
is just a I mean it just a feature of NumPy that allows you to not repeat to match the 只是一个我的意思是它只是 NumPy 的 一个特性，它允许你不重复匹配
dimension of the other operand to apply a particular operator it does it by itself great. 另一个操作数的维度来应用一个 特定的运算符，它本身就很好。
Next, we see some more important functions to no one is horizontal stack. That means, 接下来，我们看到一些更重要的 函数是水平堆栈。这意味着，
if you want to concatenate two different array two arrays that are that can be concatenated 如果你想连接两个不同的数 组两个可以连接的数组
together horizontally, you can get out you can call at stack function and that will concatenate 水平在一起，你可以出去你 可以调用堆栈函数，这将连接
the two arrays together and returns another array. Similarly, V stack is if you want to 将两个数组放在一起并返回另一 个数组。同样，V栈是如果你想
concatenate two arrays vertically, if they can be concatenated vertically, vertically, 垂直连接两个数组，如果它们 可以垂直连接，垂直连接，
similarly, there, there is another powerful function sort, and there are a lot of other 同样，还有另一个强大的功能 排序，还有很多其他的
functions, these kinds of functions, they are called Universal functions. And they are 函数，这些类型的函数，它们 被称为通用函数。他们是
very, very, very powerful, very, very fast their implementation is vectorized, where 非常、非常、非常强大、非常、非常 快 他们的实现是矢量化的，其中
Christ mean the implementation the all loop kind of layer is deferred to at the compile 基督的意思是在编译时延迟 所有循环类型的实现
time and the things are really faster when you do a vectorized code. So, having said 当您执行矢量化代码时，时间和事情 都会变得更快。所以，话虽如此
that, it is always recommended to not use explicitly for loops to achieve these kind 即，始终建议不要显式使用 for 循环来实现这些类型
of, 的，
to achieve these kind of results, whenever a universal function is available, use that 为了实现这些结果，只要有 通用功能可用，就使用它
because the efficiency of that universal function will be way, way way more than then whatever 因为那个通用功能的效率将是方式 ，方式比任何方式都多
loop loop or whatever function you will be writing other than the universal function. loop 循环或您将要编写的任何 函数，而不是通用函数。
So, and by the way, there is another function concatenate as well, in which you can specify 因此，顺便说一下，还有另一个函数 concatenate ，您可以在其中指定
axes. And it will either act as horizontal stack or either act as vertical stack, depending 轴。它将充当水平堆栈或 充当垂直堆栈，具体取决于
upon whether the x value is zero or one, whatever. So, let's just get comfortable with these, 无论 x 值是零还是一，无论如何。 所以，让我们适应这些，
these three functions, just quickly neural Jupyter Notebook and see an example of, let's 这三个函数，刚刚快速神经 Jupyter Notebook 和看一个例子，让我们
say, broadcasting as well. So let's say we have a function, and let's say you have an 说，广播也是如此。所以假设我们 有一个函数，假设你有一个
array is let's say, np dot random dot Rand, let's say that is two by three. And then I 数组是比方说，np dot random dot Rand， 比方说是二乘三。然后我
just multiply this with them. Remember the last thing and then we just NP dot around, 只需将其与它们相乘即可。记住最后 一件事，然后我们只是 NP 点，
we just round everything. So that it becomes it becomes whole, in this particular way. 我们只是围绕一切。以这种特殊 的方式，它变得完整。
Okay, that's a, let's say, so that's our a, that's the now if we say a plus three, three 好的，那是一个，比方说，那是我们的 a，那就是现在，如果我们说加三，三
will be added everywhere in a, and that happens through broadcasting. Well, if we if we do, 将在 a 中的任何地方添加，这通过广播 发生。好吧，如果我们这样做，
for example, a plus, for example, np dot range, let's say just do values, and then we just 例如，一个加号，例如，np dot range， 我们说只是做值，然后我们就
reshape it, reshape it, to reshape it to let's say, a two by one matrix. If you do that, 重塑它，重塑它，重塑它，让我们说， 一个二一矩阵。如果你这样做，
then still, what what will happen is just apply the parenthesis just to show that this 那么仍然会发生什么只是 应用括号只是为了表明这
should happen. First, what what will happen is there will, there will be a column that 应该发生。首先，将会发生 什么，将会有一个列
will be added to every column A, and that again, will be happened through through the 将被添加到每一列 A 中，这将再次通过
broadcasting. So broadcasting is that powerful. Next, let's see the stats. So that's it, this 广播。所以广播就是那么强大。接下来， 让我们看看统计数据。就是这样，这个
is a, let's say we have the that's another way, let's say NP dot random dot Rand. Let's 是一个，假设我们有另一种方式 ，假设 NP 点随机点 Rand。让我们
say that new array is two by two. And again, let's say it is multiplied by Dan and NP doc 说新数组是两个两个。再一 次，假设它乘以 Dan 和 NP doc
round just to avoid the decimal points. That's it, this is B. Now a is two by three array 舍入只是为了避免小数点。就是这样 ，这是 B。 现在 a 是二乘三阵列
D is a two by two array, if I just concatenate them horizontally, I will get another array D 是一个二乘二的数组，如果我只是水平 连接它们，我会得到另一个数组
which will be two by five. So C equals np.at stack horizontal stack, at stack, and I will 这将是二乘五。所以 C 等于 np.at stack 水平堆栈，在堆栈，我会
call these A and B. One thing that you need to know is if you if you want to call this 调用这些 A 和 B。你需要知道的 一件事是，如果你想调用它
x stack, horizontal stack or vertical stack, these arguments in B that you want to concatenate x 堆栈，水平堆栈或垂直堆栈 ，B 中要连接的这些参数
you have to give them in a topple or you may you may want to give several values to concatenate 您必须将它们倒置，或者您 可能想要提供多个值来连接
together maybe you have maybe you have 10 matrices to concatenate together horizontally. 在一起也许你有也许你有 10 个矩阵可以水平连接在一起。
You have to give all these as a tuple inside a All right. Now similarly, we can do a vertical 你必须把所有这些都作为一个元组放在一个好 的里面。现在类似地，我们可以做一个垂直的
stack if we want. I mean, one on top of the other. And we can call it and getting it function 如果我们愿意，可以堆叠。我的意思是，一个 在另一个之上。我们可以调用它并让它发挥作用
as well, if you want. Third is sort function. For example, if we want. If you want to use 同样，如果您愿意。三是排序功能。例如 ，如果我们想要。如果你想使用
NP dot, let's say a is NP dot random dot permutation, let's say NP dot range, let's say the 10 values. NP点，假设a是NP点随机点排列， 假设NP点范围，假设10个值。
Let's say that our a, let's say, this is a, and we want to sort this array. Oh, this is 假设我们的 a，比方说，这是 a，我们 想对这个数组进行排序。哦，这是
already sorted. Why is it sorted? No, it is not sorted 1/4. It is not sorted? Yeah. Let's 已经排序。为什么要排序？不，它不是按 1/4 排序的。是不是排序了？是的。让我们
say we want to sort it a dot sort. One way of doing that is just call a dot sort, and 说我们想对它进行点排序。一 种方法是调用点排序，然后
you're done. That's the value of a another way, which is sometimes more readable, although 你完成了。这就是另一种方式的 价值，它有时更具可读性，尽管
exactly the same is to use a universal function, using NP dot that thing that also is the same 一模一样的是用一个通用函数 ，用NP点那个东西也一样
thing. Now sort by default sorts in ascending order. If you want to sort in descending order, 事物。现在默认按升序排序 。如果要按降序排序，
then what you can do is you can sort aid or sought, for example, do that in ascending 那么你可以做的是你可以对援助或寻求 进行排序，例如，在升序中这样做
order, then what you do is you just reverse it, minus one, and just copy that in a again, 顺序，然后你要做的就是把它倒过来 ，减去一个，然后再复制一次，
now he will be sorted. While sorted in descending order. Yeah, great. Um, one more just just 现在他将被排序。虽然按降序排序 。很好。嗯，再来一张
just just to give you one more flavor, if you create an array, for example, np dot array 只是为了给你更多的味道，如果 你创建一个数组，例如， np dot array
of strings, for example, ABC, and another string is, how are you and vai maybe we have 字符串，例如 ABC，另一个字符串 是，你和 vai 怎么样，也许我们有
another string? Whew, 785. And maybe we have another string, one, three e r, that's it. 另一个字符串？哇，785。也许我们还有另一 个字符串，一个，三个 e r，就是这样。
That's a string. That is possible. As long as all the objects have same type, you can 那是一个字符串。那是可能的。只要 所有对象的类型相同，就可以
create an empty array. Now, you might be wondering, what we'll do this sort function on a because 创建一个空数组。现在，您可能想知道，我们 将在 a 上执行此排序功能，因为
these are all strings? Well, the answer is it will sort the strings according to the 这些都是字符串吗？嗯，答案是它 会根据字符串对字符串进行排序
alphabetic order, whatever the alphabetic order is, whatever string according to the 字母顺序，无论字母顺序 是什么，无论字符串根据
alphabetic order should become first that will become first and the other strings, they 字母顺序应该成为第一个将成为 第一个和其他字符串，他们
will they will just join. Yeah. So yeah, so that's about something that is not that is 他们会不会加入。是的。所以是的 ，所以这是关于不是那样的事情
not the numeric value. Okay, great. There is a few more things to come about NumPy array, 不是数值。好的，太好了。关于 NumPy 数组还有一些事情要做，
and then we will be moving towards panda's library that is built on top of NumPy array 然后我们将转向建立在 NumPy 数组之上的熊猫库
for better processing of data, I hope to see you in the next video. Okay, in last video, 为了更好地处理数据，我希望在下一个视频 中见到你。好的，在上一个视频中，
we saw horizontal concatenation, vertical concatenation sort function, we also saw some 我们看到了水平串联、垂直串联排序 功能，我们还看到了一些
broadcasting and stuff like so. Universal functions, it should be speed here, sorry, 广播之类的。通用功能， 这里应该是速度，抱歉，
it should be speed, speed. Universal functions are really, really speedy, I always am talking 应该是速度，速度。通用函数 真的非常快，我一直在说
about NumPy. Whenever I start NumPy, I said, it is fast, it is fast as fast, I never show 关于 NumPy。每当我启动 NumPy 时，我说 ，它很快，它一样快，我从不显示
you how fast that is. So let me give you an example. Let me let me just create an A NumPy 你这是多快。所以让我给你举个 例子。让我让我创建一个 NumPy
array with a lot of numbers, and then just apply an ordinary function, let's say want 有很多数字的数组，然后只需应用 一个普通函数，比如说想要
to add all the numbers in this array B, let's apply an ordinary function that is not in 要将数组 B 中的所有数字相加，让我们 应用一个不在数组中的普通函数
NumPy. And then let's use universal function dot sum, and see how speed differences there. NumPy。然后让我们使用通用函数点 和，看看那里的速度差异如何。
If for example, we apply apply a universal function to achieve a particular task how 例如，如果我们应用应用通用 函数来完成特定任务如何
speedy that universal function is, because a vectorized implementation, as I told you 快速通用功能是，因为矢量化 实现，正如我告诉你的
is much faster, how faster let's check that out in new Jupyter Notebook. That's a magic 快得多，让我们在新的 Jupyter Notebook 中检查一下。这是一个魔法
command time ID that will tell us how much time this particular task has, has taken. 命令时间 ID 将告诉我们这个 特定任务花费了多少时间。
And if you run this command, it will it will call this function again and again several 如果你运行这个命令，它会一次 又一次地调用这个函数几次
times. And then we'll report an average value that will be much more stable than just calling 次。然后我们将报告一个平均值， 该平均值将比仅仅调用稳定得多
once. After that, we will also we will also write our own sum function using loop. And 一次。之后，我们还将使用循环 编写我们自己的 sum 函数。和
we will see whether that is even closer to a universal function speed or not. Let us 我们将看看这是否更接近于 通用函数速度。让我们
just check the speed of universal functions that will give you a look and feel of how 只需检查通用函数的速度 ，这将使您了解如何
much NumPy implementation is faster. So let's say we have an array, let's say B and B dot 许多 NumPy 实现速度更快。所以假设 我们有一个数组，假设 B 和 B 点
random dot Rand. And let's say that array is huge, really huge. Let's say that's the 随机点兰特。假设数组很大 ，真的很大。让我们说这是
case. Now what we do is we let's say we we call a function sum. So let's say we call 案件。现在我们要做的是假设我们调用一 个函数 sum。所以让我们说我们打电话
a function sum. That's a built in function. In Mumbai, that's a built in function that's 一个函数总和。这是一个内置函数 。在孟买，这是一个内置的功能
a built in function in Python, not a NumPy function. And then let's say we do the same Python 中的内置函数，而不是 NumPy 函数。然后假设我们也这样做
task using NumPy universal function and P dot sum, that's the same as NP dot sum is 任务使用 NumPy 通用函数和 P 点和，这与 NP 点和相同是
the same as if we if we write, for example, b dot sum. 就像我们写的一样，例如，b dot sum。
So whether you write b dot sum, or you use NP dot sum and be passed and passed, as an 所以无论你写b dot sum，还是你使用 NP dot sum 并被传递和传递，作为
argument, both these things are roughly the same. So let's run it, it will take a while 争论，这两个东西大致相同。所以 让我们运行它，它需要一段时间
It will take a time because, okay, the sum function takes 307 milliseconds, that is not 这需要一些时间，因为，好的，sum 函数需要 307 毫秒，这不是
a universal function in NumPy. That's a Python function. That is not written in NumPy. That NumPy 中的通用函数。这是一个 Python 函数。那不是用 NumPy 写的。那
is not a vectorized code, nothing. It takes 307 milliseconds to perform to take the sum 不是矢量化代码，什么都没有 。执行取总和需要 307 毫秒
of the elements of this array. And it does that by applying seven rounds in in Santa 这个数组的元素。它通过在圣诞 老人中应用七轮来做到这一点
loops. However, the universal function takes just around three milliseconds, I'm assuming 循环。然而，通用函数只 需要大约三毫秒，我假设
2.7 milliseconds, how will how are you going to compare this 307? With three? How much 2.7 毫秒，你将如何比较这个 307？带三个？多少
faster you are around? Around 100? times your faster? I mean, yeah, I mean, this NumPy is 你在附近更快吗？ 100左右？倍你更快？我的 意思是，是的，我的意思是，这个 NumPy 是
literally faster NumPy, the universal function will faster, maybe you attempt to know that, 从字面上看 NumPy 更快，通用函数 会更快，也许你想知道，
okay, the sum function might be too slow. Let me write my own function. To do that, 好吧， sum 函数可能太慢了。让我写 我自己的函数。要做到这一点，
let me define my son, and my son just take an argument, let's say something, let's say 让我定义我的儿子，我的儿子只是 争论，让我们说点什么，让我们说
G. And what it does is for, let's say s equals zero, what it does is for x in g, s plus equals G. 它的作用是，假设 s 等于 0， 它的作用是对 x in g, s 加等于
2x X plus equals to x and then just return as nothing. That's your function. Let's say 2x X plus 等于 x，然后作为空返回 。那是你的功能。让我们说
you think that this is really a great function. Let's do that. Okay, let's compute the time 你认为这真是一个很棒的功能。让我们这样 做。好的，让我们计算一下时间
for this time it my son. And let's pause the rabee and see how faster this is. This is 这次是我的儿子。让我们暂停 rabee，看看它有多快。这是
roughly the same as your calling the sum function, but this NP dot sum or the universal function 与您调用 sum 函数大致相同，但是 这个 NP 点 sum 还是通用函数
is very faster, fairly faster. So, use universal functions, avoid for loops, avoid your own 非常快，相当快。所以，使用通用函数 ，避免 for 循环，避免你自己的
functions, if the same task has been a can be achieved through universal functions, whenever 函数，如果相同的任务已经可以 通过通用函数来实现，无论何时
possible, avoid loops when you are working with NumPy. That serious suggestion, follow 可能，在使用 NumPy 时避免循环 。那个严肃的建议，请遵循
that, because the universal function written in NumPy, they follow the vectorized code, 那，因为用 NumPy 编写的通用函数 ，它们遵循矢量化代码，
all the interpreted slowness that is deferred to the compilation layer. And the NumPy becomes 延迟到编译层的所有 解释缓慢。 NumPy 变成
really really faster and shows its power when you are working on large arrays using the 当您使用
universal functions. So I can speak more about NumPy. But I have told you some basics of 通用功能。所以我可以更多地谈论 NumPy。 但我已经告诉过你一些基础知识
NumPy. And we end the NumPy here and from the next video, we will be moving towards NumPy。我们在这里结束 NumPy，从 下一个视频开始，我们将朝着
a very, very fancy and beautiful kind of package called pandas to handle data. And by the way, 一种非常非常漂亮和漂亮的包，称为 pandas 来处理数据。顺便说一下，
the pandas library the pandas package completely is built on top of NumPy. Everything that pandas 库 pandas 包完全建立 在 NumPy 之上。一切
is there in pandas is built inside is built on top of NumPy as all the indexing and all Pandas 中是否有内部构建在 NumPy 之上作为所​​有索引和所有
kinds of stuff, slicing and speed. All is there in pandas that is due to the NumPy. 各种东西，切片和速度。由于 NumPy，pandas 中的一切都在那里。
So we will see one more package after pandas which is matplotlib for for plotting afterwards. 所以我们会在 pandas 之后看到另一个 包，它是 matplotlib 用于之后的绘图。
And we'll do a project at the end using scikit learn as well, just to wrap up all these things 最后我们也将使用 scikit learn 做一 个项目，只是为了总结所有这些
together. But for now I'm ending NumPy here and in the next video, we will start pandas 一起。但是现在我要在这里结束 NumPy， 在下一个视频中，我们将开始 Pandas
hope to see you in the next video. Okay, welcome to pandas data science package that is very, 希望在下一个视频中见到你。好的，欢迎 来到熊猫数据科学包，非常，
very powerful of handling data, manipulating data and used a lot in data munging and data 非常强大的处理数据，操纵数据并且 在数据处理和数据中大量使用
cleaning and data pre processing and whatnot. This pandas basically is built on top of NumPy. 清理和数据预处理等等。这个 Pandas 基本上是建立在 NumPy 之上的。
So most of the features of NumPy is also available in pandas. 所以 NumPy 的大部分功能在 Pandas 中也是可 用的。
Let's let's dive in. I mean, this pandas is a very, very fancy library, very, very fancy 让我们深入了解。我的意思是，这个 pandas 是 一个非常非常漂亮的图书馆，非常非常漂亮
package, that you can handle very large amounts of data in CSV files or an Excel files. Wherever 包，您可以处理 CSV 文件或 Excel 文件 中的大量数据。无论在哪里
the data is located. The missing entries are there. You can handle all the data you can 数据位于。丢失的条目在那里。您 可以处理所有可以处理的数据
manipulate all the data you can prepare all the data in just a few lines of Using this 操作所有数据，只需几行 Using this 就可以准备所有数据
pandas package, so let's just start pandas package. There are two most important objects pandas 包，所以让我们开始 pandas 包。有两个最重要的对象
of pandas. One is series and other is data frame that we will see later on, there is 熊猫。一个是系列，另一个是我们 稍后会看到的数据框，有
one more index. But the most important one is, or the useful one is the series and data 又一个索引。但最重要的是， 或者说有用的是系列和数据
frames. So let's just define, first of all, you need to import pandas package import pandas. 帧。所以让我们定义一下，首先， 你需要 import pandas 包 import pandas。
And you can rename this as PD, that's a, that's the most popular renaming, although you can 您可以将其重命名为 PD，这是最 流行的重命名，尽管您可以
rename it any. And then you just say okay, PD dot series, and then just like a NumPy 重命名任何。然后你就说好吧，PD 点系列，然后就像一个NumPy
array, you pass the data that you want. And you can create your own indices, for example, 数组，你传递你想要的数据。您 可以创建自己的索引，例如，
like, just like dictionary, this a is a key value. This is a key or index for this point, 就像，就像字典一样，这个 a 是一 个键值。这是这一点的键或索引，
two, five, this B is index 4.5, C is index 4.75. And these index four one, so you can 二、五，这个B是指数4.5，C是指数4.75。 而这些索引四合一，所以你可以
you can, you can supply your explicit indices as well. If you do not supply the indices, 你可以，你也可以提供你的显式 索引。如果您不提供索引，
the default indices are 012, and three, but you can define your own his own indices in 默认索引为 012 和三个，但您 可以在其中定义自己的索引
the way you want. Now, once this data object is created, you can call the data values and 你想要的方式。现在，一旦创建了此 数据对象，您就可以调用数据值并
you will find out the values you can call the dollar index and you will find out the 你会发现你可以称之为美元 指数的值，你会发现
indices let's see in the Jupyter Notebook just to get comfortable with pandas. First 让我们在 Jupyter Notebook 中查看索引 只是为了熟悉 Pandas。第一的
of all, import pandas as PD, maybe or something else. So okay, let's import it, maybe we can 最重要的是，将熊猫导入为 PD，也许或其他什么 。那么好吧，让我们导入它，也许我们可以
check what we're going to reveal working in PD dot worryin. The version of pandas we are 检查我们将要揭示在 PD 点担心中 工作的内容。我们是熊猫的版本
working in right now is 0.2 4.25. Read. So let's create data or whatever variable let's 现在工作是 0.2 4.25。读。所以让 我们创建数据或任何变量让我们
say a as PD dot series buzy dot series and there we just give a list of some values 2345 说一个作为 PD 点系列 buzy 点系列， 我们只是给出了一些值的列表 2345
let's say these are the values. And then we can give index as another list. Let's say 假设这些是值。然后我们可以将索引 作为另一个列表。让我们说
the indices are a maybe the indices need not to be strings, anymore, anything AB, C, and 索引是 a 也许索引不再需要 是字符串，任何 AB、C 和
let's say the index of fighters. Let's see. So now the series object or the pandas object 让我们说战士的指数。让我们来看看 。所以现在系列对象或熊猫对象
series is created. Series basically handles one dimensional arrays, later on, we will 系列已创建。 Series 基本上处理 一维数组，后面我们会
see DataFrame handles multi dimensional arrays, I mean more than one dimensions. Normally 参见 DataFrame 处理多维数组，我 的意思是不止一维。一般
typically two dimensional arrays, but okay, a dot values. So let's call the values, values, 通常是二维数组，但可以，点值 。所以让我们调用值，值，
and you will get all the values inside the series. And by the way, this values array 您将获得系列中的所有值。 顺便说一下，这个值数组
that you get, let's check what's the type of that array was type of battery? A dot values? 你得到了，让我们检查一下那个阵列 的类型是什么类型的电池？一个点值？
What is that thing? That's a NumPy array. Wow. And what's the type of a itself that 那个东西是什么？那是一个 NumPy 数 组。哇。而 a 本身的类型是什么
will be a pandas object. Great. So everything inside pandas, the NumPy is playing all the 将是一个熊猫对象。伟大的。所以 熊猫里面的一切，NumPy 都在玩
role inside pandas. Great. So now, let's check the index a dot index. That's also a NumPy. 熊猫内部的角色。伟大的。所以现在，让我们 检查索引一个点索引。这也是一个 NumPy。
That's also an array of index type, that's a different actually index is also an object 那也是一个索引类型的数组，那是一 个不同的实际上索引也是一个对象
in pandas. That's an index type object with these kind of indices, we can access for example, 在熊猫。这是一个具有这些索引的 索引类型对象，我们可以访问例如，
this a, just like we are working with dictionary for example, a dat returns a value, we can this a，就像我们使用字典一样，例如， 一个 dat 返回一个值，我们可以
change the values, we can add different, we can add more key value pairs. So just think 更改值，我们可以添加不同的，我们 可以添加更多的键值对。所以只是想
like these. 像这些。
Just think this data I'll just like the dictionary object that we saw this, these are the keys 想想这个数据我会喜欢我们看到 的字典对象，这些是键
and these are the values. And this is one one very good way of remembering what the 这些就是价值观。这是 一种非常好的记忆方式
series does, and manipulating series The way we want. Okay, one, we can access a z like series 可以，并以我们想要的方式操作 series。 好的，一，我们可以访问一个 z like
this, we also can do slicing. Let's say we want to access from A to let's say C let's 这个，我们也可以做切片。假设我们 想从 A 访问让我们说 C 让我们
say we want to access all these one difference is when you access like this, in the normal 说我们要访问所有这些一个区别是当 你像这样访问时，在正常情况下
slicing using implicit indices, for example 123 or zero, the final index is not included, 使用隐式索引进行切片，例如 123 或零，不包括最终索引，
but if you access like so, using explicit indices that are there, the final index is 但是如果你像这样访问，使用那里 的显式索引，最终的索引是
also included. So that is one more fancy way of indexing using in this pandas. Okay. Great, 也包括在内。所以这是在这个熊猫中使用的 一种更奇特的索引方式。好的。伟大的，
that's a serious object by the way, we can create a serious object by first creating 顺便说一下，这是一个严肃的对象，我们 可以通过首先创建一个严肃的对象
a dictionary for example. Let's let's go back to our slides and see this example, let's 例如字典。让我们回到我们的幻灯片 ，看看这个例子，让我们
create a dictionary. For example, of plates, let's have a lot of students with Grade A 创建字典。比如盘子，我们 有很多A级的同学
grade A minus Grade B, red b minus, and let's create that dictionary, then we can just create A级减B级，红色B减，让我们创建 那个字典，然后我们就可以创建
a series object or panda's object, by just passing this dictionary inside, we can make 一个系列对象或者熊猫的对象，只要把 这个字典传入里面，我们就可以制作
another dictionary for example, and we can make another series object. So a one way of 例如另一个字典，我们可以制作 另一个系列对象。所以一种方式
defining the series object is just to is just to pass the data as well as index in other 定义系列对象只是为了传递 数据以及其他索引
ways to just first create the dictionary and just pass the dictionary variable inside, 方法是先创建字典，然后 在里面传递字典变量，
and the series object will be created. Okay, that was just an introduction to series, we 并且将创建系列对象。好的， 这只是对系列的介绍，我们
will move on and see more features of pandas, as we as we explore it more and more in the 随着我们 在
upcoming videos. Hope to see you in the next video. Okay, let's say we have two different 即将上映的视频。希望在下一个视频中 见到你。好吧，假设我们有两个不同的
dictionaries, let's say we have a lot of students and the a grade is defined to be four and 字典，假设我们有很多学生， 并且 a 等级定义为四和
a minus grades defined to be 3.5. The b grade A has a number three, the B minus grade has a 负等级定义为 3.5。 b 级 A 的数字为 3，B 减级为
a number of a numeric value that is 2.5. And similarly b grade has an American value let's 2.5 的数值。同样，b 级 具有美国价值，让我们
do and then we create just a series object using this dictionary, let's say rather than 做然后我们使用这本字典创建一 个系列对象，让我们说而不是
just the numeric values as GPS or something like so let's say a grade also is defined 只是数值作为 GPS 或类似的东西 ，让我们说等级也被定义
at 85 marks in total, a minus graders defined at 80 marks in total, and similarly these 总分 85 分，负评分者定义为 总分 80 分，类似地这些
and then we create another series object, let's say named with Mark marks using these 然后我们创建另一个系列对象， 假设使用这些标记以标记命名
PD dot series. So let's go to Jupyter Notebook and just play a little with these dictionaries. PD点系列。因此，让我们转到 Jupyter Notebook 并稍微玩一下这些词典。
And build the series object, let's say marks, or let's say grades. dictionary equals, let's 并构建系列对象，比如说分数， 或者说成绩。字典等于，让我们
say, a grade, is has has an eighth grade has number value for RGB value for let's say, 说，一个等级，有一个八级有 数字值，RGB值，让我们说，
let's say we have a b grade with GPA value, let's say B is let's say it's 3.5. Let's say 假设我们有一个带有 GPA 值的 B 级， 假设 B 是假设它是 3.5。让我们说
we have C grade with GPA value, let's say three. And let's say Finally, we have d grade 我们有 GPA 值的 C 级，比方说三 个。让我们说最后，我们有 d 级
with GPA value, let's say 2.5. Let's say that's a dictionary. Okay? What we do now is we create GPA 值，比方说 2.5。假设这是一本字典 。好的？我们现在所做的是我们创造
a grades series object, let's say using PD dot series, and just pass this grades underscore 一个成绩系列对象，假设使用 PD 点系列，然后通过这个成绩下划线
teched. Now this capital a capital B, capital C and capital D, they will act as indices 技术。现在这个资本A资本B，资本 C和资本D，它们将作为指数
and this for 3.53. In 2.5, they will act like values. So for example, if we call her and 这是 3.53。在 2.5 中，它们的行为类似于值 。例如，如果我们打电话给她并且
just now called grades dot v dot values, so we will get, for example, what is that? That 刚才称为成绩点 v 点值，所以我们 将得到，例如，那是什么？那
just values, let's say, beget this grade stock values, and we get all the values that are 只是价值，让我们说，产生这个等级的 股票价值，我们得到所有的价值
available. Similarly, if we find grades or index, we will find out A, B, C and D. Let's 可用的。同样，如果我们找到等级或指数 ，我们会找到 A、B、C 和 D。让我们
define another dictionary, for example, marks dictionary dict. And there is let's say again, 定义另一个字典，例如标记字典 dict。让我们再说一遍，
a while the total marks are 85. For the a grade, let's say, for b grade, the total marks 有一段时间总分是85分。对于 a级，比方说，对于b级，总分
are let's say, 75. Let's say for C grade, the total marks are 比方说，75。比方说C级 ，总分是
let's say 65. And for D grade, let's say the total marks are 55, let's say. So let's say 比方说 65。对于 D 级，比方说总分 是 55，比方说。所以让我们说
that's another dictionary. Now, let's create a series of objects, a series object PD dot 那是另一本字典。现在，让我们创建 一系列对象，一个系列对象 PD 点
series, series, let's say marks dictionary. So now again, we have if you just write this 系列，系列，让我们说标记字典。所以 现在再一次，如果你写这个，我们有
marks, just like so, you will see the marks is 85, b 75, c 65, D is 55. And all the values 分数，就像这样，你会看到分数是 85，b 75，c 65，D 是 55。所有的值
they are integer 64. Ghana values, now we can access. Now we can play with this marks, 它们是整数 64。加纳值，现在我们可以 访问。现在我们可以玩这个标记，
for example, if we just want to access for example, what are the marks? What are the 例如，如果我们只想访问，例如 ，标记是什么？什么是
marks between, let's say, for example, what are the marks given a at a we can access that 标记之间，例如，我们 可以访问的标记是什么
we can change that we can just play like a dictionary. What if we rather than using the 我们可以改变，我们可以像字典 一样玩。如果我们而不是使用
index In a, we use for example, slicing, we want to start from the very beginning. And index 在a中，我们使用例如切片 ，我们想从头开始。和
let's say we want to go to two what will happen? Let's see. Yeah, so, the slicing is there 假设我们要去两个会发生什么？让我们来 看看。是的，所以，切片就在那里
for example, if you want these are explicit indices A B, C, D, these are explicit indices 例如，如果您希望这些是显式索引 A B、C、D，则这些是显式索引
and they are there. For example, if you can slice the you can slice the data using explicit 他们就在那里。例如，如果您可以切片 ，则可以使用显式切片对数据进行切片
indices that you are given that you are given or implicit indices that are the default indices, 给定的索引或默认 索引的隐式索引，
the first value index at zero, the second value is index two one and so on. So, you 第一个值索引为零，第二个值 是索引二，依此类推。那么你
can do that as well, one catch here for example, that we will see later on, there may be a 也可以这样做，例如这里的一个捕获， 我们稍后会看到，可能有一个
problem that your explicit indices they are also numeric, and then you do the slicing 问题是您的显式索引它们也 是数字，然后您进行切片
like so, then the series object may be confused whether I have to use the explicit indices 像这样，那么系列对象可能会混淆 是否必须使用显式索引
or implicit indices inside we will see how to resolve that issue, but by this pandas 或者里面的隐式索引，我们将看到如何 解决这个问题，但是通过这个熊猫
allowed to use explicit indices as well as the implicit indices. Okay, we were here. 允许使用显式索引和隐式索引 。好的，我们到了。
So, he just so, yeah, so, we were here. So, we have created these grades a series object 所以，他就是这样，是的，所以，我们在这里 。因此，我们将这些成绩创建为一个系列对象
This marks as a series object, these the series object is good for one dimensional arrays 这标记为系列对象，这些系列 对象适用于一维数组
or data with just one dimensional list or dictionary, kind of with just one dimensions, 或只有一维列表或字典的 数据，有点只有一维，
later, we will see data frame that actually is is actually the extension of curl can be 稍后，我们将看到实际上是 curl 的扩展的数据框可以是
looks like it can be looked like as an extension of series towards more than one dimension, 看起来它可以看作是一个 多维系列的延伸，
we may have, for example, two dimensional arrays or two dimensional data structures, 例如，我们可能有二维数组 或二维数据结构，
something like so. And we will be seeing this data frame which is much more powerful, particularly 像这样的东西。我们将看到 这个数据框更强大，特别是
for reading data from files and manipulating it and stuff like so. We will see that in 用于从文件中读取数据并操作 它等等。我们会看到，在
the next video data frame that running form of data frame in the next video, hope to see next video data frame 下一个视频中数据 帧的运行形式，希望能看到
you in the next video. Okay, in the last video, we were discussing series, and I told you 你在下一个视频中。好的，在上一个视频中 ，我们正在讨论系列，我告诉过你
that data frame is basically if if the data has if the data in the form of different columns, 该数据框基本上是如果数据 是否具有不同列形式的数据，
for example, a record as an array, then you have another record, then you have another 例如，一个记录作为一个数组，然后 你有另一个记录，然后你有另一个
record. And each element in that record is a different attribute. So this particular 记录。该记录中的每个元素都是 不同的属性。所以这个特别
way of two dimensional data is very well handled using data frame inside pandas rather than 使用熊猫内部的数据框而不是二维 数据的方式可以很好地处理
series. So but you can make these data frame objects using different series objects. For 系列。因此，您可以使用不同的系列 对象制作这些数据框对象。为了
example, you have a great object that grades object that we created last time, you know, 例如，您有一个很棒的对象，可以对我们 上次创建的对象进行评分，您知道，
marks object that we created last time, let's build a data frame using these two and see 标记我们上次创建的对象，让我们使用 这两个构建一个数据框，看看
what it looks like in in Jupyter. notebook. Let's see that. So remember, we have a marks 它在 Jupyter 中的样子。笔记本。让我们 看看。所以请记住，我们有一个标记
series object, and we have a grades series object. Let's now make grades. Maybe, maybe series 对象，我们有一个成绩系列对象 。现在让我们打分。也许，也许
the name is rates, okay? The name is like grades. Okay, so grades object, this one, 名字是rates，好吗？这个名字就像成绩 一样。好的，所以评分对象，这个，
let's make a data frame. 让我们制作一个数据框。
Let's say D, or maybe whatever name you want to do data frame with, again, that data frame 让我们说 D，或者你想用那个 数据框做数据框的任何名字
can also be defined using a dictionary. Again, now we have let's say, marks is the key for 也可以使用字典来定义。再一次， 现在我们可以说，分数是关键
data marks. And grades is the key for data grades. Let's say let's say we define a data 数据标记。而成绩是数据成绩的 关键。假设我们定义了一个数据
frame like so. And now if you see if you just display this D, we get a very beautiful look 像这样的框架。现在如果你看看你是否只显示 这个 D，我们会得到一个非常漂亮的外观
and feel of I mean this as the index is the explicit index at index a, the marks, the 并且感觉我的意思是因为索引是 索引 a 处的显式索引、标记、
marks is 85. The grades are for at index B, the marks are 75, the grades are 33.5. And 分数是85。分数是在索引B， 分数是75，分数是33.5。和
so on that that looks like so not only that, you can just transpose it like you have transpose 不仅如此，您还可以 像转置一样转置它
to a NumPy array, and you will get the flipped version or the transpose variant if you want. 到 NumPy 数组，如果需要，您将 获得翻转版本或转置变体。
Great. So that's how and you can have for example, more dictionaries to concatenate 伟大的。所以这就是你可以 有更多的字典来连接
together and more columns will be added here. And that's what the real data looks like. 在一起，更多的列将在这里添加 。这就是真实数据的样子。
I mean, it has a lot of columns, which normally are attributes. And each row is basically 我的意思是，它有很多列，通常是 属性。而且每一行基本上都是
one record or one sample of the data that you want to work on. So this data frame is 您要处理的数据的一个记录或 一个样本。所以这个数据框是
really, really ideal data structure for working with files, having a lot of records and you 真的，非常适合处理文件的数据 结构，有很多记录，你
want to manipulate the data and stuff like so. So yeah, so one more thing, let's let's 想要操作数据之类的东西。所以 ，是的，还有一件事，让我们
access the D, for example, that's brand D, that's the, that's the D, let's access the 访问 D，例如，那是品牌 D， 那是，那是 D，让我们访问
values inside D, other than No, so what are the values, so, the values inside D is completely D里面的值，除了No之外，那是 什么值，所以，D里面的值完全是
again, a two dimensional array that is completely like so. So for example, if we want to access 又是一个完全像这样的二维数组 。例如，如果我们想访问
this particular element 65, that is row number three, and column number one, excluding the 这个特定的元素 65，即第三 行和第一列，不包括
indices at row number three and column number one. So we can access that particular value 第三行和第一列的索引。所以 我们可以访问那个特定的值
T dot values, just assuming that dimensional NumPy array, row number three is to index T个点值，只假设NumPy数 组，第三行是索引
with do and column number one is index with that, and we will be able to access 65. Wow, 使用 do 和第一列是索引， 我们将能够访问 65。哇，
great. So that is there. There are more things that are available d dot for example, columns, 伟大的。所以就在那里。还有 更多可用的 d 点，例如列，
d dot columns, columns, it will give us what are the columns, the columns are marks and d 点列，列，它会给我们 什么是列，列是标记和
grades. There and there are other properties. And there are other several properties that 成绩。还有其他属性。 还有其他几个属性
we need to know Rs, for example, this there, we define this as di d dot index and stuff 我们需要知道Rs，例如，this there，我们 将其定义为di d dot index之类的东西
like so. Okay. One more thing that you need to know is we can repeat right now we have 像这样。好的。你需要知道的另一 件事是我们现在可以重复我们有
that sub D, that is this one. That's the D. Let's say we want to add another column here, 那个子D，就是这个。那是 D。假设 我们想在这里添加另一列，
just we want to add another column here. And that is the name of that column is scaled 只是我们想在这里添加另一列 。这就是该列的名称被缩放
marks. And the scale marks are what if we have computed marks, rather than from 100? 分数。如果我们计算了分数，而不是 从 100 开始，那么刻度标记会怎样？
What if we have computed marks out of 90? What are the scaled marks up 90? So one way 如果我们计算了 90 分的分数怎么办？ 90 的缩放比例是多少？所以一种方式
to do that, and very quick way to do that is just like a dictionary, again, like a dictionary, 这样做，而且非常快速的方法 就像一本字典，再次，像一本字典，
you just add a new key, let's say, scaled marks, that's a new key. and the value is 您只需添加一个新键，比方说，缩放 标记，这是一个新键。价值是
simply all the marks column divided by 90. So is that true? No? divided by 90, if we 只是所有的标记列除以 90。那是真的 吗？不？除以 90，如果我们
have just completed all the marks by 90, and then how can we? How can we compute the marks 刚考完90分，那怎么办 ？我们如何计算分数
from 90? It is rather than 100. It is from 90, I guess? How can we compute the marks 从90？它不是 100。它来自 90， 我猜？我们如何计算分数
from 90? If you want to compute the marks from 90, I guess they will look like and divided 从90？如果你想从 90 开始计算 分数，我猜他们会看起来像
by 90. And maybe 100 is multiplied here. I guess maybe the formula. I guess that that 乘以 90。也许这里乘以 100。 我想也许是公式。我猜那
that's what it is, I guess let's see. So now if you see D, there will be another column 就是这样，我想让我们看看。所以现在 如果你看到 D，就会有另一列
that is there. And oh, it does something else. Anyways, it does something that Yeah, so something 就在那里。哦，它还有别的作用。无论如何 ，它做了一些事情 是的，所以一些事情
anyways, so we see we have just, I mean, we've just computed this, we just 无论如何，所以我们看到我们刚刚，我的意思是，我们 刚刚计算了这个，我们只是
we just found that we just inserted that column inside that I'm in, there is a process for 我们刚刚发现我们刚刚在我所在的 列中插入了该列，有一个过程
each of these kinds of values. Maybe we have added this column in a very wrong way. And 这些值中的每一种。也许我们以非常 错误的方式添加了此列。和
later on, we suggest that okay, we should delete that column. Well, that's very simple. 稍后，我们建议好吧，我们应该 删除该列。嗯，这很简单。
Again, using the concepts again, just like the dictionaries, delete this, and this column 再次，再次使用概念，就像 字典一样，删除这个，这个列
is deleted from data. And you're again with the data that you had. So you can add columns, 从数据中删除。你又得到了你拥有 的数据。所以你可以添加列，
you can delete columns, and indexing is really fine. I mean, indexing like like masking, 你可以删除列，索引真的很好。我的 意思是，索引就像屏蔽一样，
let's say, you want to bake for example, or you want to bake the DataFrame such that you 比如说，你想烘焙，或者你 想烘焙 DataFrame，这样你
want to pick all the records such that the marks are the marks are. The marks are greater 想要选择所有记录，以便 标记是标记。标记更大
than let's say, greater than, let's say 70. You want to pick all the records where the 比比，比比，比比，比方说 70。你想挑选所有记录
bulk of the marks are greater than 70. This is that simple. All the data will be will 大部分分数都大于 70。就这么 简单。所有数据都将
be copied into g with this condition. And this condition can be arbitrarily complex 在这个条件下被复制到 g 中 。这个条件可以任意复杂
using ands and ORS and combinations and all that stuff. And you have seen this kind of 使用 ands 和 ORS 以及组合和所有 这些东西。你见过这种
stuff in NumPy as well. I mean, this is called Okay, great. So that's available in pandas NumPy 中的东西也是如此。我的意思是，这叫 做好的，太好了。所以这在熊猫中可用
as well. Okay, so that's how you can index in the next. In the next video, I'm going 以及。好的，这就是您可以在下一个索引 的方式。在下一个视频中，我要去
to basically show you one type of problem that normally happens in real data that is 基本上向您展示一种通常发生 在真实数据中的问题，即
the missing value problem. Sometimes you read a data and some of the attributes or some 缺失值问题。有时您读取 数据和一些属性或一些
of the row column p values they are just missing. I mean, they are not available due to certain 在行列 p 值中，它们只是丢失了。我的意思 是，由于某些原因，它们不可用
reasons. How can you How can you handle those values? And how actually pandas suggest you 原因。你如何处理这些值？以及 熊猫实际上如何建议您
to handle those kinds of missing values, which are sometimes called Nan values or non type 处理这些类型的缺失值，有时 称为 Nan 值或非类型
values. Also, they they mostly used interchangeably in pandas. So in the next video, we are going 值。此外，它们主要在熊猫中互换使用 。所以在下一个视频中，我们将
to handle or see how to handle missing data in pandas hope to see you in the next video. 处理或查看如何处理 pandas 中丢失的 数据，希望在下一个视频中见到您。
Okay, in the last video, we saw data frame object. And we saw actually how to add and 好的，在上一个视频中，我们看到了数据 框对象。我们实际上看到了如何添加和
remove columns how to process data, how to index how to actually mask or how to apply 删除列如何处理数据，如何索引 如何实际屏蔽或如何应用
conditions and selections in in bond as we saw that very briefly, but in this particular 正如我们非常简要地看到的那样，债券 中的条件和选择，但在这个特殊的
video, we are going to see one kind of missing value, sometimes called name or not a number, 视频，我们将看到一种缺失值， 有时称为名称或不称为数字，
or maybe not anything or sometimes this nun type none, which is the default return type 或者可能什么都没有，或者有时这个 修女输入无，这是默认的返回类型
of any function. In Python. This non type is also sometimes in pandas is treated as 的任何功能。在 Python 中。这种 非类型有时在熊猫中也被视为
Nan or Nan is treated as none or interchangeably. Any anything. Let me give you what do we mean Nan 或 Nan 被视为无或可互换。任何 东西。让我告诉你我们的意思
by that, let's say we have two dictionaries, let's say one dictionary is a with key value 通过那个，假设我们有两个字典 ，假设一个字典是具有键值的
a and value is one, then B and the value is two. Okay? The other dictionary is B and C. a 和值是 1，然后 B 和值是 2。 好的？另一本字典是 B 和 C。
So for example, that is one record with columns A and B. So a and b are the columns. On the 例如，这是一个包含 A 列和 B 列的 记录。所以 a 和 b 是列。在
first record, the value of a is one, and the value of b is two. Now let's say we want to 第一条记录，a的值为1，b的值 为2。现在让我们说我们想要
insert another record in the same data frame. Now the value of b is available in the second 在同一数据框中插入另一条记录 。现在 b 的值在第二个可用
time, well, if b is available, which is three, and the value of c is available, which means 时间，好吧，如果b可用，也就 是3，c的值可用，这意味着
a C column is added now. But for the value c the first row value is not available. So 现在添加了一个 C 列。但是对于 值 c，第一行值不可用。所以
we will say this value is missing here. But in the second row, we have four similarly, 我们会说这里缺少这个值。但在 第二行，我们有四个类似的，
the value of a is missing for for the second row, and that is a missing value, which is 第二行缺少 a 的值，这 是一个缺失值，即
sometimes called Nam. So these are missing values. And they are typical. When you are 有时称为南。所以这些是缺 失值。他们是典型的。当你
working with data. And you're reading data on you're getting data from, from out from 处理数据。并且您正在读取 数据，从中获取数据
somewhere or large files and stuff like so. So pandas give some methods to handle these 某处或大文件之类的东西。所以大熊猫 给出了一些处理这些的方法
kind of 的种类
these kind of I mean, this kind of situation, let's say let's say a equals PD dot data frame, 这些我的意思是，这种情况，让 我们说一个等于 PD 点数据框，
data frame, again, a dictionary, let's say we have a, 数据框，又是一个字典，假设我们有 一个，
one and B, let's say four, that's the first row or record. The second record, let's say 一个和 B，比方说四个，这是第一行 或记录。第二个记录，让我们说
is another dictionary, let's say B is minus three, and C is let's say, nine. That's it. 是另一本字典，假设 B 是负 三，而 C 是九。就是这样。
That's it. That's our data frame a. So now if you bring this a if you see the data inside 就是这样。那是我们的数据框a。所以现在 如果你带上这个如果你看到里面的数据
a, you will see Oh, what's the problem? Is this and be heavy? Have you played something a、你会看到哦，有什么问题吗 ？这个重吗？你玩过东西吗
in a wrong way? Let's see. Oh, we have to create a list. That's okay, we have to create 以错误的方式？让我们来看看。哦，我们 必须创建一个列表。没关系，我们必须创建
a list of it, you have to create list of dictionaries, that's the proper way of calling it. So we 它的列表，您必须创建字典列表，这是 调用它的正确方法。所以我们
missed just this index list of that. Okay, right. So now we have this A, B, just call 只是错过了这个索引列表。好吧，对了。 所以现在我们有了这个 A，B，只需调用
that a and this value is missing and that value is missing. And in large data files, a 和此值缺失且该值缺失 。在大型数据文件中，
this is typical, I mean, there are a lot of values that can be missing. One way that pandas 这是典型的，我的意思是，有很多 值可能会丢失。熊猫的一种方式
supplies to hell these missing values is to just fill these missing values with some some 把这些缺失值补给地狱只是用 一些东西来填充这些缺失值
fixed number for example, there is a fill na function, fill any function and let's say 例如，固定数字，有一个填充功能 ，填充任何功能，让我们说
you supply as zero that means wherever there is a not available or not a number value, 你提供零意味着哪里有不 可用或不是数字值，
fill that with zero, or maybe any any value you want to fill that with. So that is One 用零填充它，或者你想用任何 值填充它。所以这是一
way to do that, and now if you see the value of a is all the non values are filled with 这样做的方法，现在如果您看到 a 的值是所有非值都填充了
that, another kind of function that is available in pandas that is sometimes used a that is 那，在 Pandas 中可用的另一 种函数有时会被使用
drop na that that function drop na, what that does is it drops all the records that contain drop na 那个函数 drop na，它的 作用是删除所有包含的记录
a missing value. Sometimes if that is visible, I mean dropping all the records that contain 一个缺失值。有时，如果这是可见的 ，我的意思是删除所有包含的记录
missing values, if that is visible, then go for that. But if if the if the missing values 缺失值，如果这是可见的，那就 去做吧。但是如果如果缺失值
are a lot and they are spread over a lot of rows, then dropping all those kinds of records, 很多，它们分布在很多行上， 然后删除所有这些类型的记录，
they will create a lot of I mean data loss and and then it becomes really, really important 他们会造成很多我的意思是数据 丢失，然后它变得非常非常重要
how to how to handle these missing values. However, you can fix you can fill the missing 如何处理这些缺失值。但是， 您可以修复您可以填补缺失的
values using fixed value or you can drop them and later on we will see in scikit learn that 值使用固定值，或者您可以删除它们 ，稍后我们将在 scikit 中看到
there are other ways of handling the missing values as well, you can fill the each column 还有其他处理缺失值的方法 ，您可以填写每一列
missing values in each column using an average or using for example, a regression there are 使用平均值或使用例如回归 的每列中的缺失值有
ways to to handle these missing values. But in pandas, these two functions are right away 处理这些缺失值的方法。但是 在pandas中，这两个函数是马上
they are you can fill all them with a fixed value for example or you can drop them and 例如，您可以使用固定值填充所有 它们，或者您可以删除它们并
you are ready to go. Okay great. Next, we are going to see oh as as I mentioned earlier, 你准备好了。好的，太好了。接下来 ，正如我之前提到的，我们将看到哦，
what is the what is the confusion between what if there is a confusion between implicit 如果隐式之间存在混淆， 那么什么之间的混淆是什么
and explicit indices. And that I will discuss in the next video basically, just to give 和显式索引。我将在下一个视频 中讨论基本上，只是为了给
you a look and feel what if the explicit indices you supply they are one three and five. And 如果您提供的显式索引是一三 和五，您会感觉如何。和
what if you call this this particular command one colon three, will it call the implicit 如果你将此特定命令称为冒号 三，它会调用隐式命令吗？
index or the explicit index, that's a problem. So we will see because 1.1 colon three, one 索引或显式索引，这是一个问题。所以 我们会看到因为 1.1 冒号三，一
and three they are also explicit indices. And whether this one colon three is referring 并且三个它们也是显式索引 。这个冒号三是否指的是
to the implicit indices that are default indices, or they're referring to these indices. So 到默认索引的隐式索引，或者它们 指的是这些索引。所以
this confusion is there and we will see how to handle that confusion. Using this lock, 这种混乱是存在的，我们将看到如何 处理这种混乱。使用这个锁，
LLC function and index lock ilsc function, we will see that in the next video, hope to LLC 函数和索引锁 ilsc 函数，我们 将在下一个视频中看到，希望
see you in the next 下期见
video. Okay, in the previous video, I mentioned a confusion that can be there, if you have 视频。好的，在上一个视频中，我提到 了可能存在的混淆，如果您有
supplied the explicit indices that can conflict with implicit indices. In particular, for 提供可能与隐式索引冲突的显式 索引。特别是，对于
example, if this is the series object, or maybe a data frame object if you want to if 例如，如果这是系列对象，或者 如果您想要，可以是数据框对象
for indices, let's just think about the series object, it has these values ABC with index 对于索引，让我们考虑一下系列对象 ，它具有这些值 ABC 和索引
one three and five, if you for example, access a particular element let's say data with index 一三和五，例如，如果您访问特定 元素，让我们说带有索引的数据
one that means the explicit index for sure, but if for example, we slice the values for 一个肯定意味着显式索引 ，但例如，我们将值切片
example, one colon three, the default behavior of slicing if you give an American disease, 例如，一个冒号三个，如果你给一 个美国疾病切片的默认行为，
that is to use implicit indices, and by implicit indices, we mean by we mean that what is at 那就是使用隐式索引，而隐式索引 是指我们的意思是什么是在
index one at index one this is b, so B will be printed for example, or B will be fetched, 索引一处的索引一这是 b，因此 B 将 被打印，例如，或 B 将被提取，
and then you move to do which is C then C will be fetched, and these are the values 然后你开始做 C 然后 C 将被获取，这些是值
that will be printed, but the behavior might be different, you might be expecting to use 这将被打印，但行为可能会有所 不同，您可能希望使用
explicit indices, which means access one colon three, and when the explicit indices are used, 显式索引，这意味着访问一个 冒号三，当使用显式索引时，
the last index is also included. And in that case, you might be expecting the index one 最后一个索引也包括在内。在这种 情况下，您可能会期待索引一
is of a so as should be printed, and index three is of B and B should be printed. And 是 a 所以应该打印，索引三 是 B 和 B 应该打印。和
this configure might be there if if this is there. So to handle that there is there are 如果存在，则此配置可能 存在。所以要处理有
two functions one is called l OC. And another method is called i l OC, whenever you call 两个函数一个叫做l OC。而另一种方法 称为 i l OC，无论何时您调用
LLC, that means you are using explicit indices. I mean, you're forcing to use explicit index. LLC，这意味着您正在使用显式索引。我 的意思是，您强制使用显式索引。
And whenever you call, I LSE that means you're accessing elements using the implicit index 每当你打电话时，我 LSE 这意味着 你正在使用隐式索引访问元素
what whatsoever. So let's, let's practice this and see the confusion. See the detail 不管什么。所以，让我们练习 一下，看看混乱。查看详情
of this kind of confusions in in here Jupyter Notebook. So let's say we have a series object, 在这里 Jupyter Notebook 中的这种混乱 。假设我们有一个系列对象，
let's say a equals PD dot series. And let's say it has values as a, b, and c, NASA value. 假设等于 PD 点系列。假设它 的值为 a、b 和 c，NASA 值。
These are the values and index as let's say One, three and five let's add these are the 这些是值和索引，比如一、 三和五，让我们添加这些是
indices let's say this is eight Okay, let's say we access a using one that means that 指数让我们说这是八 好吧，假设 我们访问一个 using one 这意味着
means the explicit index and that is this let's say B access and using the slicing operator. 表示显式索引，也就是说 B 访问并使用切片运算符。
Now, this will use implicit indices and it will access I mean it will access these B 现在，这将使用隐式索引，它将 访问我的意思是它将访问这些 B
and C because one colon three using indices implicit indices results that and we might 和 C 因为一个冒号三使用索引隐式 索引结果，我们可能
be might be expecting that use this kind of stuff. So, if we are really interested in 可能会期待使用这种东西。 所以，如果我们真的对
using explicit indices, what should we do is we should call the lat function a lock 使用显式索引，我们应该做的 是我们应该将 lat 函数称为锁
and then one colon three that means, use explicit indices there is to remove the confusions 然后一个冒号三意味着，使用 显式索引来消除混淆
now, it will use the explicit index one and three and if for example, we are interested 现在，它将使用显式索引一和三 ，例如，​​如果我们感兴趣
in using implicit indices, then it is good to use ilok function Yeah, now, one one column 在使用隐式索引时，最好使用 ilok 函数 是的，现在，一列
three is to use implicit indices and the implicit indices are like these. So, and like in series 三是使用隐式索引，隐式索引就 是这样。所以，就像系列一样
objects you can you can you can do the same in data frame objects. Once you are using 对象你可以你可以你可以在数据框对象 中做同样的事情。一旦你使用
lock and ilok then the further indexing inside these square brackets is exactly the same lock 和 ilok 然后这些方括号内 的进一步索引完全相同
like NumPy. So, whether you use log or ILOG, the indexing mechanism is exactly that the 像 NumPy。因此，无论您使用 log 还是 ILOG，索引机制正是
slicing mechanism is exactly the same like, like you you you have used in in NumPy. I 切片机制与您在 NumPy 中使用 的完全相同。一世
mean all indexing that stays the same log means you're using explicit index ILOG means 意味着保持相同日志的所有索引意味 着您正在使用显式索引 ILOG 意味着
you are using explicit implicit index. Let's say for example, we have our data frame, I 您正在使用显式隐式索引。比方说， 例如，我们有我们的数据框，我
guess D, that's our data frame available to us. Let's say I want to access d dot ilok. 猜 D，这是我们可用的数据框 。假设我想访问 d dot ilok。
Let's say I want to access the second row completely the second record, oh, the record 假设我想完全访问第二行 的第二条记录，哦，记录
that is indexed at look at an index at two, which is a third row completely, let's say 索引为 2 处的索引，完全 是第三行，比方说
I want to 我想要
access that. Now this two is acting as this two is acting as, for example, if you see 访问那个。现在这两个正在作为这 两个作为，例如，如果你看到
the the second row or the or the row at the second index, which is a third row that is 第二行或第二个索引处 的或行，即第三行
completely this edit returns that once you have used a lock, for example, and mostly 完全此编辑返回，例如，一旦您 使用了锁，并且大多数情况下
people use ilok. Sometimes lock is also required. But I log is just to explicitly mentioning 人们使用ilok。有时也需要锁。但 我登录只是为了明确提及
that I'm using I'm going to use the implicit indexing scheme. Again, you can consider hold 我将使用隐式索引方案。 再次，您可以考虑持有
that thing as a matrix. And once you have applied this eye lock, then you're free to 那个东西作为矩阵。一旦你应用了 这个眼锁，那么你就可以自由地
play with the indices, like you play with two dimensional arrays, for example. I want 例如，使用索引，就像使用 二维数组一样。我想要
to for example, I want to reverse, for example, all the rows and I want to reverse all the 例如，我想反转，例如，所有 的行，我想反转所有的
all the all the structure, for example, let's say I want to do that. And you can see everything 例如，所有所有结构，假设 我想这样做。你可以看到一切
is reversed. I mean all the indexing like like nine by all indexing is there in, in 被逆转。我的意思是所有索引 都像九一样的索引都在，在
pandas. I mean, once you have used ilok inside is just just remember the NumPy indexing and 熊猫。我的意思是，一旦你在里面使用 了 il​​ok 只需要记住 NumPy 索引和
everything like so. Okay, so that's the log and I log function. In the next video, we 一切都是这样。好的，这就是日志和我 的日志功能。在下一个视频中，我们
are actually going to going to just practice the pandas to actually to actually work on 实际上只是要练习 熊猫来实际工作
our data file that is saved as a CSV file. So we will, we will show you how to how to 我们保存为 CSV 文件的数据文件。所以 我们会，我们将向您展示如何
actually add how to actually manipulate read and write the data and play with the data, 实际添加如何实际操作读取 和写入数据并使用数据，
the data, the real data that is there in in some CSV file, and how pandas will help you 数据，某些 CSV 文件中的真实数据 ，以及 pandas 将如何帮助您
to to manipulate the data very efficiently and very quickly. So hope to see you in the 以非常有效和非常快速地 处理数据。所以希望能在
next video. Okay, in this particular video, I will be talking about real data set. The 下一个视频。好的，在这个特定的视频 中，我将谈论真实的数据集。这
data set I have chosen just to show you some some functions that are available in pandas 我选择的数据集只是为了向您 展示一些 Pandas 中可用的功能
to work on real data set the data set I've chosen as COVID-19 data set that was available 处理真实数据集我选择作为可 用的 COVID-19 数据集的数据集
on kaggle. And it's surreal data set that contains information of victims recovered 在 kaggle 上。这是一个超现实的数据 集，其中包含恢复的受害者信息
the total number of recovered people in per country per province, the total number of 每个国家每个省的康复 总人数，总人数
died people and the total number of number of reported people per date available that 死亡人数和每个日期 报告的总人数
that data is available. Let's see the look and feel of that data in a file. Just to just 该数据可用。让我们看看文件 中数据的外观。只是为了
to see what kind of data we are talking about. Let's say this is our data. This is the serial 看看我们在谈论什么样的数据。假设 这是我们的数据。这是连续剧
number column that contains just the record number. That's, that's a column called observation 仅包含记录编号的数字列 。那是一个叫做观察的专栏
date. That's a date, that's a province or state. That's country or region that's last 日期。那是一个日期，那是一个省 或州。这是最后一个国家或地区
updated when the record is updated was the time and how many confirmed cases were there 更新记录更新时间 和有多少确诊病例
at that date, and how many deaths at that date and how many recovered at that date, 在那个日期，以及在那个日期有多少人 死亡以及在那个日期有多少人康复，
as the date is moving on and on, you will be seeing that the number of confirmed cases 随着日期的推移，您将 看到确诊病例的数量
and the number of recovered cases they will be increasing, maybe the number of deaths 并且康复病例的数量将会 增加，也许死亡人数
they also increase. So let's see this data. Let's read that data using pandas and do some 它们也会增加。那么让我们看看这个数据。 让我们使用 Pandas 读取数据并执行一些操作
manipulation of this data and see the look and feel of that data. In Jupyter, notebook. 操作此数据并查看该数据的外观 。在 Jupyter 中，笔记本。
Let's go to Jupyter Notebook and see. So first of all, I need this pandas library and pour 我们去 Jupyter Notebook 看看。所以首先 ，我需要这个熊猫库并倾倒
it that maybe somewhere I need this NumPy library as well. I'm also learning a psychic 也许在某个地方我也需要这个 NumPy 库。我也在学通灵
learn SK learn library because I want to, I want to use impute function, just to handle 学习SK学习库因为我想，我想 使用impute函数，只是为了处理
the missing values, it is just more powerful to use the I'm in the SK learn library there 缺失值，使用我在 SK 学习库 中的功能更强大
is also a Data Science Library package that is particularly a machine learning library, 也是一个数据科学库包 ，特别是机器学习库，
or our package that actually gives a better support or a larger support of handling missing 或者我们的包实际上提供了更好 的支持或更大的处理丢失的支持
data. Although here I have used this SK learn function just for an example. And but but 数据。虽然在这里我使用这个 SK 学习功能 只是作为一个例子。而且但是但是
I could have used this data frame fill any function or something like so but I'm just 我可以使用这个数据框填充任何 函数或类似的东西，但我只是
using that one. Okay, after importing all these, what I did is I just call PD dot read 使用那个。好的，在导入所有这些 之后，我所做的就是调用 PD dot read
CSV function, and I load that data and then I did this stuff one by one. Let's, let's CSV 函数，然后我加载该数据，然后我 一一执行这些操作。我们，我们
let's spend some time on all these commands one by one. And let's see in Jupyter Notebook, 让我们花点时间一一研究所有这些命令 。让我们在 Jupyter Notebook 中看到，
what is happening, let's go to Jupyter Notebook and actually read that file and do whatever 发生了什么，让我们转到 Jupyter Notebook 并 实际阅读该文件并执行任何操作
we are doing here. So first of all, import NumPy that is already imported. Import. 我们在这里做。所以首先，导入 已经导入的 NumPy。进口。
For example, pandas that is also already imported, then from SK learn dot impute import simple 比如已经导入的pandas，那么从 SK学习dot impute import simple
impurity. So let's let's use that or let's Okay, let's do that. From SK learn dot impute 不纯。所以让我们使用它，或者让我们 好吧，让我们这样做。从SK学习点插补
SK learn dot impute import simple in pewter, okay, import that because that's a new thing, SK learn dot impute import simple in pewter, 好 吧，import that 因为那是新东西，
we need to import that now read the data, for example, data frame in df. So df equals 我们需要导入现在读取的数据， 例如df中的数据框。所以 df 等于
PD dot read CSV. There is a CSV file read CSV. And it contains the path of the file. PD 点读取 CSV。有一个 CSV 文件读取 CSV。它包含文件的路径。
The path is located in my directory, it is located at this particular location COVID. 路径位于我的目录中，它 位于这个特定位置 COVID。
And the name of that is COVID, underscore 19 ESCO data. So COVID underscore 19 underscore 它的名称是 COVID，下划线 19 ESCO 数据。所以 COVID 下划线 19 下划线
data dot c s v. So let's read that file, the file will be read, if you just see that some data dot c s v. 所以让我们读取那个文件， 文件将被读取，如果你只是看到一些
of there is a function, let's say head that gives the top records or the records that 有一个函数，让我们说 head 给出最高记录或记录
appear just the very top that's that's what the data file that I was showing you in Excel, 出现在最顶部，这就是我在 Excel 中向您展示的数据文件，
it is showing just the first five records, I can show the first 10 Records, for example, 它只显示前 5 条记录，我可以 显示前 10 条记录，例如，
just by calling the head function in this particular way. Okay, great. Let's say I just 只需以这种特殊方式调用 head 函数 。好的，太好了。假设我只是
want to remove this real number because I think that is not required. And let's say 想删除这个实数，因为我认为 这不是必需的。让我们说
I want to remove this particular column. Because that is also not required. There are multiple 我想删除这个特定的列。因为 这也不是必需的。有多个
ways of doing that. I can call an t l function on this. And I can call the L function on 这样做的方法。我可以为此调用 t l 函数。我可以调用 L 函数
that. But there is another way of doing that by df dot drop df dot drop and in that you 那。但是还有另一种方法可以 通过 df dot drop df dot drop
just give the columns that you want to drop one column is serial number, I guess, what's 只给你想要删除的列，其中一 列是序列号，我猜，是什么
the column name? That's s and No. So you want to you want to drop that column and then you 列名？那是 s 和 No。 所以你 想要你想要删除那列然后你
want to drop this particular column with herring last update. So that is last update. So that 想要删除带有鲱鱼上次更新的特定列 。所以这是最后一次更新。以便
is I guess what is there 我猜那里有什么
Xs one in place Drew. So Xs one is justments. Mentioning, do do that stuff with columns Xs 一个就地德鲁。所以Xs 一是正义 。提到，用列做那些事
in place, equals true. That actually is, is telling that whatever this operation you are 就位，等于真。这实际上是，告诉 你无论你在做什么这个操作
going to do reflect the changes in this df frame. If we do not write in place to it, 将反映此 df 框架中的变化 。如果我们不写到位，
we'll do everything and return onto a temporary variable or underscore variable or whatever 我们将做所有事情并返回一个临时变量 或下划线变量或其他任何东西
we are saying, but the DF the data frame will stay unchanged. So in place true means do 我们是说，但数据帧的 DF 将保持 不变。所以到位真正意味着做
that changing in df variable itself. So now if we see df dot had flat say, it will no df 变量本身的变化。所以现在如果我们 看到 df dot 有 flat 说，它不会
longer be showing us the serial number column and the last updated column. What next we 不再向我们展示序列号列和最后更新 的列。我们接下来怎么办
can do we may we may want to rename this, this name to just date. For example, this 可以吗，我们可能想重命名这个 ，这个名字只是日期。例如，这
to maybe another, let's rename all these columns, using using the Rename function, df dot rename 也许是另一个，让我们重命名所有这些 列，使用重命名函数，df dot rename
columns equals two and then we have that dictionary again in place equals two. So let's use let's 列等于二，然后我们再次将该字典放置 在等于二的位置。所以让我们使用
use this read in function, TF dot rename. Let's do that. And here we have columns, columns, 使用这个读入函数，TF 点重命名。 让我们这样做。在这里我们有列，列，
if I spell right columns, and then that is dictionary what columns you want to change, 如果我拼写正确的列，然后 那是字典您要更改的列，
I want to change observation date, I want to change that to simply date, let's say and 我想改变观察日期，我想把 它改成简单的日期，比方说
I also want to change province slash state to simply simply state, our province province 我也想把省斜线状态改为 简单的状态，我们省省
that say simply that and I also want to change this country slash region to simply country. 简单地说，我也想把这个国家 斜线区域改为简单的国家。
So, maybe I want to change this country slash region to simply due to country cru and try 所以，也许我想将这个国家斜线区域 更改为仅仅由于国家 cru 并尝试
country and I want all that should be happen in place. So in place equals true. So after 国家和我希望所有应该发生的事情都 到位。所以就地等于真。所以之后
that, if you run that, on this particular step, and now if you see the state of df, 那，如果你运行它，在这个特定的步骤 ，现在如果你看到 df 的状态，
you will get like 你会像
so. Okay, these many, so they province country, confirm debts, and so on. So this is much 所以。好吧，这么多，所以他们省国家， 确认债务，等等。所以这是很多
nicer form than earlier. Moreover, we may have a lot of missing values, oh, one way, 比以前更好的形式。而且，我们可能 有很多缺失值，哦，一种方式，
this date format, the date format is not in a format that pandas internal date format. 这个日期格式，日期格式不是 pandas内部日期格式的格式。
So let's convert the date format into into into the internal pandas date format, using 所以让我们将日期格式转换 为内部pandas日期格式，使用
to to PD to date time function. So let's say df date equals to PD to date time, and convert 到 PD 到日期时间功能。所以让我们说 df 日期等于 PD 到日期时间，然后转换
this df date in that particular format. And now if you run this TF dot had to might be 此特定格式的 df 日期。现在如果 你运行这个 TF 点可能是
seeing the date format in a different way. See that that's the that's that's the date 以不同的方式查看日期 格式。看那是日期
format that the pandas is expecting. Now, we that that is just showing showing some 大熊猫期望的格式。现在 ，我们只是展示了一些
records if you want to see more records, we can see those let's say I want to just I want 记录 如果你想看到更多的记录，我们可以 看到那些让我们说我想要只是我想要
to just count or let's say let's just describe all the data at TF dot describe there is a 只是计数或让我们说让我们只描述 TF 点处的所有数据描述有一个
describe function that describe all most of the statistics of the data, I mean, the total 描述数据的所有大部分统计信息 的函数，我的意思是，总数
count of confirmed cases are these the deaths are these recovered are these these many columns 确诊病例数是这些死亡人数 是这些康复者是这些许多列
are there these many values are there. The mean is that and standard deviation is the 有这么多值吗？平均值 是，标准差是
minimum 25. And these are the statistics. Let's say there is another function info df 最少 25 个。这些是统计数据。 假设还有另一个函数信息 df
dot d A dog info. If you call that function info, it will give us the more information dot d 一条狗的信息。如果您调用该函数 信息，它将为我们提供更多信息
about the null increase and the nominal increase and so on. For example, if you see the total 关于零增长和名义增长等。 例如，如果您看到总计
number of data columns are six, the total number of records are 6162. The date increase 数据列数为6，总记录 数为6162。日期增加
is always available. The province entries are only 3700 available, the rest increase 始终可用。全省条目仅 3700个可用，其余增加
our null increase, so province increase most of the increase or null increase and they 我们的零增长，所以省增加了大部分 的增长或零增长，他们
are there, maybe we want to drop those or maybe we want to impute those increase and 在那里，也许我们想放弃那些， 或者我们想把这些增加归咎于
stuff like so, but they are not increased that are available in the province column, 像这样的东西，但它们没有 增加，在省列中可用，
some of the province, some of the province values are no longer available. Let's see 某些省，某些省的值不再 可用。让我们来看看
that here. For example, this is not available, this is not available, this is not available. 就是这里。例如，这个不可用， 这个不可用，这个不可用。
And that's what the real state of the data is this is not available, this is not available 这就是数据的真实状态这 是不可用的，这是不可用的
and so on. So this can happen. Okay, next, what we do is, we actually be actually use 等等。所以这可能发生。好的，接下来 ，我们要做的是，我们实际上是在使用
the simple computer just to impute the missing values. One ways to do that using simple mburo 简单的计算机只是为了估算缺失值。使用 简单的 mburo 做到这一点的一种方法
from SK learn. Another way is, as we already know, just df dot fill na fill na with, let's 向SK学习。另一种方法是，正如我们已经知道 的，只是 df dot fill na fill na with，让我们
say a bit let's say not available with let's say a string, some string not available, that's 说一点 假设不可用 假设一个字符串 ，某些字符串不可用，那就是
it that string and with that, if you fill that fill any using that now, after that, 它是那个字符串，然后用那个，如果你 现在用那个填充任何填充，在那之后，
we will be having all that data, the missing values will be filled according to Let's see 我们将拥有所有数据，缺 失值将根据让我们看看
some missing values because in the province there were some missing values. Now you can 一些缺失值，因为在该省存在 一些缺失值。现在你可以
see for example, let me go on and left Yeah, so not available not available, we can we 看例如，让我继续离开 是的，所以 不可用 不可用，我们可以
can use that or we can use a fancy kind of thing that is available by a psychic learn 可以使用它，或者我们可以使用 通灵者可以获得的奇特的东西
and so on. Okay, after that, if you now see the information info, now, you will not be 等等。好的，之后，如果你现在 看到信息信息，现在，你不会
seeing any null value, all the columns are there, oh, this was not in place. So don't 看到任何空值，所有列都在那里 ，哦，这没有到位。所以不要
fill na that is let's change the DF with it. So this doesn't happen in place, df just changed 填充 na 那是让我们用它来改变 DF。 所以这不会发生，df只是改变了
the DF. Okay, df changes. Now, if we now call the info, there is no null value anymore. DF。好的，df改变了。现在，如果我们 现在调用信息，则不再有空值。
Yeah. 是的。
So I am this video here. In the next video, I will show you this group by command to just 所以我在这里有这个视频。在下一个 视频中，我将通过命令向您展示这组
see these kind of stuff in a more detailed way. Because this this particular video is 以更详细的方式看待这些东西 。因为这个特别的视频是
getting lamp here lanthier. me I'm stopping here in this particular location. Next time, 让这里的灯更亮。我我要停 在这个特定的位置。下次，
I will show you the group by command in the in the panda's data frame. And I will show 我将在熊猫的数据框中按命令 向您展示分组。我会展示
you what that does. So, we will explore all that code that is written here. And we will 你这是做什么。因此，我们将探索 这里编写的所有代码。我们会
have in the in the upcoming videos when we will see the plotting and matplotlib we will 在即将到来的视频中，我们 将看到绘图和 matplotlib
be using the same data file to work more. And to get more insight how the how this pandas 使用相同的数据文件进行更多工作 。并更深入地了解这只大熊猫如何
and matplotlib and NumPy in combination how they can actually how they can actually play 和 matplotlib 和 NumPy 结合起来 ，他们实际上可以如何玩
a very important role in analyzing a very, very large real data files. Okay, so I end 在分析非常非常大的真实数据文件中起 着非常重要的作用。好的，所以我结束
this video here. I will start the next video right from this command. And I will tell you 这个视频在这里。我将从这个命令 开始下一个视频。我会告诉你
what is happening what is the scope baikman so hope to see you in the next video. Okay, 正在发生的事情 范围 baikman 所以希望 在下一个视频中见到你。好的，
in the last video, we were discussing this COVID-19 file, and we reached here but we 在上一个视频中，我们讨论了这个 COVID-19 文件，我们到达了这里，但我们
didn't use this SK learn in pewter, we just use the fill na function of data frame. Now 没有使用这个 SK 在锡中学习，我们只是 使用数据框的填充 na 功能。现在
let's discuss this group by command or a Curie in in pandas that is much more visible. Let's 让我们通过命令或熊猫中更明显 的居里来讨论这个组。让我们
say our goal is now for example, if you go to go back to Jupiter, if you see your dear 说我们现在的目标是，例如，如果 你回到木星，如果你看到你亲爱的
df dot head, or all, at the D f dot head, let's attend records. If you want to see that df 点头，或全部，在 D f 点头， 让我们参加记录。如果你想看那个
there are so many records, let's just see 10. Let's see, what you want to do is you 这么多记录，我们只看10条。让 我们看看，你想做的就是你
want to just see how many, how many total confirmed cases are there in each country, 只想看看每个国家有多少 ，总共有多少确诊病例，
regardless of their date. And, for example, you want to just see all the all the all the 不管他们的日期。而且，例如， 您只想查看所有所有所有所有
confirmed cases, all the deaths, and all the recovered cases in each country for all the 每个国家的所有确诊病例、所有 死亡病例和所有康复病例
dates and for all the provinces combined together. One way to do that is to write a group by 日期和所有省份合并在一起。 一种方法是写一个组
command for example. That's a df two equals df dot group by and in group by what you see 命令例如。这是一个 df two 等于 df dot group by 和 in group by 你所看到的
is for what kind of columns you want to you want to group all these all this data. So 是针对您想要对所有这些数据 进行分组的列类型。所以
for example, you want to group by country. country. So that's your grouping. Now after 例如，您想按国家/地区分组。国家 。这就是你的分组。现在之后
gopeng What do you want to see what kind of what kind of what kind of, for example the gopeng你想看什么样什么样 什么样什么样的，比如
values you want to see because now you're dropping? Well after grouping I really Want 你想看到的值，因为现在你正在放弃 ？好吧，分组后我真的很想要
to see because data is gone once I drop, all the dates, they are grouped together all the 看看因为一旦我删除数据就消失了， 所有的日期，它们都被分组在一起
prevents that are grouped together. So, what I really want to see is just the country and 防止组合在一起。所以，我 真正想看到的只是国家和
I want to see the confirmed cases. So, pick all these records confirmed, and then I want 我想看看确诊病例。所以，选择所有 这些确认的记录，然后我想要
to see deaths and recovered. So, for example, if I want to deaths, and let's say then I 看到死亡和康复。所以，举例来说， 如果我想死，让我们说那么我
want to see the recovered cases are E and just I want a big group all the countries 想看到恢复的病例是 E 只是我 想要一个所有国家的大集团
together group all these things together and add all the records under each country. So 一起将所有这些东西组合在一起并添加 每个国家/地区下的所有记录。所以
sum all of them, and maybe we want to reset any index if it is there. So for example, 将所有这些相加，也许我们想重置 任何索引（如果存在）。例如，
preset, we set index. So that So, after this Curie For example, this group by query, what 预设，我们设置索引。所以，所以，在这个 居里之后，例如，这个group by query，什么
will happen is this df two will contain a summary of the data with respect to each country 将会发生的是，这个 df 2 将 包含每个国家/地区的数据摘要
and the total for example, in this particular country, the total confirmed cases are these 和总数例如，在这个特定国家 ，确诊病例总数是这些
all confirmed cases till now, and the deaths of these and recovered as these for this country 到目前为止，所有确诊病例，以及这些 病例的死亡人数和为这个国家康复的人数
for each country, now, each country is describing Australia for example, in our till, till now, 对于每个国家，现在，每个国家都在描述澳大利亚 ，例如，在我们的直到现在，
Australia has total these confirmed cases, these total deaths, and these are recovered 澳大利亚总共有这些确诊病例， 这些总死亡人数，这些都已康复
cases and so on. So, that is if we want to group all these with respect to country, what 案件等。所以，也就是说，如果我们想 根据国家/地区对所有这些进行分组，
if we want to group all these with respect to country and then date for example. So, 例如，如果我们想根据国家和日期 对所有这些进行分组。所以，
first we want to group them by country, so country and then for each country, display 首先我们想按国家对它们进行分组， 所以国家然后对于每个国家，显示
all the dates, and then do the same stuff, the the Curie will stay almost the same. A 所有日期，然后做同样的事情 ，居里将几乎保持不变。一种
group by command will say almost the same with one kind of group by command 会说几乎相同 的一种
with one kind of let's say we want to first group by country, once the, it is grouped 有一种假设我们要先按国家 /地区分组，一旦分组
by the country, then I want to group them by date. And now I want to see all the results 按国家/地区，然后我想按日期对它们 进行分组。现在我想看看所有的结果
in the form of I want to see the data as well. And what will happen now is for each country, 以我也想查看数据的形式。现在 将要发生的是每个国家，
its trend with respect to all the dates that will be displayed here. So let's see df two 它相对于将在此处显示的所有日期 的趋势。所以让我们看看 df 二
now, df two. So if you see df two now, you can see, for example, this particular country, 现在，df 两个。所以如果你现在看到 df 2， 你可以看到，例如，这个特定的国家，
it has just one record in this country, it has one record, then this country for this 它在这个国家只有一项记录，它 有一项记录，那么这个国家为此
date has this record for the same country and other date has same record and all the 日期在同一个国家有这个记录， 其他日期有相同的记录，所有的
data is also sorted. I mean, now you can see all the records in a very incremental way. 数据也是排序的。我的意思是，现在您可以 以非常增量的方式查看所有记录。
So that may give you a very good look and feel of what is happening or, for example. 因此，这可能会让您对正在发生的事情有 一个非常好的外观和感觉，或者，例如。
Another thing What if you want to what if you want to, for example, find out all the 另一件事如果你想要什么 ，例如，找出所有
records, all the records, you just want to find out all the records? Let's do three, 记录，所有的记录，你只是想找出 所有的记录？让我们做三个，
four, which the the confirmed cases, for example, the confirmed cases are are more than 100. 四、确诊病例，比如确诊 病例超过100例。
Let's find out all the records. Let's, let's let's let's get just let's just pick all the 让我们找出所有的记录。让我们， 让我们让我们让我们选择所有的
records for which the confirmed cases are larger than 100. And let's copy all these 确诊病例大于 100 的记录 。让我们复制所有这些
records just those records in this. So if we do that, we have d3 available, and we have 仅记录此中的那些记录。所以如果 我们这样做，我们有 d3 可用，我们有
d3. This, I mean, these are just the records in which the confirmed cases are for sure d3.这，我的意思是，这些只是 确诊病例肯定的记录
larger than 100. Just those. Yeah, so we can do. I mean a lot of a lot of data analysis, 大于 100。就是那些。是的，所以我们可以这样 做。我的意思是很多很多的数据分析，
the real data analysis, a lot of a lot more, I've just shown you a very small snapshot 真正的数据分析，还有很多很多，我 只是给你展示了一个很小的快照
of what we can do with pandas on the real data set. I mean, there is a lot more that 我们可以在真实数据集上用熊猫 做什么。我的意思是，还有很多
we can do with this pandas library, on real data sets on multiple data files, combining 我们可以使用这个 Pandas 库，在多个 数据文件的真实数据集上，结合
them together, joining them together, seeing their correlation, a lot of stuff. And this 它们在一起，将它们连接在一起，看到 它们的相关性，很多东西。和这个
pandas really is a very, very fancy and very high level library, very high level package pandas 真的是一个非常非常 高级的库，非常高级的包
to work with data. So due to time limitations, I'm just ending this pandas here although 处理数据。所以由于时间限制，我只是 在这里结束这个熊猫，虽然
there is much more to explain in that, but in the next video we will be jumping towards 还有更多要解释的，但在下 一个视频中，我们将跳到
matplotlib just we will see some some functions of matplotlib. And we will see very briefly matplotlib 只是我们将看到一些 matplotlib 的功能。我们将非常简短地看到
how can we plot How can we analyze data using visual graphs or stuff like so. So, that that 我们如何绘制我们如何使用可视化图表 或类似的东西来分析数据。所以，那个
sometimes this visualization of different attributes of the data give very good insight 有时，这种数据不同属性的 可视化提供了很好的洞察力
to the data wherever possible, wherever possible. If the visualization is possible if the data 尽可能地访问数据。如果可视化 是可能的，如果数据
dimensionality in a way are the visualization techniques are in a way that you can visualize 维度在某种程度上是可视化 技术的方式，您可以可视化
the trends in the data, that gives you much more much better insight than the numbers 数据的趋势，比数字 给你更好的洞察力
or statistical results, but it completely depends in what situation you can visualize 或统计结果，但这完全取决于 您可以可视化的情况
the data there are situations, high dimensional data, for example, is not always visualizable. 数据在某些情况下，例如高维 数据并不总是可视化的。
So, in those cases, the statistical results of the numbers may play a more important role. 因此，在这些情况下，数字的统计 结果可能会发挥更重要的作用。
But in more in many cases, visualization give a very good initial insight into the data 但在更多情况下，可视化可以 很好地初步了解数据
and the design process can become very, very fast if you know something about the data, 如果你对数据有所了解，设计 过程会变得非常非常快，
whether you get that information by visualization or by other statistics or whatever. So, in 无论您是通过可视化还是其他统计数据或 其他方式获取该信息。所以，在
the next video, I will be just explaining some very few functions of matplotlib. And 下一个视频，我将只解释 matplotlib 的一些极少数功能。和
then we will be, then we will be exploring the same file, and we will be doing some stuff. 然后我们会，然后我们将探索同 一个文件，我们将做一些事情。
Doing some stuff using the plots and matplotlib. And doing, seeing the trends of death rates, 使用绘图和 matplotlib 做一些事情。并且 这样做，看到死亡率的趋势，
seeing the trends of I mean, we'll be playing with this file a bit more using matplotlib 看到我的意思是，我们将更多地 使用 matplotlib 来处理这个文件
as well. So hope to see you in the next video. Okay, in this video, I'm going to discuss 以及。所以希望在下一个视频中见到你 。好的，在这个视频中，我将讨论
matplotlib a very powerful package for plotting graphs and scatter plots, line plots and 3d matplotlib 一个非常强大的包，用于 绘制图形和散点图、线图和 3d
plots and plots on the globe and whatnot, I mean, very, very powerful tool. The most 地球上的情节和情节等等，我的意思 是，非常非常强大的工具。最多
important module in this matplotlib, or the most popular module, or the most used module 这个matplotlib中的重要模块，或者最 流行的模块，或者最常用的模块
is biplot. So we can import matplotlib.pi plot as PLT. Another way of writing the same 是双线图。所以我们可以将 matplotlib.pi 图导入为 PLT。另一种写法
kind of stuff is we can we can write like from Matt matplotlib 我们可以像 Matt matplotlib 那样 写一些东西
from matplotlib import by plot as PLT. So either way is fine whether we write this as 从 matplotlib 按图导入为 PLT。所以 无论我们把它写成哪种方式都可以
a documentation or that one that is fine as MP is for NumPy. So let's create some points, 一份文档或像 MP 一样适用于 NumPy 的 文档。所以让我们创建一些点，
just just just make our first plot. Let's, let's make some points starting from zero, 只是制作我们的第一个情节。 让我们从零开始做一些点，
let's say all the points starting from zero till 10. And let's create 1000 points in between. 假设所有点从零开始到 10。让 我们在两者之间创建 1000 个点。
One way to do that is to use built in function or a method in NumPy, which is linspace or 一种方法是使用内置函数或 NumPy 中的方法，即 linspace 或
linearly spaced points starting from zero ending at 10. And there are 1000 of those 从零到 10 的线性间隔点 。 其中有 1000 个
points. Let's say this is our x and this is our let's say y which is NP dot sine, the 点。假设这是我们的 x，这是我们 的假设 y，它是 NP 点正弦，
sine function is actually will apply element by element on this NumPy array. And then this 正弦函数实际上会在这个 NumPy 数 组上逐个元素地应用。然后这个
PLT will plot will actually plot x comma y all the points in front of you. So let's go PLT 将实际绘制 x 逗号 y 前面 的所有点。所以我们走吧
to Jupyter Notebook and actually see this matplotlib in running form for the very first 到 Jupyter Notebook 并实际看到这个 matplotlib 以运行形式第一次出现
time, oh, we have seen this matplotlib. When we saw NP dot random, we only plotted a histogram. 时间，哦，我们已经看到了这个matplotlib。当我们 看到 NP dot random 时，我们只绘制了一个直方图。
While this is not the first time we actually have seen this once, once, once before. So 虽然这不是我们第一次真正看到 过一次，一次，一次。所以
import mat plot lib.pi plot as PLT. That's your import command. For example. Now PLT 将 mat plot lib.pi plot 导入为 PLT。那 是您的导入命令。例如。现在PLT
is available. Let's say x is NP dot Lin. space. Let's start from zero. Go to 10 and generate 可用。假设 x 是 NP 点 Lin。空间。让 我们从零开始。转到 10 并生成
let's say 1000 points. That's it. That's your x, y might be your MP dot sine x. That's it. 比方说1000分。就是这样。那是你的 x，y 可能是你的 MP 点正弦 x。就是这样。
That's your y. And then what you do is you say okay, PLT dot plot, x comma y point by 那是你的y然后你做的是你说 好的，PLT点图，x逗号y点
point, and then you press Shift, enter. That's it. Oh, this plot is there in front of you. 点，然后按Shift，回车。就是这样 。哦，这个情节就在你面前。
That simple. I mean, that simple. Can you imagine? This? Is that simple? Yeah, this 就那么简单。我的意思是，就这么简单。你 可以想象？这个？这么简单吗？是的，这个
is that simple. So I'm in plotting. This is a line plot. For example, if we want a scatterplot, 就是这么简单。所以我在策划。这是一 个线图。例如，如果我们想要一个散点图，
we can say okay, PLT dot scatter, there is a scatter function that allows us to plot 我们可以说好的，PLT dot scatter，有 一个散点函数可以让我们绘制
all these endpoints form rather than rather than this line form. These are all these a 所有这些端点形成而不是这 种线形式。这些都是这些
lot of points. That's why you you're not seeing these scatters. So let me let me let me take 很多点。这就是为什么你没有看到 这些散点。所以让我让我让我拿
this n x s viewer. Let's see. Let's take x as let's just take a few points, let's say 这个 n x s 查看器。让我们来看看。让我们 把 x 当作让我们只取几点，让我们说
just just just 30 points. Let's see the corresponding 30 points, see, they remember the indexing 只有30分而已。让我们看看对应的30 个点，看，他们记得索引
of NumPy arrays and just using that. So now use the scatter plots, and you have this, NumPy 数组并使用它。所以现在 使用散点图，你有这个，
oh, that's a scatter. Maybe we want to use, let's say, start from the very beginning, 哦，那是散点。也许我们想使用 ，比方说，从一开始就开始，
due to end and big every, let's say, attempt point. And do the same with why, just to just 由于结束和大每个，比方说，尝试点 。对为什么做同样的事情，只是为了
to see a plot in a better way, just sample some points. So that's the scatterplot. It 要以更好的方式查看绘图，只需对一些 点进行采样。这就是散点图。它
is just like I'm in the points and so on. It is not a it is not a continuous plot, like 就像我在积分等等。这不是一 个它不是一个连续的情节，就像
the line plot, it's a scatterplot, we're going to annotate this scatter plot, we can change 线图，它是一个散点图，我们要注释 这个散点图，我们可以改变
these colors to any color we want. For example, we can we can have a prop property, for example, 这些颜色到我们想要的任何颜色。例如 ，我们可以拥有一个 prop 属性，例如，
color is equal to let's say, red, and everything will become red. Yeah, so that's right, we 颜色等于红色，一切都会变成 红色。是的，没错，我们
can have I mean, we can label it we can x label it, we can via label, there are a lot 我的意思是，我们可以给它贴上标签，我们可以 给它贴上标签，我们可以通过标签，有很多
of properties. But but the but the main point is plotting is that simple plotting is that 的属性。但是，但主要的一 点是绘图是简单的绘图是
quick, using matplotlib. So yeah, this matplotlib is really, really powerful, we have just seen 快速，使用 matplotlib。所以是的，这个 matplotlib 真的非常强大，我们刚刚看到
a snapshot, just a plot function and a scatter function there, there are a lot of properties 一个快照，只有一个绘图函数和 一个散点函数，有很多属性
to be said, there are a lot of things to be considered. And we will see we will see actually 要说，有很多事情要考虑 。我们会看到我们会看到
one one lanthier good use on this COVID-19 file. And we will we will actually analyze 对这个 COVID-19 文件的一个很 好的使用。我们将实际分析
the data trends and the confirmed trends and some trends that and we will plot them and 数据趋势和确认的趋势以及一些 趋势，我们将绘制它们和
see the trends really using matplotlib. So But before that, let me let me show you that. 真正使用 matplotlib 查看趋势。所以 在此之前，让我让我告诉你。
If you call for if you call this plot multiple times, for example, maybe with different colors, 如果你多次调用这个图，例如 ，可能用不同的颜色，
then you will be having a lot of curves on the same on the same plot, for example. So 例如，那么您将在同一个图 上有很多相同的曲线。所以
for example, let's see PLT dot plot x comma y, let's say with with color, let's say color 例如，让我们看看 PLT 点图 x 逗号 y， 让我们说与颜色，让我们说颜色
equals to blue. 等于蓝色。
You can write blue, the whole or you can like write just be that's fine PLT dot plot, x, 你可以写蓝色，整个，或者你可以 写只是很好的PLT点图，x，
and let's say NP dot cause x and the color you are interested in, and let's say the color 让我们说 NP 点导致 x 和您感兴趣 的颜色，让我们说颜色
is, let's say green. And that's perfectly okay. And that will give you two plots in 是，让我们说绿色。这完全 没问题。这会给你两个情节
the same figure, sort of, and you can just good to go. Well, yeah, so that more you can, 同样的数字，有点，你可以很好地 去。嗯，是的，这样你就可以更多，
for example, you can plot with a green, green color, and you want the solid line, or you 例如，您可以使用绿色、绿色进行 绘图，并且您想要实线，或者您
want, for example, Seon color in a dashed line, or you want a dash and dot black line 例如，想要虚线中的 Seon 颜色， 或者您想要一条虚线和点黑线
or, or maybe you want to completely dotted line in red color. So there are several things 或者，或者您可能想要完全 红色的虚线。所以有几件事
that are available in matplotlib. This is just a very few very simple snapshot. And 在 matplotlib 中可用。这只是 极少数非常简单的快照。和
I have given you a very quick start in and actually actually the whole point is using 我已经给了你一个非常快速的 开始，实际上整个重点是使用
Matlab is that quick, I mean, you can you have your data, you just plug in their data, Matlab 就是那么快，我的意思是，你可以 拥有你的数据，你只需插入他们的数据，
you just call the plot function, and you're good to go for analysis. Okay. In the next 您只需调用 plot 函数，就可以 进行分析。好的。下一个
video, we are where we will actually walk through the we will actually walk through 视频，我们是我们将真正走过 的地方 我们将真正走过
the COVID-19 data set. And we'll actually analyze the trends and to add the death rate COVID-19 数据集。我们将实际 分析趋势并添加死亡率
transfer each country individually, and then we will see the depth confirmed and the recovery 单独转移每个国家，然后 我们将看到深度确认和恢复
trend of the overall world till the 16th of March till the day till the data data is available. 直到 3 月 16 日，直到数据可 用的那一天为止的全球趋势。
So next video will be actually the viewer will see the running form of pandas and matplotlib. 所以下一个视频实际上是观众 将看到pandas和matplotlib的运行形式。
Together, so hope to see you in the next video. Okay, I already have shown you the COVID-19 在一起，所以希望在下一个视频中见到你 。好的，我已经向您展示了 COVID-19
file. And here I have a notebook on that that uses matplotlib and pandas to find out the 文件。在这里我有一个笔记本，它 使用 matplotlib 和 pandas 来找出
depths conformations and recovery trends using using different plots. So let me import all 使用不同的绘图深度构造和恢复 趋势。所以让我导入所有
the packages that I need. I need a plot by plot function from matplotlib. I need pandas 我需要的包。我需要来自 matplotlib 的绘图函数绘图。我需要熊猫
somewhere I need NumPy. And I'm using a simple mburo here for missing values. So let's run 我需要 NumPy 的地方。我在这里使用一个简单 的 mburo 来处理缺失值。所以让我们跑
this. Let's run this command. And yes, everything is imported. Now let's load the data that 这个。让我们运行这个命令。是的，一切 都是进口的。现在让我们加载数据
I've shown you earlier. The data is available now. And let's run this thing that is the 我之前已经给你看过了。数据现在 可用。让我们运行这个东西
first 50 Records. Yeah, remember that? Yeah, so that's the data that is available if if 前 50 条记录。是的，记得吗？是 的，这就是可用的数据，如果
you just want another view another view of the data That's the data file, which is COVID-19 你只想要另一个视图 另一个数据 视图 那是数据文件，它是 COVID-19
file. And it has observation day province country, last update, confirm, to date, death 文件。它有观察天省国家，最后 更新，确认，迄今为止，死亡
to date and recover to date for each country and for each province individually. Okay, 为每个国家和每个省单独 恢复到日期。好的，
great. So that's what we have. Now what we can do is, now let's drop the serial numbers 伟大的。这就是我们所拥有的。现在我们 能做的是，现在让我们去掉序列号
and last update using in place that and rename the columns that we did already in a previous 和上次更新就地使用，并重命名 我们在之前已经做过的列
video as well. Let's convert the date into the pandas built in date, frame. Okay, let's 视频也是如此。让我们将日期转换为 内置日期框架的熊猫。好的，让我们
use the psychic learn in pewter, sk learn in pewter, using the constant strategy, there 使用锡制的通灵学习，锡制的 sk 学习，使用恒定策略，有
are a lot of strategies there, let's use a constant strategy. And this period or data 那里有很多策略，让我们使用一个 恒定的策略。而这个时期或数据
frame, in pure dot fit transform that will help imputing all the missing values with 框架，在纯点拟合变换中，这 将有助于将所有缺失值与
a constant strategy impure. So that's there. Okay, next, let's apply this group by command 不纯的恒常策略。所以就在那里。好的 ，接下来，让我们通过命令应用这个组
and group all of all the records using country for each country. And for all the dates, let's 并使用每个国家/地区的 country 对所有记录 进行分组。对于所有日期，让我们
sum all the records that sum all the values of records deaths and confirms using this, 对所有记录死亡的所有值求和的所有记录求 和，并使用此方法进行确认，
but now let's first country and then all it state, then the second country, then all it 但是现在让我们先说国家，然后说所有国家 ，然后说第二个国家，然后说所有国家
states and so on. We have seen that in one of our previous videos just running that again, 状态等。我们已经看到，在我们 之前的一个视频中再次运行它，
just for a double check. So that's what the data state is. So country one all it states 只是为了仔细检查。这就是数据 状态。所以国家一所有它说的
country to all it states. So this country has a lot of dates, then another country and 国家对所有国家。所以这个国家 有很多约会，然后是另一个国家和
so on. Next, let's see how many countries are there. In total, how many unique countries 很快。接下来，让我们看看有多少 个国家。总共有多少个独特的国家
are there. So what I, what I do is I find the column, I actually pick the column with 在那里。所以我，我所做的是我找到了 这个专栏，我实际上选择了这个专栏
country and call a unique function on that. And that gives me all the countries without country 并调用一个独特的函数 。这给了我所有没有的国家
repetition. And I just compute the length length of countries tell me how many unique 重复。我只是计算国家的长度 长度告诉我有多少独特的
countries are there in this data file? 这个数据文件中有国家吗？
There are 171 countries. So now my goal is for each country, I want to see what is the 有171个国家。所以现在我的目标 是针对每个国家，我想看看
trend of with respect to the date as the data is moving from the first day till 16th of 随着数据从第 1 天移动到第 16 天，相对于日期的趋势
March? What is the trend of death? patients? What is the trend of recovered patients and 行进？死亡趋势如何？耐心 ？康复患者趋势如何？
what is a trend of confirmed patients as the data moves on. So because we have 171 countries, 随着数据的发展，确诊患者的趋势 是什么？因为我们有 171 个国家，
so let's loop over each country again, again, and again, let's loop over what we do is for 所以让我们再循环一遍每个国家，再 循环一遍，再循环一遍我们所做的
ID x in the range of this, that's the loop you remember that. And what I do is let's ID x 在此范围内，这就是您记住 的循环。我要做的是让我们
find out the indices where the country is like this, let's find out the index all the 找出这个国家的指数， 让我们找出所有的指数
indices where the country is like that. Then what do you do I make a scatterplot. That, 国家就是这样的指数。那你怎么 做我做一个散点图。那，
with starting from this, and that, I just pick the confirmed cases and all the confirmed 从这个开始，我只挑确诊 病例和所有确诊病例
cases for this one country, I just pick those. And I look, I do that using this scatterplot, 对于这个国家的情况，我只选择那些。我 看，我使用这个散点图来做到这一点，
then I use another scatter plot, just to get all the recovered cases, then I do another 然后我使用另一个散点图，只是为了得到 所有恢复的案例，然后我再做一个
scatter plot to get all the depth cases. And then the title of the title of my figure becomes 散点图以获取所有深度案例。然后 我的人物标题的标题就变成了
the country name, the x labels the days, days since the first suspect, the wire label is 国家名称，x 标记天数，自第一个 嫌疑人起的天数，电线标签是
the total number of cases, the legend command actually will be there that will show what 案例总数，图例命令实际上 将在那里显示什么
eat that is in. So these kinds of labels that are rewriting here, they will appear in the 吃掉里面的东西。所以这些在这里 重写的标签，它们会出现
figure, then we force them to show that in each iteration show the show the fourth. So 图，然后我们强迫他们展示，在 每次迭代中展示第四个。所以
this will show the trends of confirms to cover some deaths for all 171 countries one by one. 这将一一显示所有171个国家的确诊人数 趋势，以涵盖部分死亡人数。
So if we run this command, we'll be having 171 plots in front of us. Let's see all of 所以如果我们运行这个命令，我们面前 会有 171 个图。让我们看看所有
those one by one. So yeah, so this is for the country. It has just one such thing. This 那些一一。所以是的，所以这是为了 国家。它只有一件这样的事情。这个
is for that this is for Afghanistan. As these moves on the confirmed cases that are even 是因为这是为阿富汗。随着这些 对确诊病例的影响，甚至
blue, they are moving up. These are the number of cases. These are the number of days since 蓝色，他们正在向上移动。这些是案件 的数量。这些是自此以来的天数
the first day. And the green is the number of recovered cases for Albania. That's the 第一天。绿色是阿尔巴尼亚 的康复病例数。那就是
trend for Algeria. That's the trend. I mean, these are each and everything is a separate 阿尔及利亚的趋势。这就是趋势。我的 意思是，这些是每一个都是独立的
that is for Argentina. That is for America. This is for America till 16th March, by the 那是给阿根廷的。那是给美国的。这 是针对美国的，直到 3 月 16 日，由
way, today. The new says that America is really in as dangerous position anyways, that's for 方式，今天。新的说，无论如何，美国 真的处于危险的境地，那是为了
Australia till till the date we have to do that is for Austria. Yeah, so these are all 澳大利亚直到我们必须这样做的日期 是为奥地利。是的，所以这些都是
the trends for all the countries. You see I'm in the matplotlib how powerful that is. 所有国家的趋势。你看我在 matplotlib 中有多么强大。
Although I walked through this code very quickly, but you can see this video again and again. 虽然我非常快速地浏览了这段代码，但是你 可以一次又一次地看到这个视频。
And then check how that happens. Yeah. So that's what this is for Finland. Oh, Finland 然后检查这是如何发生的。是的 。这就是芬兰的情况。哦，芬兰
is also in trouble. So France. Okay. So that is for Germany. And yeah, so all the countries 也有麻烦。所以法国。好的。这 就是德国。是的，所以所有国家
that are available in data set, they have these kind of plots. This is for Hong Kong. 在数据集中可用，他们有 这些图。这是给香港的。
And this is for India. And this is for Italy's or Italy's. Yeah. So that's it. So that is 这是针对印度的。这是给意大利的或意大利 的。是的。就是这样了。所以那是
for each country individually, what if we want the overall trend, or the overall confirm 对于每个国家，如果我们想要 整体趋势或整体确认怎么办
and the deaths and the recover trend for all the world together, so what I do is I big 以及全世界的死亡和复苏趋势 ，所以我所做的就是我大
I grew up all the data with date. So I pick the first date, and add all the records, then 我长大了所有的数据与日期。所以我选择 第一个日期，并添加所有记录，然后
the second date for all the records for all the countries and so on. And then I plot the 所有国家的所有记录的第二个 日期，依此类推。然后我绘制
trend using the scatterplot, again, confirmed record. And that's for all over the world 使用散点图的趋势再次确认了 记录。这适用于全世界
and see the trend, where the world is moving. So that's the trend of the world. As the days 并看到趋势，世界正在移动。所以 这就是世界的趋势。随着日子
are going on, these are the depth grand, that's a recovery trend. And that's a confirmation 正在进行中，这些是深度盛大，这是 一个复苏趋势。这是一个确认
trend that is moving on. Although I walked through or this notebook, the notebook will 正在发展的趋势。虽然我走过 的还是这本笔记本，笔记本会
be available to you. I walk over this notebook very quickly. But the goal was really to show 可供您使用。我很快地走过这本笔记本 。但真正的目的是为了展示
you the the I mean, that was a file may not be that informative, if you see that in Excel, 你我的意思是，如果你在 Excel 中看到 ，那是一个文件可能没有那么丰富，
but now it makes much more sense. When you see these blobs you know what is happening 但现在它更有意义了。当您看到这些 斑点时，您就知道发生了什么
and you have insight in the data. And later on, we may we may want to predict we may want 你对数据有洞察力。稍后，我们 可能想要预测我们可能想要的
to make predictions. And the next date what is going to happen, we may want to predict 做出预测。下一个日期会发生 什么，我们可能想要预测
using this plot or using some Machine Learning Library like psychic learn or TensorFlow or 使用此图或使用一些机器学习库 ，如通灵学习或 TensorFlow 或
something like that. Okay, so that's it. I can talk much more about pandas NumPy matplotlib 类似的东西。好的，就是这样。 我可以更多地谈论熊猫 NumPy matplotlib
of there are so many other data science packages, very important packages, one of those is SK 有很多其他数据科学包，非常 重要的包，其中之一是 SK
learn, we can that is for machine learning basic machine learning. Then there are other 学习，我们可以那是机器学习的 基础机器学习。然后还有其他
packages like TensorFlow for deep learning by torch for deep learning. There are a lot 用于深度学习的 TensorFlow 等软件包， 由用于深度学习的 Torch 提供。有很多
of packages with a lot of speciality is in data science and stuff. I just discussed a 有很多专业的包是在数据科学 和东西。我刚刚讨论了一个
few of those the most important of those do to manipulate the data to make predictions 很少有最重要的人会操纵 数据以进行预测
to make classification or regressions. For one, one way is to go to SK learn or psychic 进行分类或回归。一方面， 一种方法是去SK学习或通灵
learn. And if the data is huge, and you have a lot of large amount of data, and you have 学习。如果数据量很大，而且你 有很多大量的数据，而且你有
good expertise or deep learning, then you should go to either TensorFlow or pytorch 良好的专业知识或深度学习，那么 你应该去 TensorFlow 或 pytorch
these are the Python packages that are available for predictions, classification, regression 这些是可用于预测、分类 、回归的 Python 包
and a lot more, but either way, whether you are going to use scikit learn whether you're 还有更多，但不管怎样，你是否 打算使用 scikit 学习你是否
going to use TensorFlow or pytorch either way, you have to use pandas NumPy and sometimes 无论哪种方式都要使用 TensorFlow 或 pytorch，你必须使用 Pandas NumPy，有时
matplotlib to pre process the data and to make the data ready for for these kind of matplotlib 预处理数据并使数据 为这些类型做好准备
libraries to to perform predictions, either a either in the form of classification or 用于执行预测的库，可以 是分类形式，也可以是
in the form of regression. So so so this whole course was about for for beginners who want 以回归的形式。所以所以这整个 课程是为想要的初学者准备的
to who want to learn Python, specifically, I discussed a lot about the in a lot about 对于想学习Python的人，具体来说 ，我讨论了很多关于在很多关于
Python in general, then then then I spend some time not a lot amount of time sometimes Python一般，然后我有时会花 一些时间而不是很多时间
on exploring the data science packages as well. But, I mean, there is no end we can 关于探索数据科学包。但是， 我的意思是，我们没有尽头
explore more, we can talk about the packages more we can talk about other features of Python 探索更多，我们可以谈论包更多 我们可以谈论Python的其他功能
more, a lot of I mean, input formatting, output formatting, modules, packages, standard template 更多，很多我的意思是，输入格式 ，输出格式，模块，包，标准模板
library, file handling Internet Access database, 图书馆，文件处理 Internet Access 数据库，
I mean, 我的意思是，
this is a whole universe, I have discussed a few things for beginners. But But these 这是一个完整的宇宙，我已经为初 学者讨论了一些事情。但是这些
few things were very carefully selected for data scientists. The if you have this course 很少有东西是为数据科学家精心 挑选的。如果你有这门课
available to you as you have gone through all the course, you now have a very very good 在您完成所有课程后，您 现在有一个非常非常好的
understanding and now you can you can move towards further edit advanced courses towards 理解，现在您可以进一步 编辑高级课程
data science and you will be ready to implement the concepts in Python using using the packages 数据科学，您将准备好使用这些 包在 Python 中实现这些概念
I have discussed so far. So I thank you all and good luck. 到目前为止我已经讨论过了。所以我感谢大家 ，祝你好运。