Series corresponds to a one-dimensional sequence while DataFrame corresponds to a two-dimensional table structure It is a data structure of table type It contains a group of orderly columns similar to indexes Each index may contain values of a different type So, DataFrame may be regarded as a set of Series sharing the same index Let's see how to create a DataFrame A DataFrame object can be created with a list, tuple or dictionary or with ndarray or Series or with a file Here, in our example, we create it with a dictionary The method of creating DataFrame is similar to that for creating Series It has a corresponding function Please note that there are 2 upper case characters As we see, the two values in the dictionary are just our column index i.e., columns As for the column index since there's no special indication the default index is used here numbered from 0 Let's look at another method of creating DataFrame As we see, it's created from an array The created DataFrame is similar to the previous one with the only exception of indicating the index 1 2 3 After creating DataFrame we may view its row index, column index and value through the three common attributes of "index", "columns" and "values" Sure, it's also simple to modify a row index or column index or column index We may write it like this For example, we're to change the index just write down the updated value at the back There are many basic operations of DataFrame like to view, slice, select, which are among common ones Here are some simple cases For example, if we'd like to select data at Column 0 we may write it like this Sure this way is also acceptable What if we'd like to select several areas A lot of methods are available Here's one We may achieve it through "iloc" Of the two dimensions, the first dimension means the row and the second dimension, column This just means the first column of Row 0 and Row 1 So it is the first column of Row 0 and Row 1 4000 and 5000. Good Besides, we may modify a DataFrame object say, change the original values of elements with a specified column attribute In such a way, the original values have been changed into such a group of values Sure, we might also delete a column Just specify the column attribute Here, as we see another data column is deleted Apart from some basic operations DataFrame also offers very strong statistical power It offers a ton of functions for use For example, let's look at a simple case Find the lowest salary In DataFrame, as we see the result should be 4000 Then, how to find this value We might consider like this. First get the Series method, use "frame.pay" to find the minimum salary Obviously, as we guess, there might be a function like this one OK, here comes the result Please note that with the previous method of creating DataFrame our salary values have been converted into a string, which is worth our attention Let's look at another question Find the information of high-paid people If the high-paid standard here means being more than or equal to 5000 how do we solve this problem A test for you suddenly occurs to me For this problem, shall we use a loop to traverse a Series to solve it Sure, it's unnecessary Although the solutions in previous examples may seem natural to you in use have you found that the mode of data processing in pandas is the same as that in NumPy They both support batch operation of data So, we haven't written any loop statements Since the design of pandas, consideration has been given to one-time processing of one or several rows or columns since this way of vectorization has special realization Thus, apart from concise and efficient processing statements its execution is normally faster than a "for" loop Therefore, during data processing with pandas we should always give preference to vectorized operation to solve problems instead of a "for" loop Let's come to the problem On the basis of vectorized operation we may utilize Boolean indexing the same as the multidimensional array in NumPy to solve this problem We may write it like this inside the square brackets As we know, this is a Series For judging greater than or equal to 5000, it will actually have a group of values, right For example, for the first one, 4000, judged greater than or equal to 5000 its value is False The values of next two are True Finally, the two values with True will be output They are the two results Very convenient, right In this section, we've introduced the basic operation and statistical use of DataFrame More detailed methods and use will be illustrated next week in some practical cases Please do well understand DataFrame since it's really highly convenient and powerful Most data analyses can not go without it