1
00:00:01,440 --> 00:00:05,540
So let's go ahead and read the contents of this file with Pandas.

2
00:00:05,610 --> 00:00:08,070
A very powerful data analysis library.

3
00:00:08,100 --> 00:00:13,140
We are going to dive deep into Pandas later on,
we have a section dedicated to Pandas.

4
00:00:13,230 --> 00:00:16,660
And we have applications where we are going to use Pandas a lot.

5
00:00:16,740 --> 00:00:19,520
But for now let me just give you a quick demo

6
00:00:19,530 --> 00:00:21,040
how Pandas works.

7
00:00:21,090 --> 00:00:24,220
Make sure you import it. I have imported it in here.

8
00:00:24,390 --> 00:00:29,310
And then while true let's keep this conditional to check if the file is there.

9
00:00:29,370 --> 00:00:35,840
In this case that would be temps_today.csv.

10
00:00:36,640 --> 00:00:47,060
And then if the file exists we want to load the data
in this data variable, the way we do that is by

11
00:00:47,060 --> 00:00:50,920
using the read_csv method of Pandas.

12
00:00:51,140 --> 00:00:54,320
And there goes you guessed it for the path of the file

13
00:00:57,440 --> 00:00:58,580
like that.

14
00:00:58,580 --> 00:01:05,250
So if the file exists reads the data, and then print out 

15
00:01:05,290 --> 00:01:06,290
data.mean.

16
00:01:07,100 --> 00:01:10,780
So this object has a mean method.

17
00:01:10,790 --> 00:01:12,680
Let me show you later

18
00:01:12,680 --> 00:01:14,190
what's this object is.

19
00:01:14,210 --> 00:01:26,080
But for now let's go ahead and execute this script,
so we are getting the mean of each of the columns.

20
00:01:26,190 --> 00:01:28,090
That is a mean for a station one.

21
00:01:28,220 --> 00:01:29,910
And that is a mean for station two.

22
00:01:30,740 --> 00:01:33,770
So it's working.

23
00:01:34,020 --> 00:01:40,840
Now if you wanted the mean of only the st1 column,
you just do that.

24
00:01:41,910 --> 00:01:45,440
So that will give you the mean of the st1 of the station one column,

25
00:01:48,630 --> 00:01:49,990
and so on.

26
00:01:50,010 --> 00:01:51,600
So the idea here is that

27
00:01:54,370 --> 00:01:57,250
import Pandas and when you execute this

28
00:01:59,980 --> 00:02:06,490
what's happening there is that an object called a data frame is being created.

29
00:02:06,610 --> 00:02:10,460
You can see that you have a structured view of these data.

30
00:02:10,780 --> 00:02:18,090
So this is a specific object type just like we have integers and we have floats.

31
00:02:18,130 --> 00:02:25,420
We also have these other types that's you can find in libraries, in these third party libraries.

32
00:02:25,420 --> 00:02:27,950
So everyone can create their own types.

33
00:02:27,950 --> 00:02:30,230
And this is about libraries.

34
00:02:30,230 --> 00:02:39,490
So built in libraries, standard libraries written in Python, and third party libraries which are almost always

35
00:02:39,610 --> 00:02:41,260
written in Python.

36
00:02:41,260 --> 00:02:42,160
That's about libraries.

