WEBVTT - This file was automatically generated by VIMEO

0
00:00:10.420 --> 00:00:12.680
Hi everyone, and welcome to our six module,

1
00:00:12.850 --> 00:00:15.960
which will be focused on data analysis in pandas.

2
00:00:17.750 --> 00:00:20.880
Okay. To introduce our module first,

3
00:00:21.540 --> 00:00:25.920
we will learn what is pandas data frame and what are, uh,

4
00:00:26.050 --> 00:00:26.883
panda series.

5
00:00:28.420 --> 00:00:33.410
We'll learn how to get initial information about them and how to work with the

6
00:00:33.410 --> 00:00:38.020
most common data audit, uh, methods. We'll learn, uh,

7
00:00:38.170 --> 00:00:42.660
what are pandas data types, which are supported and how to cast them.

8
00:00:44.490 --> 00:00:48.760
We'll learn about this index, the multi-index and how to work with it.

9
00:00:50.110 --> 00:00:54.540
We'll also learn the most common data frame operations, like, uh,

10
00:00:54.560 --> 00:00:58.740
how to create new column or rename columns, how to filter columns or roles,

11
00:00:59.560 --> 00:01:03.300
how to change values based on some condition and so on.

12
00:01:04.970 --> 00:01:09.360
We'll learn how to work with apply method. Also,

13
00:01:09.590 --> 00:01:14.290
very important is to know how to merge data frames. Also,

14
00:01:14.290 --> 00:01:17.530
how to summarize data with pivot table,

15
00:01:17.740 --> 00:01:21.620
cross up and using group. And lastly,

16
00:01:21.880 --> 00:01:25.500
we will learn how to style data frames in Jupyter Notebook.

17
00:01:27.400 --> 00:01:30.020
Now let's talk about the Pandas data frame and series.

18
00:01:31.230 --> 00:01:34.460
Let's go to our notebook in the module six folder.

19
00:01:36.450 --> 00:01:39.000
It'll be better to explain you all the concepts.

20
00:01:45.370 --> 00:01:49.670
So what is pandas data frame? It is the most important pandas class.

21
00:01:50.020 --> 00:01:53.510
Basically, it is a two dimensional data structure,

22
00:01:53.860 --> 00:01:58.710
like a matrix or a two dimensional array or a

23
00:01:58.710 --> 00:02:00.550
table with rows and columns.

24
00:02:02.090 --> 00:02:06.790
You can also say it is a higher level of wrapper around MPI arrays.

25
00:02:07.010 --> 00:02:11.750
And this higher level of functionality provides us easier way how to work with

26
00:02:11.750 --> 00:02:16.480
the data. It also consists of multiple panda series as well.

27
00:02:17.060 --> 00:02:21.520
Uh, basically if we filter only one column or one row, for example,

28
00:02:21.780 --> 00:02:23.360
we will get a panda series,

29
00:02:25.390 --> 00:02:28.640
both panda series and data frame share.

30
00:02:28.670 --> 00:02:31.000
Some of the methods which you can apply on them,

31
00:02:31.980 --> 00:02:35.360
and some are specific just to data frame or series.

32
00:02:37.140 --> 00:02:40.400
Now, how to create a pandas data frame in Python.

33
00:02:42.590 --> 00:02:47.010
Uh, the most common way how to do it, it is with, uh, from dictionary method,

34
00:02:48.680 --> 00:02:53.630
which creates a data frame from a Python dictionary where the keys

35
00:02:54.130 --> 00:02:58.470
are column names and the lists are the values for each of the columns.

36
00:02:59.870 --> 00:03:04.450
Uh, we can create a pandas data frame also from, uh,

37
00:03:04.980 --> 00:03:09.770
lists of dictionaries around this. So

38
00:03:16.930 --> 00:03:21.390
we can create a pandas data frame also from a list of dictionaries

39
00:03:22.040 --> 00:03:25.860
using from, uh, recourse method. Uh,

40
00:03:25.860 --> 00:03:30.820
where each item in the list is a dictionary where the key is the column name

41
00:03:32.200 --> 00:03:36.100
and the value is the value for this specific row and column.

42
00:03:40.300 --> 00:03:41.280
As I mentioned before,

43
00:03:41.820 --> 00:03:45.680
the data frame is a higher level wrapper around MPI array.

44
00:03:46.180 --> 00:03:50.120
We can get the MPI array with data frame values.

45
00:03:54.270 --> 00:03:54.490
Uh,

46
00:03:54.490 --> 00:03:59.050
to work with MPI arrays is more difficult than to work with panda data frame or

47
00:03:59.050 --> 00:04:02.410
series, but I recommend to you at least learn the basics.

48
00:04:04.210 --> 00:04:07.420
Each data frame has its, uh, index. Uh,

49
00:04:07.420 --> 00:04:11.060
these are the numbering of the rows. Here.

50
00:04:11.080 --> 00:04:13.780
We can see in bold and columns,

51
00:04:21.380 --> 00:04:25.680
uh, the index of the rows. Uh, it doesn't have to be just numbers,

52
00:04:25.900 --> 00:04:30.580
it might be strengths as well. We also see that when we refer,

53
00:04:30.760 --> 00:04:35.590
uh, to columns or the index, uh, we'll get a index class.

54
00:04:35.590 --> 00:04:39.440
In return, we can turn, uh,

55
00:04:39.440 --> 00:04:42.040
the index tool list with the tool list method.

56
00:04:48.670 --> 00:04:52.080
Okay, now what are Pandas series? Uh,

57
00:04:52.170 --> 00:04:56.480
panda series is uh, one dimensional array or one column,

58
00:04:56.780 --> 00:05:00.150
or one vector we can say as well. Uh,

59
00:05:00.150 --> 00:05:04.150
the easiest way how to create them is using, uh, cut.

60
00:05:05.660 --> 00:05:10.580
The easiest way how to create them is using a list. We can create them this way.

61
00:05:15.220 --> 00:05:18.790
Panda series can have a name, uh,

62
00:05:18.790 --> 00:05:21.150
same as column in a pandas data frame.

63
00:05:24.220 --> 00:05:26.400
It is also an index. We can see it here.

64
00:05:31.970 --> 00:05:36.390
And we see the difference that the name of the series is just, uh, one string,

65
00:05:37.650 --> 00:05:40.870
but the index is uh, also a range index class,

66
00:05:41.410 --> 00:05:43.190
and we can turn it into list as well.

67
00:05:49.840 --> 00:05:50.700
In our next video,

68
00:05:51.120 --> 00:05:55.020
we will learn how to load our data into Panta data frames.
