AllMighty.txt PDF
Document Details
Uploaded by Mahdan
Shahid Bahonar University of Kerman
Tags
Summary
This document contains questions about Python programming, focusing on topics like defining variables, differentiation in simpy, and softmax function. It also includes questions involving installing JupyterLab.
Full Transcript
#separator:tab #html:true #guid column:1 #tags column:12 tYG=9._{a, How can we define variables in simpy? J, w = symbols('J, w') Mx0-5G&~ga How can we get the differentiation of a value in simpy? dJ_dw = diff(J,w) BnNJl6O$^g how can we Evaluate the derivative at a point in s...
#separator:tab #html:true #guid column:1 #tags column:12 tYG=9._{a, How can we define variables in simpy? J, w = symbols('J, w') Mx0-5G&~ga How can we get the differentiation of a value in simpy? dJ_dw = diff(J,w) BnNJl6O$^g how can we Evaluate the derivative at a point in simpy? dJ_dw.subs([(w,3)]) jJ*FJmWn.q How does softmax changes Z output into probabilities? "" ld[i!GcHX4 What is the shorthand of softmax function? "" KdL,OCTr,E It is also possible to add an input layer that specifies the input dimension of the first layer. how can we do it? tf.keras.Input(shape=(400,)), xQu+M3>:`L " You can see what's in a file with ? command only and not a pager [sound:elevenlabs-fde38158-b8b95ecc-b02c27c9-f85eb930-b032ce9e.mp3]" more s64kq How can we install jupyterlab? [sound:elevenlabs-475c4de6-2dbb0ec4-c06d7588-b52b0bea-354ed89f.mp3] conda install jupyterlab BI!lFu0+(, How can we run jupyterlab? [sound:elevenlabs-3ddbc33d-a159a388-24bdf49f-4bc48821-3270b962.mp3] jupyter lab k,YO^m9X5nJ|0>WB How can we have multi line string in python? [sound:elevenlabs-b8d7ad3d-412dcff1-36126306-8e6e7adf-1b29c4ff.mp3] "''' '''"""""" """"""" q{@3*522(9 WORKING WITH FLOATING POINTS HAS CALCULATION PROBLEMS [sound:elevenlabs-d7b1316b-9a52a3a0-6db9c74f-f071c0da-c1aa9812.mp3] QM4J;n0z&7 What does 3e6 mean? [sound:elevenlabs-91630bd4-3238b2be-4102c3be-97e86c80-e0eb218c.mp3] 3 * 10^6 ya*;,.3c[Q How do we show octal in python? [sound:elevenlabs-d66ae1d8-c4af7b2a-53870e7a-ed5c2832-70b651a9.mp3] 0o G_mTkOpDN6 How do we show binary in python? [sound:elevenlabs-eea3291a-6eb052aa-87ef04fe-cc106f8d-128de767.mp3] 0b "Q`@F#&I>r3" How do we show hexadecimal in python? [sound:elevenlabs-0f86324d-d21cabf7-1ad3db60-20742272-389a8ead.mp3] 0x A>HV6b_GfD How do we use escapes in python? [sound:elevenlabs-4433fcdd-fc80d07c-37e7b4e9-5247a29d-36d15bbf.mp3] with \ we scape from strings M_Lq-Cp:-? QUEUE Study of escapes [sound:elevenlabs-d7b7bb00-96d59c77-572ac7e2-6080b47f-a8177f9e.mp3] EO|pQ>qd}Q How can we have raw strings in python? [sound:elevenlabs-d91cd98b-b1937f04-2b480e99-c5a81f2b-7a1f0401.mp3] "r""asdas/' ""it doesn't look for anything in this string" E@(I!:sgck How much space does an empty string overhead take?what about each character? [sound:elevenlabs-b2a9350f-9aa8a28d-9dab0b92-1bc5a596-874e98b6.mp3] 49 and each character takes 1 byte qD,OQ^(&O: what does abs() do? [sound:elevenlabs-78fa7198-c20428a7-6a1c68b4-66433853-14330a42.mp3] returns absolute jB6>Y5JY.= what does divmod() do? [sound:elevenlabs-31067651-e7fb334b-8535643c-457bd470-58767dc5.mp3] quotient and remainder of integer devisionit gives both the div and moddivmod (8,3) - computes quotient and remainder of 8/3 - results in (2, 2) C-rc3-J{J` what does max() do? [sound:elevenlabs-0ea89276-16acfeef-8e357ed4-e20eb62a-c116cd1d.mp3] largest of the given iterable kQsXy~Qm6p what does min() do? [sound:elevenlabs-299f7db2-166cf536-68637733-c08fa586-fc4ed4b2.mp3] smallest of the given iterable LyAOA+aT!. what does pow() do? [sound:elevenlabs-a90f25d2-d253ef88-4cb7f12c-64da293e-33b8616d.mp3] raises a number to a power "ob#C7s_w>2" what does round() do? [sound:elevenlabs-fbeb4599-c01f2984-ae31e809-a1201583-0eadb440.mp3] rounds a floating-point value "Pbp#}~T^4f" what does sum() do? [sound:elevenlabs-4e474d6a-b4c0a952-f36919b6-adbc891d-a8bcf31b.mp3] sums an iterable pv-`kON(y2 How can we see the type of a variable in python? [sound:elevenlabs-36092dee-c5ff089e-9a29ff4f-59f9dcf8-3ac6c18f.mp3] type(var) z{N:I{>_)& What happens when we assign a variable? [sound:elevenlabs-7d4d34c9-a15a0a8c-54f99305-f39da61d-0a3774f0.mp3] it stores a value inside a RAM cell space and then we put the address of that cell inside of the named variable. "dDx#GP~)5" what does it mean when we write a = b? [sound:elevenlabs-453921eb-73a66d91-3f3a8bfe-e808bdb6-a65f8023.mp3] a gets the address of b and is now pointing to where b was pointing before foEeTL/[;| How can we get the address of a variable? [sound:elevenlabs-bdac9980-f7434b6f-d49ff80b-1117481e-bd12a726.mp3] id(var) p6>7a_a%Wb what is == word operator in python? [sound:elevenlabs-5cc2b15b-d9376d4b-6b34c2c2-fc5db2f4-b4e2e66f.mp3] is cn_ChhU=~% How does python handle -5 to 256? [sound:elevenlabs-77415c3a-35a7703c-6aabb5ce-20a6b1c4-f2699c67.mp3] python thought these numbers are used so much in everywhere, so it stores all of these are pre stored in them ram so if we assign them to some variables it gives these numbers' addresses' prestored values. Qn>a{:U~I+ What is the difference of m==n and m is n? [sound:elevenlabs-25d17131-b6c748b4-01a07a0b-1a5148b9-8f253765.mp3] m == n only checks those values and if they are equal then it returns true, but m is in is different because it checks if two variables has the same memory space location or not if they are both similar to each other it returns true 9oYBt4iZQ how shall we name our variables? [sound:elevenlabs-bf8e58d5-70a897c2-5cc28730-4ff523e8-f31c2127.mp3] use descriptive variable names and descripe what you are creating "N=Lc#l$!9," What are Augmented Assignment Operators? [sound:elevenlabs-11e5756a-38c0dec2-673aee58-ef01a2af-2b97523c.mp3] c = a * b + 10, the combination of = and other operators jEeUf7z-C: What is the difference of x = x + 1 and x += 1 in numpy? [sound:elevenlabs-8b70d687-15990e1b-fde4f70c-fc6fe834-2594d0dc.mp3] x = x + 1 creates an array inside another memory location, but in x += 1 the assignment is an inplace assignment which will be saved in the same memory location as x. I;~VlYKuq2 how can we easily concat strings in python? [sound:elevenlabs-e1cf6229-d3330034-623fb3fc-40ba5e2f-a0f9ec47.mp3] s1 + s2 h@GHl?2!D% What does string1 * 2 do? [sound:elevenlabs-f5f4b8ab-0cee5936-e30447d1-f703f22d-ce607b70.mp3] it means 2 of string1 beside each other. H9s3;F%,=. How can we have python code in markdown? [sound:elevenlabs-d0b77957-22e823ca-e69cbfcc-9f3601b0-280446ca.mp3] ```pythona = b``` g%]cq&~r)0 "what does ""in"" operator do? [sound:elevenlabs-bf00aa5d-d4876eb1-9e639352-f0de1a93-cf0f49a8.mp3]" it searches inside a string, list or tuple or dictionary keys p.A{33&D>G "what is the difference between == and ""in""? [sound:elevenlabs-a07bbc99-25b6c6ea-c3356f43-68b1f37a-1f213435.mp3]" """in"" is partial match but == is exact match" fAGPZ*tg5? what does chr() do? [sound:elevenlabs-6e7635fe-76126196-38cdd358-a749b6aa-aa9ae2f0.mp3] converts an integer to a character PExp~m*0/X what does ord() do? [sound:elevenlabs-87840770-aa0b68b9-21850d64-21b9acfe-c168665b.mp3] converts a character to an integer. Qa?x[fjl2] what does len() do? [sound:elevenlabs-0b83d2d2-0bd27169-da679ba2-14baae28-bc6a7462.mp3] length of a iterable FR@jsOqac8 what does str() do? [sound:elevenlabs-3027da4a-2bc507ba-beee493f-37293add-15f1d554.mp3] returns a string of an object LR,Qi+d|c4 what does ord() stand for? [sound:elevenlabs-3e56f1d1-f5ff3f1f-f3bdf7fc-0f00b1f7-d43dfa1c.mp3] ordinal of a one character "v}^V>$W#d9" how can we slice strings in python? [sound:elevenlabs-e5f04bc2-64797f7a-92bf3f71-966b9c65-8fead776.mp3] we can slice strings in python like golang s[2:5] BC@!AZ]&_v why in string slicing the second variable is exclusive? [sound:elevenlabs-4af9c969-a75404f2-8f9ac95d-171de041-a57f01a9.mp3] because we can know the length of our slice by substracting the second value from the first one do*.zXhQ+P what is stride? [sound:elevenlabs-413a9dad-f446cfbc-45d5561d-58affa38-6335ad1a.mp3] it's the length of our steps u0Nl_bBq`x how can we define our desired stride in python strings? [sound:elevenlabs-9375b339-9e7c7a00-a9fcebc9-408c5e31-85231950.mp3] string[2:5:4(stride)] Al@XuAzj2? how can we create the backward of a string in python? [sound:elevenlabs-4ea5bd6e-9fea7b04-d61e99a9-3aaabfff-7fb355c2.mp3] we define a -1 stride for itstring[::-1] w515S4SxO@ how can we create dynamic strings in python? [sound:elevenlabs-fb8d506e-79cd96e0-6289b4d9-1d312961-1c62c551.mp3] using fstrings h1{i*t!lut how can we turn a string into a formatted string in python? [sound:elevenlabs-0d15234b-dd104139-9cd1d24d-6db66d31-068f6f5c.mp3] we put a f before a string f' ' f8>sXEDxwW how can we put variables inside fstrings? [sound:elevenlabs-568edebe-907cf6d6-b431dc51-2a41fba1-53e2f29a.mp3] f'{variable1} is {variable2} in strings' yJaaLXnNd&UV^&E5 "How does python lists handle memory allocation when we append items to it? and why? [sound:elevenlabs-58fc08d5-0e02ae79-74d3b947-1868761e-ebdf01e6.mp3]" when we create a list it might happen that the next block of memory to the memory location of the list is not available, so we need to move the whole list to another place to let it grow, python handles it like this:after appending some items to list python will reserve some blocks for further appending so it doesn't have to move the whole list each time we append if the memory location is full, and the reservation grows logarithmic not exponentialy because in very large lists we are less likely to append stuff than the small ones. vv$WL-7kQI what does it say? ls -alhp [sound:elevenlabs-c94378bc-77c324e2-0a1672d5-79d71d0a-c20807ae.mp3] a stands for showing all the files even hidden onel stands for long version of listingh stands for more human readable contextp stands for showing difference of files and directories Ld_Yr)6o%N How can we create a dictionary using functions? [sound:elevenlabs-15565f1b-bd162a57-cf176866-7f9b793b-da2da3ad.mp3] d = dict([ ('Ali', 19.5), ('Hasan', 14),])with double iterable items like tuples or lists qSJ4lo9|er What is the another way of creating dictionaries using functions with equal signs? [sound:elevenlabs-03bb94c2-59150ce4-61e00c54-1a2abeaf-dc7a6b15.mp3] d = dict( Ali=19.5, Mamad=14, Ebrahim=2) I@g3k*^Ch= What is the normal way of creating a dictionary? [sound:elevenlabs-87a6ca90-96ee6a1a-66bf627b-6aa638bf-425db617.mp3] d = { 'Ali': 19.5, 'Mamad': 14, 'Ebrahim':2} "AnU])Ws%#v" How can we remove an item from a dict?` [sound:elevenlabs-35f4028d-f4437659-5f74793f-86713e23-05b31930.mp3] del d['Ali']d.pop('Ali') yrz-Xu6),g How can we add an item to a dict? [sound:elevenlabs-26b4a9f3-854fbfd6-d59df795-5f2a44be-e306a249.mp3] d['Ali'] = 20 xf+o^w{I%: Dictionary keys are unique [sound:elevenlabs-adaaec12-f1957152-6b853c62-deef7f0e-64d43b84.mp3] BXOhR>i@A[ How much space does an empty string take? [sound:elevenlabs-e4205b6d-a180a90f-964c4916-2f5fc9b6-680893de.mp3] 49 "lNqGtUS#/:" How much space does an empty tuple take? [sound:elevenlabs-9b1d5836-1ed98b8f-4f9c1b47-b2f6e8db-d99dc762.mp3] 40 H%kNN5|b(l How much space does an empty list take? [sound:elevenlabs-e9571d00-dcb0fdfa-acaac9e1-98f35f05-52246cca.mp3] 56 bgqqG,c!,e How much space does an empty dictionary take? [sound:elevenlabs-ac381dc4-7f2c1287-20d3e4a5-82fc2d82-6e0c626a.mp3] 64 "Du#n7C@arZ" What can not be a dictionary key? [sound:elevenlabs-2a9cdb19-b7f5d283-4ba07dd8-9e0e92be-1685e07a.mp3] listsanything that is mutable is not possible to be used as a key tSTCY,B?ey What can't we put inside our dictionary values? [sound:elevenlabs-f6777489-30c3e4f4-39680a81-045b5d56-30f59bb0.mp3] nothing it's all ok EZWuH7|HC how can we hash stuff? [sound:elevenlabs-d2bea563-765d6c49-21f11a1d-f2154c6f-b3cc9f78.mp3] hash() function GYD}EaSFn& What is a set and how can we define one? [sound:elevenlabs-a1f959a6-80cb89d2-0370b217-ee3cc51b-8020e1f0.mp3] it is defined just like dictionaries,x = {}but we populate it just like lists and without :x = {1, 2, 3, ,4}it's specification is that it only holds unique items and it will hash them too but it doesn't have indexing or slicing. wd*!)o)F2d how can we create empty dictionary and set using their functions'? [sound:elevenlabs-e7811685-643975e6-6a09c788-a804eace-13bdc8e3.mp3] x = dict()x = set() ud{FUgl|Cc How can we add items into sets like appending in lists? [sound:elevenlabs-7283c79d-881e3660-8b964032-969cc490-10274927.mp3] x = set()x.add(1) ga;eByy(oC How can we append a list's items to another list? [sound:elevenlabs-27d255bb-9ed27e43-1dc2cf85-17118718-fb2ede18.mp3] x = [1, 2, 3]x.extend([4, 5])x is [1, 2, 3, 4, 5] because appending a list to a list will add the whole list as an item to the first list but extend acts like + L0Ig,fId@/ how can we extend a set like we do for a list? which in place which copy [sound:elevenlabs-01472745-4b09e18b-37991038-5fc2f934-33aa6716.mp3] set.update() in-place adds multiple item returns Noneset.add() in-place only adds 1 item returns Noneset.union() returns a copy yST%c:.s44 How can we add two sets together? [sound:elevenlabs-3e0d26b4-c8133262-2f31024c-e9c14956-7f50e8f0.mp3] set3 = set1.union(set2)set1.update(set2) z`lg$^Xwlv how can we get the common items between two sets? [sound:elevenlabs-98f7f3a7-c8e6be13-5b95bb7c-a49089fe-28523e1f.mp3] s.intersection() OY0,2ZMOOz how can we remove some items from a set? [sound:elevenlabs-633a6f2a-101c4c61-d091aa31-8074126a-20bcac4e.mp3] set.difference({}) by a different setandset.remove() by a single keys.discard() NfJh]J?0*) can we put strings in a set? [sound:elevenlabs-434fbaf3-b58e191c-6f4b8035-34727511-5575ee26.mp3] yeah we can give a string to a set() function and it will store all the unique characters in it AK}3&be[PH What are the set values restriction? [sound:elevenlabs-bdc3db06-76fae9b2-924769ea-934b4e6e-8aeaf22a.mp3] the items should be hashable(immutable). OF9)v}IzCd What is the main reason we use sets? [sound:elevenlabs-54de13a4-5db8992c-15e040dd-75709d16-4566848f.mp3] because of it's astonishing search time hxB.9ol^(B What is the other option of using sets? [sound:elevenlabs-fb1db16b-34be827d-faf3887e-d8b2861a-a5bc2933.mp3] it removes duplicate items. j3~_1G_NpL when shall we use hash tables? [sound:elevenlabs-dac9db26-d339296d-8e667a1a-5fce8cc5-342797d7.mp3] whenever we want to search, add or remove multiple times in a big iterable "KIM1v#xwRL" How can we have an immutable set? [sound:elevenlabs-208a0dd0-164344cc-a53b3cef-04e64343-9b9f8f94.mp3] fs = frozenset([1, 2, 3]) t;a_|n7q|r what is set like? [sound:elevenlabs-989a0137-6d889a06-fef7a13c-d88f36e6-cfd39359.mp3] list qIzio{k;Vb what does frozenset look like? [sound:elevenlabs-d75edab4-e427d355-ca4926d6-fe70db0f-514694c4.mp3] it's like tuple L@7&Hp!n-X How can we use sets in dictionary keys? [sound:elevenlabs-e3564e48-f2e18e65-cd4eba7e-174505ad-8e59aacc.mp3] we use frozen sets jOs&p=I*@H How can we use the items in sets? [sound:elevenlabs-95cc9090-d5a8b0eb-f8f51b70-669d1fa2-fd9f57eb.mp3] item in set?true or falsewe don't have set[item] bo.Ld(BN?X can we remove elements from frozenset? [sound:elevenlabs-d103f31b-b0c3ed99-0e4c14c9-0c53e46a-34f9424c.mp3] no it's immutablebut we can concat two parts of a frozenset to conclude the item we don't want d5QQk1Adxy how can we remove items from set? [sound:elevenlabs-ad97765d-bdccd149-7fe8051b-bacc0d01-d9835560.mp3] set.remove() cF-a$AvmZ0V_H what is open addressing? [sound:elevenlabs-36e4008d-07cc8a56-dd49cb93-981321b5-6dc5731f.mp3] It means that we have addresses of all the memory locations, and then when collisions happen it continues to look after locations until it finds an empty location. "Hc#*6S$cYz" what is the problem of hashing with open addressing? [sound:elevenlabs-c971625f-40e180a4-79e05264-e595b793-01dfd235.mp3] because when we have a collision we won't save the hashed value in the place it's meant to, because it's preoccupied, now we need to look through our entire list to check if we have the same value or not and it ruins the hash tables efficiency. RbI6;^[r/S What is the solution to reduce collision occurance in all type of hash tables? [sound:elevenlabs-76214a62-7ee951db-01f3ae27-9ff4a3ee-e6efcfbf.mp3] "we define a threshold for our memory size and we define it like this, if it reaches the Load Factor we need to increase the size of the array." qoektx=I}* What is linear probing? [sound:elevenlabs-b710f323-d6b3cca2-d3154828-01aa6e61-10b92566.mp3] it's the method we use in case of collisions in open addressing method. Qd}mrEs_Zb What is clustering in collisions in hash tables? [sound:elevenlabs-88b28439-207490ed-5243418a-e615d9b2-6cdb3221.mp3] when our data is hashed and saved inside three neighbor locations and as we probe we just save items one after another and it makes our locations too dense so we need to use Quadratic probing (failed attempts)^2 to fix it. "v#DAg[Gs.d" What is Quadratic probing (failed attempts)^2? [sound:elevenlabs-db720360-c800e97a-abd570b9-7d53ac95-6e21fc42.mp3] When a collision happens and we go to check the next location and we see the next one is also occupied we don't look for the next one, we look at the next (failed attempts)^2 memory location. ssC1Y=:l What is the difference between a formatter and a linter? [sound:elevenlabs-c8fe8a41-17b60fba-7717487a-eb3e386a-6ed86ecf.mp3] formatter fixes your mistakes but linter doesn't wV?J(G,yS5 What is the name of commands which start with % in jupyter? [sound:elevenlabs-21a40952-a7ee4f3b-41c69a17-08cb81f0-90bdd7a9.mp3] magic command qn&6?{;Nn9 Write 1.58 us in python [sound:elevenlabs-ad0e504e-516c9454-f9dbc66d-7b91a844-014dcc81.mp3] 1.58e-6 "M0=b#}nU*5" What is the output of set.add()? [sound:elevenlabs-07451ad2-94f1810a-6a32f5a4-cb07d41d-cde7d3c8.mp3] None "Jjr)#&wc5Q" how do we add items to a list vs set? [sound:elevenlabs-68589d6b-3926046c-3377239c-4efb88ae-92afbeea.mp3] append --> addextend ==> update tINDp*%JYW How can we create the multiples of a number by using only 1 line of code?3 999 3 [sound:elevenlabs-2825452f-7accc264-8b039ed8-7395f589-e9929623.mp3] list(range(3,999,3)) c)874bu;.S What are the properties of range function? [sound:elevenlabs-89302ac4-4c5213c1-e3fba6f9-fbba57b6-b12f7c3d.mp3] "range(a, b, s) # start, end, step" jeh=Q5bW_4 What is the diffrence of a & b and a.intersection(b)? [sound:elevenlabs-11060642-3d80ff32-55bb3136-93ce882a-164d6e2c.mp3] a & b is only possible between two sets or the same type but intersection calculates the intersection between a set and an iterable too M).Vc75&}W What do we call if, for, while, and functions? [sound:elevenlabs-3aed2e96-9fe85c80-33ffad1e-f528a128-96770bdd.mp3] control structures M$>mdfl)r7 what do we call indentation in python? [sound:elevenlabs-335577f5-be9cc9d3-af9f2f04-19290c3d-d26ef885.mp3] off-side rule C1w9Zsb1nD How do we have else if in python? [sound:elevenlabs-14caec71-96268fc0-e283081e-cd7c1118-60555a21.mp3] elif statement: tV*orLEeeQ Why does priority matter in python statements? [sound:elevenlabs-8ed38d47-0aae5604-dcfd07b6-bddf6041-e1606113.mp3] because it only reads and runs first and then goes for the second d]w/Eeh)hM Don't use one-line if statement [sound:elevenlabs-93f8b060-d8ec3dd0-45faaf8d-98000aef-008cd015.mp3] wC=QhBi`rR What is python ternary operation for x == 2? if statement with print [sound:elevenlabs-7b091c80-9b216bb8-1a6a511b-5b344a40-47d47b0a.mp3] print('x is 2') if x == 2 else print('x is not 2') yObOE7E?cD What is pass statement in python? [sound:elevenlabs-5f6a4a4e-eeba8b72-9557f024-fa1d3e52-edf45c64.mp3] When you want to predifine something and you don't want to write it yet so for creating structure first and then writing the code we define stuff and use pass statement in it to have an empty code structure. JDG(j>lwAA We have else for for loop and while loop too [sound:elevenlabs-6821a9c4-eb0bc4a4-cdb78578-6d5b0795-3ffe4702.mp3] f2p>>BTr_6 When does else of loops is executed? [sound:elevenlabs-3b673412-dcbffdc9-3d35fc4a-ed703403-6ba6b796.mp3] When the loop condition becomes false it moves into else statement otherwise it will skip else statement c,6MI*Mllb What is iteration? [sound:elevenlabs-6f498210-b346fd1c-b9607bda-743f419d-db8013d3.mp3] The process of looping through the objects KDHGi How can we make a string lowercase in python? [sound:elevenlabs-30e34a57-d296f814-b395e874-3af0f723-d1a6b43e.mp3] str.lower() LMQy3b2Yyc how can we have set and dictionary comprehension? [sound:elevenlabs-0379b0b8-78316bdf-2d726399-7cbae74d-46f42c19.mp3] just like list comprehensionwe just use {} instead of [] OPKM@*c]XO What is the diffrence of set comprehension with dictionary comprehension? [sound:elevenlabs-db623f85-3ec258cd-dbd7e0f1-213a211a-8d9f1030.mp3] in the expression part of comprehension instead of i for sets we have i:b and it makes the difference o>JxnBmK How can we split strings in python? [sound:elevenlabs-7eb81fa9-90ed1bac-8420770c-0cfb7f4a-0d98b633.mp3] "words = string.split("" "")" b~T(j1.2LM What is the diffrence of using enumerate(numbers) and numbers.index(number)? [sound:elevenlabs-223b80db-dd568b35-7b0eee88-f223f306-cd7b928a.mp3] first.index() function searches the whole list each time and it makes the code much slower and also if we have two instances of a single value.index() always returns the first occurence of an item. E+BX;xY=aI put space after colons outside of function calls and commas [sound:elevenlabs-c29a0d5f-6168aec2-4f0b4ae3-1dfae88d-501cde7d.mp3] Er5>:P~uBr How does print seperate single items that we put in it without any parameters? [sound:elevenlabs-0bc58a9f-63d9924d-85f25a3b-b17393b9-23ad3ed2.mp3] with spaces "IKJb#a(`td" How can we choose the seperator we want in print statements? [sound:elevenlabs-984f5338-5dd330f5-dfbaba94-6e7f4425-520978f5.mp3] we can use print(a, b, c, sep=' *** ') a sep flag tLam[!M4sy How can we have print statement written into a file? [sound:elevenlabs-fc4e77c0-3532d2f6-479b9216-3d13748f-9ea9fb37.mp3] print('Ali Hejazi', file=open('myname.txt', 'w')) DMfQ/d*kiK How can we use.format() function? [sound:elevenlabs-5111a0ef-7c11e1c3-b4bdbb0c-6f281f02-362e1cd6.mp3] "str = ""{} goes to {}""str.format(var1, var2)" y`M&.y~Prj "How can we skip the { curly braces like we escape "" quotes with \ backspace? [sound:elevenlabs-ac87f9ec-1ea6acc1-a1814051-de105b5c-18b95c0b.mp3]" we shall use two curly brace h=AH1eB:tF How can we change the order of variables in.format() function? [sound:elevenlabs-17a0e4b9-dfe38a42-8026b798-786f0459-2b5277b9.mp3] we can put order numbers in side curly braces,'{0} {1} {2}'.format(1, 2, 3) j!y@p0|~Nm how can we make our keyword arguments more descriptive in.format() function? [sound:elevenlabs-896f644a-d45675cd-8863c6f0-255df666-60082155.mp3] '{quantity} {fruit}s cost {price}$'.format(quantity=6, price=3, fruit='banana') K]?GL{0Yqh What does exist in curly braces in string formatting in python? [sound:elevenlabs-e883ea5f-bc831a29-d6a617a1-bad999af-f0455106.mp3] {name!conversion:format} b?9[dSzBUR$DJX= How can we ignore some parameters when calling functions? [sound:elevenlabs-e8cacfb0-ad94ffbb-f23f3ec2-f808d134-f2e95e0c.mp3] we should create default parameters for formal parameters and we do it by giving values to variable when we're defining it as a formal parameter<name>=<value> iS$v@R&9m3 Positional arguments should come before keyword arguments [sound:elevenlabs-9d97be29-b472d2b0-181c79b8-95887713-07412212.mp3] tgZKvw*_]W non-default arguments follow default arguments [sound:elevenlabs-7769ea75-be53091a-ef9fe73b-bc23ca6d-556cb5fd.mp3] t>$LO[y~c, Be aware when you create a mutable default parameter in functions [sound:elevenlabs-1f773101-4608b5f2-9b0169b4-dc51d3b5-45e94327.mp3] mnRU;@nlSe Why do we use def f_none_default(l=None): as a default value? [sound:elevenlabs-7efe33ad-4cf61cfa-ddf9aa74-e5ef9b2a-87688be3.mp3] because maybe we want to use a mutable variable for l but we want it to be unique in each funciton call ucGQn8g~=U What is pass by refrence in functions? [sound:elevenlabs-24e18fe0-5580e5da-0e28b950-3bf6974c-751213da.mp3] It means we're passing the refrence of an item to the function instead of a value and any changes will change the main object D6gK?D!O_7 What type of pass is python? [sound:elevenlabs-ab73d211-127ec41d-01e1b24a-57806d14-d3609bf5.mp3] pass by assignment it means we pass refrence but we can't change the value with an assignment h]W_z1VO6~ How does a python return, returns multiple items? [sound:elevenlabs-8a57027d-8567773c-c1ed2327-f9ecd0d1-f36461e6.mp3] it simply tuples them n{x{jYfp7P In all equal sign operations we need spaces but in functions definition and calls we don't use spaces!!!!!!!!!!!!!!! [sound:elevenlabs-85d66e3e-7f26e399-410d333d-79018fe7-b4999b5a.mp3] c`%9Cl.u{q what does *variable do in unpacking tuples? [sound:elevenlabs-1247603f-5e279af9-43415bef-e405b541-33f20fb9.mp3] it creates a list and stores everything in it. qP[[u1&_R~ How can we get not known quantity variables in a function? [sound:elevenlabs-ac30411a-243f3866-88d209f1-a1b57ab9-527ab404.mp3] def avg(*args) K&W6Dhc#" What is the metaclass? [sound:elevenlabs-c0794f61-ca546e41-f5bd8cbb-0a41ca9a-c0df0931.mp3] The class that are classes are built on are metaclasses KYevccPF8y What is the type of builtin python functions? [sound:elevenlabs-ca9b236c-8ffe1059-ddac73cf-bc1c7db9-615240d0.mp3] type bIR)RIL-Io The class itself is an instance of type function [sound:elevenlabs-946d002c-a56e1266-5829bcd0-916f6a8f-610a03f1.mp3] LnPcqE!)rG "" c_4j.FW7f1 What is the upperclass of bool? [sound:elevenlabs-2761202c-ad46223b-785484a0-d3b9e866-52a338b8.mp3] int and int is subclass of object "Ny#6dOOSIM" How does Object creation in python work? [sound:elevenlabs-4b66c3cf-db074a1e-b0d9f82d-e5a50802-2b9b7ae5.mp3] It's a two-step processCreation of the objectInitialization of the object FGsFf%7TxU Explain the steps of python object creation... [sound:elevenlabs-1a1ead43-fc7b5b2a-6d0962f5-2dd363fb-1b93e6e9.mp3] first the __new__ method is called and for the second step the __init__ method will be called E]ST~@]04[ What is static method in simple words? [sound:elevenlabs-e247d5f2-0a1bf34d-65fcf31d-eb8f8506-765c4a0a.mp3] it doesn't take the self parameter in it's method arguments f@5jZ]AO:& What does __new__ dunder method do? [sound:elevenlabs-c2e469c1-343981ad-81233678-5af82635-d7edddc0.mp3] it creates the self objectand in method formal arguments we don't have self anymore we have cls instead which passes the class itself to create the raw object of it K+XJ(ZW[Ej What is inside the __new__ dunder method? [sound:elevenlabs-649e50f0-32e7b4ae-a56f5fa3-65be7347-a1a57b56.mp3] class Human: def __new__(cls, first_name, last_name): obj = super().__new__(cls) "EmNAV#d{Sh" Why is __new__ created? [sound:elevenlabs-48459c24-9c9ab01e-6776cd03-19f43bff-9ad943a9.mp3] it's there to create a raw obj jUQvY:|s@3 We can return whatever we want after calling class instanciation, how? [sound:elevenlabs-5cd7c821-0a5731fe-5eb3d952-1bbf85ce-b8f9f43e.mp3] we can put anything in __new__ dunder method return OBS=XdE,hF What is a callable function? [sound:elevenlabs-7cbb8353-6f4d2501-42d6f9e9-ad3cfc8a-148501fd.mp3] something that can be called like a function is a callable function and something that can not be called is not like int N){-TC(kxs What is getting ran before __new__ and __init__? [sound:elevenlabs-c86e3521-04cd8457-c228420a-ee44163e-3e090fa0.mp3] __call__ Q*QQ0EeoV; How can we check if an object is callable? [sound:elevenlabs-8cfeaaad-165b2785-3b2bed3c-9f0c6bc2-308f119c.mp3] callable(obj) H5ouXWvn-k What does happen when we have two parentheses beside an object name? [sound:elevenlabs-603246c2-e8990682-5561e843-a2af1a39-1f07170b.mp3] it looks for a method called __call__ dunder method d&CazxYzeP Are objects callable by default? [sound:elevenlabs-0d080c01-017d7e11-79e38000-0d3e8703-05cd8030.mp3] no we need to define __call__ method to make them callable z,d1V5)BZY What is the main code of python written in? [sound:elevenlabs-cbc46a11-8dc43a5c-9aa0387f-9aea304d-f71e66cb.mp3] C "Hf-e#{Z8iH" "" "" "" yRJ>hIW/yl How can we connect to a database inside postgres? [sound:elevenlabs-584ab262-027c61c8-958e1bb6-e6ca8cda-2e6d2d27.mp3] \c "Fe:+_x#P&C" How can we see the tables in our database? [sound:elevenlabs-cd0a5ab9-643d6fc3-5a484d74-7dc8c4a4-24099100.mp3] \d t!}+[JiAT| How can we create a table in postgres? [sound:elevenlabs-8ff875cf-9a4381ab-c8569a1e-68a30f7a-540bc5b5.mp3] CREATE TABLE table_name(); L2}!gQ@3ZT How can we see more details about a table in postgres? [sound:elevenlabs-c7dd2323-2421d3d7-efd60fa3-b255a513-2701d5e7.mp3] \d table_name; GWriKCo::K How can we add a column to our table in postgres? with datatype [sound:elevenlabs-dc6e6e41-40bdb597-82107267-665cc907-127dad02.mp3] ALTER TABLE table_name ADD COLUMN column DATATYPE; H2~pj0]S "refactor this code# Write your code hereclass Point(object): def __init__(self, x, y): self.x = x self.y = y def __repr__(self): return f""{self.__class__.__name__}({self.x}, {self.y})"" def __abs__(self): return (self.x ** 2 + self.y ** 2) ** 0.5my_points = [Point(3, 4), Point(9, 11), Point(6, 8), Point(2, 2)]my_points = sorted(my_points, key=lambda x: abs(x))my_pointsthat we don't need key in sorted?" "# Write your code hereclass Point(object): def __init__(self, x, y): self.x = x self.y = y def __repr__(self): return f""{self.__class__.__name__}({self.x}, {self.y})"" def __abs__(self): return (self.x ** 2 + self.y ** 2) ** 0.5 def __lt__(self, other): return abs(self) < abs(other)my_points = [Point(3, 4), Point(9, 11), Point(6, 8), Point(2, 2)]my_points = sorted(my_points)my_points" PwDNdqzWLf What is the similarity between inheritance and composition in object oriented programming? [sound:elevenlabs-27e354fc-a2f33410-214c7ca9-c2f87cab-7b05b717.mp3] they model the relationship between two classes. u-&6v0z))r What does LSP stand for in object oriented programming? [sound:elevenlabs-e74c1f13-5a6ce42b-5ff3cd1c-c051ac9a-e85d14e4.mp3] liskov substitution principle rCrMBpbc:n What does LSP say? [sound:elevenlabs-2260f3b0-0ed0e913-ea84cbce-af547e59-244b16b1.mp3] If S is a subtype of T then objects of type T may be replaced with objects of type S without altering any of the desired properties of the program. N&gbdpO|v What is a sentence that we can make for inheritence? [sound:elevenlabs-2dcf72b8-8cdc25c2-7b1f5496-ca3cf037-eb374022.mp3] Child is a Parent.Horse is an Animal. B%vcHJU9jq What is a sentence that we can make for Composition? [sound:elevenlabs-89af4e57-2a1fdf20-6e316956-d8ae00de-c3944ac8.mp3] Composite has a ComponentHuman class has a string in it's inputs and then it has all the string methods. YE?3H+xIN Explain the difference of inheritence and composition in conversational forms. [sound:elevenlabs-07ba2563-9f200db2-34e34272-bf52edc8-e262f96a.mp3] Animal <-- Cat, Dog, Horsecat is an animaldog is an animalTailbut it doesn't mean anything for Tail but we can say Cat has a Tail HAP$f4(MZK What are interface and implementation actually? [sound:elevenlabs-af42bf70-61b2557d-eb4625ce-49cd0793-302f3484.mp3] imagine we have a box with a red button on it, the way it is built is the implementation, but the fact that it's the same red button is the interface and it doesn't matter if one fires a missile or just makes a beep. GKJ4Z{!.~> What happens when we use inheritence? [sound:elevenlabs-75cc48a7-5a92262d-bb4a02d6-08754baa-60ca9e5c.mp3] we are getting both the interface and the implementation from the parent qE`0`DMklB What is duck typing in python? [sound:elevenlabs-fc5da187-12a51b12-79a2b6df-eeaef333-f9b667cc.mp3] it means python doesn't check the type of a thing, if something acts like a duck then it's a duck we don't care if it's not. هر گردی گردو عه b>{4gZ~DD| What is the use of duck typing in python which we don't have in other languages? [sound:elevenlabs-fbf5443f-5b788ba3-9ded891e-edd022bb-efec0c4e.mp3] it's the point that everything that acts with a certain interface can be passed to a class which needs the same interface, mostly we talk about the methods and properties that may be needed in class implementation. OJ9D*|czNo Why do we use inheritance? [sound:elevenlabs-dc84013e-b70c653c-bede7724-b0ade471-d41d2dcc.mp3] Use inheritance to reuse an interface and it's implementation GH>lfpo7Qx Why do we implement an interface? [sound:elevenlabs-abf5561e-f3154b97-fc708e91-5d3c9a5f-50132d06.mp3] For later usage ly%k=M3g;^ What is the Class Explosion Problem? [sound:elevenlabs-1e532d0e-f10a538c-b2a501d2-dd4ea138-acc3e4f1.mp3] when you use inheritence without following an instructure you may create a huge hierarchical structure of classes that is hard to understand and maintain. pR6P}H=lMD Which class is composite? The higher one or the lower one? [sound:elevenlabs-17dd9d37-f42eef60-79e1442d-4489e2a2-9fea31a1.mp3] higher dsryZQ8QV+ Which class is component? [sound:elevenlabs-9917fc8b-95d7289a-d6c5c358-dc48acd1-c4f802e5.mp3] lower one fE3_zjvNJ; How can we know when to use inheritence in a relation? [sound:elevenlabs-c046d846-b5499e22-40f8f9fc-465d949a-593a5406.mp3] Evaluate B is an A: Think about this relationship and justify it. Does it make sense?Evaluate A is a B: Reverse the relationship and justify it. Does it also make sense?If both of them made sense don't use inheritence and of course when you see the implementation is the same and they differ in only a few details kMgvT:3z~U When can we call a method without parentheses? [sound:elevenlabs-984bef63-cab720b8-13226b24-6e0585f8-e31e1f04.mp3] when it's a property and encapsulated values doesn't change "G}CR#y&/l0" When to use inheritance over composition? [sound:elevenlabs-e69d731e-33f8a442-4b574198-620b5779-7f90c19e.mp3] to model a clear is a relationshipto leverage both the interface and implementaion of the base class LY}lzW}kXm What are the steps that we take to fix our problem? in case of class relations? [sound:elevenlabs-0325853f-f84fdffd-74f93606-6489683a-16448f57.mp3] compositioninheritancemulitple-inheritance jW*v}]%Ob. What does MRO stand for? [sound:elevenlabs-1879adb3-ad8bb272-e8e28bb8-daf52f25-5ac4c2e0.mp3] method resolution order ~z0UC7O*E What does __mro__ do? [sound:elevenlabs-f35c6a81-4b86b558-d7945652-14bdd7b5-9d32a96b.mp3] it gives the order of checking for methods pR-&u60gAg What is the difference of python with other languages in function signatures? [sound:elevenlabs-dcf4f6ad-3cdfcc3d-e8bd9a5c-8d86c6c3-f6c6312e.mp3] In both the function's name is part of the language but In other langs the function signature is the count and the inputs' names but in python it's only inputs' count Dr,%r%WiLp What is the problem about method names in multiple inheritance? [sound:elevenlabs-6d5ffd1a-660feeab-5c6b75e3-2cfec8f4-c36e7739.mp3] we can name methods differently but we can't change the name of dunder methods and it would cause problems J>h|wR0]8C What did we pass into the super method? [sound:elevenlabs-aa21bece-0318523a-8418baf5-3f201d05-6e67c438.mp3] super(ClassName, self) MTtHm1_Ows What is a mixin? [sound:elevenlabs-9dcc674d-e337ea46-4bf0b68d-acd812be-fb7dbbb1.mp3] it implements includes-a,we had has-a for compositionand is-a for inheritance BQRKpm^u@I How can we implement mixins? [sound:elevenlabs-8651725c-7896d2c0-9fa57e13-fda98835-ae7c9798.mp3] it's a class with only a single method likeclass VolumeMixin: def volume(self): return self.area() * self.height() zYUC3pGV5y What is it like when we create a mixin and inherit it? [sound:elevenlabs-8c00766d-4b1d2b07-9548b5e8-b5292ba4-fd46b259.mp3] it's just like adding a feature to the object "Pav$!}gP{!#ts" What is imbalanced data? [sound:elevenlabs-c126bbbe-6b06b199-dcc6b1d6-be647f37-e5860155.mp3] we may have many information of one datatype CaXMDYBacC How can we handle imbalanced data? [sound:elevenlabs-7c468fd9-145850fe-df34a6eb-ffcfffb7-2ee56919.mp3] Undersampling:balance to minimumOversampling:balance to maximum "xu;gHV#4s^" What is feature selection? [sound:elevenlabs-b483f4d8-feb6dedf-7c483c84-63374e19-505ec5b5.mp3] out new features are subsets of the original features uuHiF+/1&/ What is feature extraction? old feature-wise [sound:elevenlabs-62b0506f-cd9c9ced-7ccc8a35-8d0c2553-bec72f1a.mp3] new features are different from original features m7!_{B2,O^ what are the benefits of feature selection?4 [sound:elevenlabs-5aacfc10-51985d5a-a64f1273-2144433b-6bddd4f4.mp3] Improved model performance: حذف اطلاعات اضافی یادگیری را مفید میکندReduced overfitting: توجه به کلیات تا جزییات غیر مهمFaster training and inference: سریعتر شدنBetter interpretability: علت تصمیم مدل را راحت تر میفهمیم q$$zJ|J=H$ What are Feature Selection methods? [sound:elevenlabs-d48db94e-5cd8c96e-94e82202-8ae5d6c7-f35a509b.mp3] Filter MethodsWrapper MethodsEmbedded Methods F{]ph,@^at What are the Filter Methods? [sound:elevenlabs-6280d544-baa061e8-31055782-f912aef4-c4007368.mp3] CorrelationChi-Square TestMutual Information "vNpMN#qxT+" What is Filter Method itself? [sound:elevenlabs-b63d3409-e5dd2368-54489b47-de9bf8a4-604b0cdb.mp3] "بر حسب اندازه گیری های آماری فارغ از مدل های یادگیری ارتباط یک فیچر با خروجی را می دهند" }OUtA5XSt What is Correlation Itself? [sound:elevenlabs-4c8792e8-4f08fe13-dbb4eb9f-30ca2497-26f3ceeb.mp3] "همبستگی دو متغیر" xF[9CNmY=Z What are the Wrapper Methods? [sound:elevenlabs-083c024f-4990faf7-9207f42a-ee70b612-8946b018.mp3] in feature selection Backward Feature EliminationForward Feature Selection B>X?*S8nmP What is Wrapper method in feature selection itself? [sound:elevenlabs-bdbe404a-b2b8d9f5-8897fb64-11b0685f-d57f9496.mp3] " خود مدل یادگیری را هم درنظر میگیرند علاوه بر محاسبات آماری حول پروسه ترینینگ کار میکنن" "r>BAO./v#J" What is Backward Feature Elimination itself? [sound:elevenlabs-e28f5ab7-29c38c5a-ece31ada-648b856d-1b503b5d.mp3] "حذف دونه دونه فیچر ها تا ببینیم مهمن یا نهو بعد از هر تغییر یکبار ترینینگ خواهیم داشت" o$gtIf;nGU What is Forward Feature Selection itself? [sound:elevenlabs-6d314ad6-c3b906b1-e5dd9f12-ef614601-7e3054c3.mp3] "از یک فیچر تست میکنیم و دونه دونه اضافه میکنیم تا ببینیم بهتر میشه یا بدتر هربار اضافه یا کم کردن با ترینینگ همراهه" Kswt]cf6)+ What is Embedded Method itself? [sound:elevenlabs-b3b02b70-7e962196-7456c3a6-fdd6480d-969749f8.mp3] "فیچر سلکشن و ترینینگ باهم در نظر گرفته میشنفرق با رپر اینه که جدا از هم نیستن و با الگوریتم ترکیب(امبد) شده کاملا، در صورتی که در رپر جدا جدا کم یا زیاد میکردیم و ترین میکردیم تا ببینیم کدوم خوبه کدوم بده" "Ht%E!#Rz~/" What are the Embedded Methods? [sound:elevenlabs-429756be-45c81ea2-1fe1ba29-c7b75ae1-96b1764a.mp3] RegularizationTree-based Methods N(YIq(AuDx What are Regularization methods? [sound:elevenlabs-25b708c6-e1b97a46-f4e27214-b6b1c01a-ad55ee77.mp3] L1 -> Lasso RegressionL2 -> Ridge Regression En80tN.:y| What is the Regression itself? [sound:elevenlabs-b67188fd-235bb730-a9737238-ef9daa26-a38dfc84.mp3] survival of the fittest li63jS^c;j Remove() removes the first occurance [sound:elevenlabs-8a2319b9-3f8b60b4-5b2df7bf-7e79734a-638af32d.mp3] Bn[]DCRa The meaning of the proportion of variation? [sound:elevenlabs-6e9defd6-fd7745a4-8affa37c-96747517-07293056.mp3] نسبت تنوع "zB(#h4IzEn" What is the name of \(R^2\)? [sound:elevenlabs-db7432ad-bb4d0180-4fa9d6cc-05e5d2ff-6720fbe3.mp3] Determination coefficient jxpr.f9+Fp What is the formula of \(R^2\)? [sound:elevenlabs-e2910567-4242a583-9a6ca3ed-a4287ef4-3a90a54a.mp3] \[R^2 = \frac{\sum_{i=1}^n\left(y_i - \hat{y_i}\right)^2}{\sum_{i=1}^n\left(y_i-\bar{y}\right)^2}\] IUbJO/VgM{ What are predictors in ML? [sound:elevenlabs-c0d7923b-6d87249b-b3928ad5-2aaf8130-83a462fd.mp3] the features or factors that are believed to influence the dependent variable. "H.uvH," What are the limitations of probabilistic models? [sound:elevenlabs-6e9d2a48-42181cd6-fad6248f-53fb9ff6-2adb4456.mp3] Computational complexity بخاطر عدم قطعیتAssumptions about data distribution با فرض است و فرضیات ممکن است غلط در بیایندDifficulty in handling high-dimensional data با زیاد شدن دیتا مشکلات زیاد میشوند CR(FTi What gets manipulated in experiments? [sound:elevenlabs-777c525f-b570a79e-62e35e26-b7237564-f6dab3f0.mp3] independent variable f/NK.F]j!5 What gets observed? [sound:elevenlabs-ace0cd86-5bc65e79-13a7812b-34455488-c36cac93.mp3] dependent variable pLOQDeEptP What is Observational Studies? [sound:elevenlabs-66ab2bf5-a3643791-9a3edaef-3442e197-4ed4a4b8.mp3] Is an observation which the investigator only observes and measures and doesn't change anything we just observe the change xc(ph)XJbu What variables do we have in observational Study? [sound:elevenlabs-2e75893b-6f4514e5-7234c6bf-634cf100-91cfcd07.mp3] First Variable, Second Variable E?7vLufi[ What are the points of the mean?5 [sound:elevenlabs-76f7244f-0faa1fd3-a66d013b-0952889a-299e4577.mp3] all values into accountonly for interval/ratiosensitive to changesextremely influenced by outliersnot a good measure for large range or skewed data Jp$A-0yHD/ What are the keys of mode?data-type [sound:elevenlabs-d66218c8-e8f0fe31-95f54857-f6d7b01d-4f26c1c3.mp3] It can be used on all types of data pVctp.4We& What are the keys of median? [sound:elevenlabs-f6b6a675-6014dca2-f73cc0dd-bbf7fba9-e8f66087.mp3] outliers doesn't affect it too much and can be used for categorical ordinal o)@odK/t!m The mean is... to changes [sound:elevenlabs-25fcc430-5d84878e-855287fe-eedb494c-7103a8d4.mp3] senseitive j&bX/-iPL$ What is positive skewed data? [sound:elevenlabs-dd5919ba-27324eb5-06de85a7-b2891f67-ee6a0bbd.mp3] our outliers or on the right side of data c