SQL Notes

Key SQL Database Best Practices and Tips When working with relational databases, adhering to best practices can make your queries more efficient, maintainable, and easier to understand. Here are some key guidelines to follow when creating and managing your tables and queries. 1. Table Names Should Be Plural To keep your naming conventions consistent, it’s […]
Thnk Grw Rch
Famous Personalities Henry Ford – Founder of Ford Automobile company. He started with no money and little education yet turned out to be a successful businessman. William Wrigley Jr – A travelling salesman. He discovered that his clients liked the chewing gum he gave away as free, more than the product he was selling. John […]
‘map’ and ‘filter’ in Python

Key Differences Between map and filter Purpose: map: Transforms each element of an iterable using a function and returns an iterator with the transformed elements. filter: Filters elements of an iterable using a function and returns an iterator with elements for which the function returns True. Function Return Type: map: The function passed to map […]
Variable Scope

Scope in Python Scope is a fundamental concept in Python that determines where variables can be accessed or modified in your code. Understanding scope helps you manage variable visibility and avoid common pitfalls, such as variable shadowing and unintended side effects. Types of Scope in Python Python has four main types of scope, often remembered […]
Python Notes

Getting User Input with input() The input() function allows you to prompt the user for input, which is then replaced by the string the user enters during the program’s execution. print(“Hello ” + input(“Your name: “)) When the user enters ABC as their name, the output will be: Hello ABC Finding the Length of a […]
Docstring

What is a Docstring? A docstring, or documentation string, is a string literal that occurs as the first statement in a module, function, class, or method definition. It is used to document the purpose and usage of the code component in which it is defined. Why Use Docstrings? Readability: Docstrings make your code easier to […]
GCD-LCM

GCD (Greatest Common Divisor) or HCF (Highest Common Factor) gcd(n1,n2) – gcd of two natural numbers is the greatest natural number which divides them both. e.g x and y have to be co-prime. Therefore gcd if x & y should be 1 i. e gcd(x,y) =1g is the smaller power of each common prime factor. […]
Cyclicity of Number

Unit Digit Cyclicity 1,5 & 6 – The unit digit of their power does not change. i.e a^n = a 2,3,7 & 8 – The unit digit of their power is getting repeated after every 4th cycle 2 – The unit digit is 6 when the power is 4n 2 – The unit digit is […]
Matrices

While defining a matrix we must define their order. e.g. 3 by 2 matrix i.e. rectangular array of 3 rows and 2 columns. Represented as OR Element of matrix A: Type of Matrices Row Matrix or Row Vector: Matrix having only one row. e.g row matrix of order 1×4 A = [ 1 2 […]
Linear Regression

Supervised Machine Learning Linear Equations begin{equation} label{eq:sys} w_1x_1^{(1)}+w_2x_2^{(1)}+dots+{w_n}x_n^{(1)}+b=y^{(1)} end{equation} begin{equation} label{eq:sys} w_1x_1^{(2)}+w_2x_2^{(2)}+dots+{w_n}x_n^{(2)}+b=y^{(2)} end{equation} [ dots ] begin{equation} label{eq:sys} w_1x_1^{(m)}+w_2x_2^{(m)}+dots+{w_n}x_n^{(m)}+b=y^{(m)} end{equation} are weights are datasets So in linear equation weight remain same but dataset varies. System of Sentences Non Singular System Such system comprises of non contradictory statements. Which results in more info for analysis. e.g. System-1 The […]