This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd #pandas library that supports reading a comma-separated values (csv) file into DataFrame | |
| df = pd.read_csv('https://covid.ourworldindata.org/data/owid-covid-data.csv') #df stands for DataFrame |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| from cycler import cycler # Used to add color cycle using colors from a colormap | |
| plt.title('Percentage of 4 components', bbox={'facecolor':'0.8', 'pad':5}, loc='left') # Adds a title and its postion | |
| labels = ['Component 1', 'Component 2', 'Component 3', 'Component 4'] | |
| sizes = [17, 35, 24, 31] | |
| colors = plt.cm.gray(np.linspace(0.2,0.8,5)) # Adds a grey scale | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import matplotlib.pyplot as plt | |
| plt.title('Percentage of 4 components', bbox={'facecolor':'0.8', 'pad':5}, loc='left') # Adds a title and its postion | |
| labels = ['Component 1', 'Component 2', 'Component 3', 'Component 4'] | |
| sizes = [17, 35, 24, 31] | |
| colors = ['yellowgreen', 'gold', 'lightskyblue', 'lightcoral', 'red', 'blue'] | |
| plt.pie(sizes, colors = colors, labels=labels, autopct='%1.1f%%', startangle=90, pctdistance=0.85) # Adds a title and postions it | |
| centre_circle = plt.Circle((0,0),0.70,fc='white') # draws a circle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import matplotlib.pyplot as plt | |
| labels = ['Component 1', 'Component 2', 'Component 3', 'Component 4'] # adds labels to each component | |
| sizes = [17, 35, 24, 31] # an array giving the values assigned to each component | |
| explode = (0, 0, 0.1, 0) # this "explodes" the 3rd slice of the Pie | |
| fig1, ax1 = plt.subplots() | |
| ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.1f%%', | |
| shadow=True, startangle=90) | |
| ax1.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"write_api_key":"WRITE_API_KEY", | |
| "updates":[{"delta_t":"TIME_STAMP","field1":"FIELD1_VALUE","field2":"FIELD2_VALUE","field3":"FIELD3_VALUE","field4":"FIELD4_VALUE"}, | |
| {"delta_t":"TIME_STAMP","field1":"FIELD1_VALUE","field2":"FIELD2_VALUE","field3":"FIELD3_VALUE","field4":"FIELD4_VALUE"}, | |
| {"delta_t":"TIME_STAMP","field1":"FIELD1_VALUE","field2":"FIELD2_VALUE","field3":"FIELD3_VALUE","field4":"FIELD4_VALUE"}]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<EthernetClient.h> // Library to work with ESP-12E board, used to connect to a specified internet IP address and port | |
| #include<ESP8266WiFi.h> // Library to work with ESP-12E board | |
| #include <SPI.h> // Library to work with Serial Peripheral Interface (SPI) serial data | |
| #include <Wire.h> // Library to communicate with I2C devices | |
| #include <Adafruit_MLX90614.h> // Library to communicate with IR sensors | |
| #include "SSD1306.h" // Library to work with SSD1306 LOED display | |
| #define SDA 5 // Serial data line on pin D5 | |
| #define SCL 4 // Serial clock line on pin D4 | |
| SSD1306 display(0x3c, SDA, SCL); // Initialise the OLED display using Wire library |
NewerOlder