Dunder or magic methods in Python are the methods having two prefix and suffix underscores in the method name. for example init or str.
dunder methods short cut for under-under-method-under-under
some example on dunder method:
- Object Representation: str, repr
- Iteration: len, getitem, reversed:
- when we want to print len(class) python tell me there is an error(TypeError) but when use
__len__
to return number of element it will be fine - if we want to know the position of an element in class we use
__getitem__
to prevent error(TypeError) - to print all element in class in revers format we use
__reversed__
- when we want to print len(class) python tell me there is an error(TypeError) but when use
- Operator Overloading for Comparing Accounts: eq, lt: we use it to comper betwen two object
- Operator Overloading for Merging Accounts: add: to marge two object
- Callable Python Objects: call: that is mean when calling the object or class do the following(the statments isnid call method/instance)
- Context Manager Support and the With Statement: enter, exit: to allow you to allocate and release resources precisely when you want to
In the broad sense, a PROBABILITY is a measure of the degree to which an occurrence is certain [or uncertain]. A statistical definition of probability. People have thought about, and defined, probability in different ways.
The normal distribution refers to a particularly important phenomenon in the realm of probability and statistics.
A simple and commonly used plot to quickly check the distribution of a sample of data is the histogram. In the histogram, the data is divided into a pre-specified number of groups called bins. The data is then sorted into each bin and the count of the number of observations in each bin is retained.
-
Central Limit Theorem A simulation to explain Central Limit Theorem: even when a sample is not normally distributed, if you draw multiple samples and take each of their averages, these averages will represent a normal distribution.
-
Three Sigma Rule The Three Sigma rule dictates that given a normal distribution, 68% of your observations will fall between one standard deviation of the mean. 95% will fall within two, and 99.7% will fall within three. ... Any value that is more than three standard deviations away from the mean should be treated with caution or care.