You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-6Lines changed: 13 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@
4
4
-[Status](#status)
5
5
-[Overview](#overview)
6
6
-[Installation](#installation)
7
+
-[Verify Local Environment](#verify-local-environment)
7
8
-[Windows](#windows)
8
9
-[macOS](#macos)
9
10
-[About pip](#about-pip)
@@ -20,6 +21,8 @@ This project is design to be completed on [Pluralsight](https://pluralsight.com)
20
21
21
22
## Installation
22
23
24
+
### Verify Local Environment
25
+
23
26
### Windows
24
27
25
28
Open a command prompt or powershell and run the following commands, replacing 'project-root' with the path to the root folder of the project.
@@ -37,25 +40,29 @@ Open a terminal and run the following commands, replacing 'project-root' with th
37
40
38
41
```bash
39
42
>cd'project-root'
40
-
$ python3 -m venv venv
41
-
$source venv/bin/activate
42
-
$ pip install -r requirements.txt
43
+
> python3 -m venv venv
44
+
>source venv/bin/activate
45
+
> pip install -r requirements.txt
43
46
```
44
47
45
48
*Note: If you've installed Python 3 using a method other than Homebrew, you might need to type `python` in the second command instead of `python3`.*
46
49
47
50
### About pip
48
51
49
-
Versions pip updates frequently, but versions greater than 10.x.x should work with this project.
52
+
`pip` updates frequently, but versions greater than 10.x.x should work with this project.
50
53
51
54
## Verify Setup
52
55
53
56
In order to verify that everything is setup correctly, run the following command from the project root.
54
57
55
58
```bash
56
-
>pytest
59
+
pytest
57
60
```
58
61
59
-
You should see that all the tests are failing. This is good! We’ll be fixing these tests once we jump into the build step. Every time you want to check your work locally you can type that command, and it will report the status of every task in the project.
62
+
You should see that all the tests are failing. This is good! We’ll be fixing these tests once we jump into the build step.
63
+
64
+
Every time you want to check your work locally you can type that command, and it will report the status of every task in the project.
60
65
61
66
## Previewing Your Work
67
+
68
+
You can preview your work by opening a terminal, changing to the project root, activating the virtual environment, and executing the appropriate python script. For example `python sensor/sensor.py`.
The dataset for this project is stored in several CSV files found in the `dataset` folder. It represents the data collected from a device with multiple sensors. The records include measurements of temperature, humidity, energy consumption, and particle count in the air over a given area. The data is collected over a period of 24 hours.
31
27
32
28
To start, open the file called `load_data.py` in the `sensor` folder - the rest of the tasks in this module happen in this same file.
33
29
34
30
At the top of the file create three import statements for `os`, `glob`, and `csv`. These libraries will allow us to work with a collection of files.
Create a method called `load_sensor_data` that takes no arguments.
47
-
In the body of the `load_sensor_data` function, create variable called `sensor_data` and set it as an empty `list`.
37
+
In the body of the `load_sensor_data` function, create variable called `sensor_data` and set it as an empty `list` - the rest of the tasks in this module happen in this function.
Below the `sensor_data` variable create another variable called `sensor_files` that is set to a call to the `glob.glob()` function.
44
+
45
+
Pass `glob` function a single argument, a call to the `os.path.join()` function. In turn pass `os.path.join()` three arguments: `os.getcwd()`, `datasets`, and `*.csv`.
46
+
47
+
The `datasets` argument corresponds to the folder with your sensor data. The data files are in `csv` format. You may open them and explore the content of the records in them.
0 commit comments