This shows you the differences between two versions of the page.
ewis:laboratoare:02 [2021/03/17 19:09] alexandru.predescu [Functions] |
ewis:laboratoare:02 [2023/03/15 17:40] (current) alexandru.predescu [Data Structures] |
||
---|---|---|---|
Line 80: | Line 80: | ||
new_list.append(new_elem) | new_list.append(new_elem) | ||
| | ||
- | # same task with list comprehension | + | # TODO: same task with list comprehension |
- | new_list = [(elem / s) for elem in v] | + | |
| | ||
return new_list | return new_list | ||
Line 99: | Line 98: | ||
<note> | <note> | ||
- | //module1.py// | + | **//module1.py//** |
<code python> | <code python> | ||
Line 106: | Line 105: | ||
</code> | </code> | ||
- | //main.py// | + | **//main.py//** |
<code python> | <code python> | ||
Line 169: | Line 168: | ||
<note> | <note> | ||
- | Create, access, check membership | + | **Create, access, check membership** |
<code python> | <code python> | ||
Line 184: | Line 183: | ||
</code> | </code> | ||
- | Modify | + | **Modify** |
<code python> | <code python> | ||
Line 208: | Line 207: | ||
</code> | </code> | ||
- | Operations (set theory) | + | **Operations (set theory)** |
<code python> | <code python> | ||
Line 279: | Line 278: | ||
# looping through a dictionary: | # looping through a dictionary: | ||
for key in d: | for key in d: | ||
- | print(key) # print only key | + | print(key) # print only key |
- | print(key, d[key]) # print key and value d[key] | + | print(key, d[key]) # print key and value d[key] |
Line 298: | Line 297: | ||
else: | else: | ||
print('not found') | print('not found') | ||
+ | |||
+ | </code> | ||
+ | |||
+ | <code python> | ||
# counting the number of times a letter appears in a string: | # counting the number of times a letter appears in a string: | ||
Line 328: | Line 331: | ||
**Resources**: | **Resources**: | ||
- | https://www.youtube.com/watch?v=WGlMlS_Yydk | + | * [[http://mathworld.wolfram.com/L2-Norm.html|L^2-Norm]] |
- | + | * [[http://mathworld.wolfram.com/StandardDeviation.html|Standard Deviation]] | |
- | http://mathworld.wolfram.com/L2-Norm.html | + | * [[https://www.youtube.com/watch?v=WGlMlS_Yydk|Apriori Algorithm (Associated Learning) - Fun and Easy Machine Learning]] |
- | http://mathworld.wolfram.com/StandardDeviation.html | ||