Consider the following manual form (pay no attention to the content, it is purely illustrative).
We previously had difficulty in accurately identifying check-boxes, as well as whether these were checked or not. | |
Updated output:
|
Name | EmploymentStartDate | Origin | Age |
---|---|---|---|
John | 2005-04-15 | USA | 38 |
Emily | 2020-08-22 | Canada | 31 |
Michael | 2012-12-10 | UK | 38 |
Sarah | 2006-06-05 | Australia | 47 |
David | 2021-03-25 | USA | 28 |
Claire | 2019-03-25 | Australia | 28 |
SELECT Name, Age
FROM Dataset
WHERE Origin = 'USA'
ORDER BY Age DESC;
SELECT Name, Origin
FROM Dataset
WHERE EmploymentStartDate > '2020-01-01'
ORDER BY Name;
SELECT Name, EmploymentStartDate
FROM Dataset
WHERE Origin = 'Australia'
ORDER BY EmploymentStartDate ASC;
SELECT Name, Age
FROM Dataset
WHERE Age > 35
ORDER BY Age DESC;
SELECT Name
FROM Dataset
ORDER BY EmploymentStartDate ASC
LIMIT 1;
import plotly.graph_objects as go
import openpyxl
import os
import pandas as pd
import matplotlib.pyplot as plt
from plotly.subplots import make_subplots
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestRegressor
def get_data_from_excel_row(row_num, wb, column_start, column_stop):
return_list = []
for col_i in range(column_start, column_stop + 1):
return_list.append( wb.cell(row_num, col_i).value )
return return_list
def create_dataframe_from_list_of_lists(data_list, col_list):
transposed_tuples = list(zip(*data_list))
transposed_data = [list(sublist) for sublist in transposed_tuples]
df = pd.DataFrame (transposed_data, columns=col_list)
return df
excel_path = <path of the excel file on your computer>
excel_file = openpyxl.load_workbook(excel_path, data_only=True)
wb = excel_file["Sheet1"]
dates = get_data_from_excel_row(2, wb, 3, 168)
customers_num = get_data_from_excel_row(3, wb, 3, 168)
avg_handling_time = get_data_from_excel_row(4, wb, 3, 168)
achievement_rating = get_data_from_excel_row(5, wb, 3, 168)
employee_work_hours = get_data_from_excel_row(6, wb, 3, 168)
x_data_list = [customers_num, avg_handling_time, employee_work_hours]
x_col_list = ["customers_num", "avg_handling_time", "employee_work_hours"]
y_data_list = [achievement_rating]
y_col_list = ["achievement_rating"]
df_x = create_dataframe_from_list_of_lists(x_data_list, x_col_list)
df_y = create_dataframe_from_list_of_lists(y_data_list, y_col_list)
x_train, x_test, y_train, y_test = train_test_split(df_x, df_y, test_size=0.25)
regr = RandomForestRegressor(max_depth=3)
regr.fit(x_train, y_train)
y_predict = regr.predict(x_test)
num_vals = y_predict.shape[0]
plt.plot(range(num_vals), y_test, color="black", label="actuals")
plt.plot(range(num_vals), y_predict, color="red", label="prediction")
plt.ylim(0, 1)
plt.legend()
plt.show()
Recording 1:
Hallo, wir sind Mara, Luis Unico und ich bin Nico und meine Lieblingsmusik Richtung ist Hip-Hop und Rap. Ich höre einen sehr gerne, einen deutschen Künstler namens Pascha-Nim, den Buch stabiliert man, P-A-S-H-A-N-I-M. Ich höre Generog und meine Lieblingsdeutsche Band heißt Plont, B-L-O-N-D. Ich höre einen Hip-Hop und mein Lieblingskünstler ist Tupac, es schreibt durch zwei P-A-C.
Recording 2:
Was tu ich für die Umwelt? Das Thema Umweltschutz ist in den letzten Jahren ziemlich in den Vordergrund gerückt und hat auch für mich eine wichtige Rolle in meinem Leben eingenommen. Um dem Klimawandel ein wenig entgegenzuwerten, versuche ich möglichst viel bzw. so gutes geht, alle Wege mit dem Fahrrad zu fahren...
Recording 1:
It's time to be tomorrow. What time? 10 a.m. They're heading where? I am heading to... What's your name? My name is... Can comedy prosecutors will be there? My tell. Just one. Let me just confirm everything. I'm going to pick up the address in the hospital. I think to end the press call, recruit number three. Pick up time will be tomorrow at 10 a.m. Correct? Yes, that's correct. I am...
Recording 2:
Thank you for calling. This is how can I help? I'm calling the verify that my husband has been assigned to a driver tomorrow for his ride please. Okay, sure, ma'am. Let me check it for you here one moment. Thank you. You're welcome. What's the name of the passenger under the booking ma'am? I'm his name and rather thank you. Let me check that one here. All right, the verify ma'am that will be picked up for tomorrow 11 a.m. I'm going to Chicago. Is that correct? ...
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
df = pd.read_csv("insurance.csv")
df.head(10)
df.info()
def distribution(x):
sns.histplot(df[x])
plt.title(f'{x.capitalize()} Density Distribution')
sns.countplot(x = x, data = df)
for x in ['sex', 'children', 'smoker', 'region']:
df[x] = df[x].astype('category')
cat_columns = df.select_dtypes(['category']).columns
df[cat_columns] = df[cat_columns].apply(lambda x: x.cat.codes)
correlation = df.corr()
sns.heatmap(correlation, annot=True, cmap = 'summer_r')
import os
os.listdir(".")
file_for_analysis = open("Data7602DescendingYearOrder.csv")
ctr = 0
for l in file_for_analysis.readlines():
if ctr < 10: print( l )
ctr = ctr + 1
print("Total amount of lines:", ctr)
file_for_analysis.seek(0,0) # optional line to re-initialize the lines for reading
years_set = set([])
for l in file_for_analysis.readlines():
line_parts = l.split(",")
year_in_row = line_parts[2]
years_set.add( year_in_row )
print("Different years available:", years_set )
years_list = list( years_set )
years_list.sort()
print(years_list)
file_for_analysis.seek(0,0) # optional line to re-initialize the lines for reading
new_file = open("2021_data.csv", "w")
for l in file_for_analysis.readlines():
line_parts = l.split(",")
year_in_row = line_parts[2]
if year_in_row == "2021" or year_in_row == "year":
new_file.write( l )
new_file.close()
To follow this demo, you'll need both a computer screen and your phone. Keep your computer on this page. Take out your phone, start the camera app and point the camera to the QR code to left. After a few seconds a link should appear, click on it to load the augmented reality demo on your phone (preferably using Chrome browser).
If for some reason the below instructions don't work on your phone, here's a video showing what should have happened ;) | |
| |
Point your phone camera to this first marker, it should automatically start a video overlayed on top of the marker. We can imagine using this in marketing (create engaging advertisement) or in construction (visual explanations for complex machinery). It's also interesting to think that different videos can be started depending on the context, for example overriding with an evacuation video in case of a fire. (Credits to Blender for the video used) | |
| |
This second marker demonstrates the ability to display dynamic data, calculated on the spot or read from a database or sensor. A button should also appear at the bottom of the screen that can be used to reference further relevant content, for example user manuals or detailed reports. | |
| |
This last marker shows that you can trigger other apps. If you press on button that appears at the bottom of your screen, it should open your maps application and point you to ETH Zurich. Admittedly this is a basic interaction, but more complex ones are possible via REST-ful APIs.
Also note that the marker images don't have to be blobs of color or black-and-white boxes, they can contain text. |
setwd("C:\Users\YourUserName\Desktop\R_Experiment")
mydata <- read.csv("example.csv", sep="\t")
head(mydata, 2)
summary(mydata)
filterdata <- mydata[mydata$dept == "IT", ]
write.table(filterdata, file="filtered.csv", sep="\t", row.names = FALSE)