This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<title>Spotify Clone</title> | |
<link rel="stylesheet" href="styles/style.css" /> | |
</head> |
This file contains 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
try: | |
request = requests.get('put your link here') | |
request.raise_for_status() # returns an HTTPError if the response is not OK | |
print("All good! Response code is", request.status_code) | |
except requests.exceptions.HTTPError as err: | |
if request.status_code == 404: | |
print("404: Oops, sorry we can't find that page!") | |
else: | |
print("The error code is", err.args[0]) # look up the 1st argument from HTTPError |
This file contains 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
from requests import codes # the code names from requests | |
from http.client import responses #it lets you look up the response | |
try: | |
r = requests.get('https://www.abc.net.au/triplej/hottest100/22/1-100', timeout=1) | |
r.raise_for_status() # returns an HTTPError object if an error has occurred during the process | |
except requests.exceptions.HTTPError as errh: # explains the errror | |
print("HTTP Error") | |
print(errh.args[0]) # look up the 1st argument from HTTPError | |
else: |
This file contains 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
fig, axes = plt.subplots(5, 3, sharex=True, figsize=(18,40)) # 5 rows x 3 columns | |
fig.subplots_adjust(hspace=0.1, wspace=.5) # ensure that the plots do not overlap | |
fig.suptitle('Insurance claims') | |
sns.boxplot(ax=axes[0, 0], data=data, x="total_claim_amount", y="state") | |
sns.boxplot(ax=axes[0, 1], data=data, x="total_claim_amount", y="response") | |
sns.boxplot(ax=axes[0, 2], data=data, x="total_claim_amount", y="coverage") | |
sns.boxplot(ax=axes[1, 0], data=data, x="total_claim_amount", y="education") |
This file contains 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
#Create a new dataframe with language ids and language names. | |
#Hindi, Bengali, Marathi, Telugu, Tamil, Gujarati, Urdu | |
#Corresponding to these language ids: 171, 330, 345, 49, 206, 260, 161 | |
conditions = [ | |
(data2['LanguageID'] == 171), | |
(data2['LanguageID'] == 330), | |
(data2['LanguageID'] == 345) , | |
(data2['LanguageID'] == 49), | |
(data2['LanguageID'] == 206), |
This file contains 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
# Create likert list object | |
LXP.data.items.likert <- likert(LXP.data.items) | |
# Summarize the data | |
summary(LXP.data.items.likert) | |
# Plot the data | |
plot(LXP.data.items.likert) | |
# Plot the data with colours to match our visual identity |
This file contains 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
# Remove full stops and replace with them with blanks | |
names(LXP.data.items) <- gsub("\\.", " ", names(LXP.data.items)) | |
#ordering levels | |
#Q1 | |
LXP.data.items$`Access my timetable`<- factor(LXP.data.items$`Access my timetable`, levels = c("Very unimportant","Quite unimportant", "Neither important nor unimportant","Important","Very important"), ordered = T) | |
#Q2 | |
LXP.data.items$`Particpate in collaborative activities forums peer assessment group work ` <- factor(LXP.data.items$`Particpate in collaborative activities forums peer assessment group work ` , levels = c("Very unimportant","Quite unimportant", "Neither important nor unimportant","Important","Very important"), ordered = T) |
This file contains 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 libraries | |
library(plyr) | |
library(dplyr) | |
library(likert) | |
library(grid) | |
library(ggplot2) | |
#Import data. You'll need to change the path here and point it to where your data are. | |
LXP.data <- read_excel("LMSdummyDataShort_en.xlsx") |
This file contains 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
#this cleans up your global environment (optional) | |
rm(list = ls()) | |
# Version notes | |
## Usung data.table_1.12.8 and readxl_1.3.1, R version 3.6.1 (2019-07-05) | |
library(readxl) #this allows you import and extract data from your Excel workbooks | |
library(data.table) #this library is the most crucial one and applies the functions that list and recombine the data | |
library(xlsx) # this is optional. It's a tricky library that can break if you don't have the Java Development kit installed | |