School of Technology, Nirma University
Department of Electronics and Communication Engineering
STTP on Edge AI and Vision
Laboratory Activity-1 Python
1. A website analytics data shows day-wise visited users, bounce rate, and duration.
Identify the outlier data sample if all three parameter values exceed standard
deviation using a single line logic.
## Website analytics data:
## (row = day), (col = users, bounce, duration)
a = [Link]([[815, 70, 115],
[767, 80, 50],
[912, 74, 77],
[554, 88, 70],
[1008, 65, 128]])
2. The human resources department of a large company and need to find all staff
members who earn at least $100,000 per year. Your desired output is a list of
tuples, each consisting of two values: the employee name and the employee’s yearly
salary. Generate the desired output using (i) for loop (ii) using single line logic.
employees = {'Alice' : 100000,
'Bob' : 99817,
'Carol' : 122908,
'Frank' : 88123,
'Eve' : 9312}
top_earners = []
3. Compare the timing execution of operator-based square root with [Link]()
using timeit().
4. Simulate a small 300x300 grayscale image frame using:
frame = [Link](0, 255, (300, 300), dtype=np.uint8)
Write a Python code using a for loop to binarize the image: assign 1 if pixel value
exceeds 128, otherwise 0. Shorten the code (single line) using [Link]() function.