Tag Archives: Python for Citizen Data Scientist

Python Example – Write a NumPy program to compute the condition number of a given matrix

(Python Example for Beginners)   Write a NumPy program to compute the condition number of a given matrix. From Wikipedia: In the field of numerical analysis, the condition number of a function with respect to an argument measures how much the output value of the function can change for a small change in the input …

Python Example – Write a NumPy program to compute the inverse of a given matrix

(Python Example for Beginners)   Write a NumPy program to compute the inverse of a given matrix.   Sample Solution : Python Code : import numpy as np m = np.array([[1,2],[3,4]]) print(“Original matrix:”) print(m) result = np.linalg.inv(m) print(“Inverse of the said matrix:”) print(result) Sample Output: Original matrix: [[1 2] [3 4]] Inverse of the said matrix: …

Python Example – Write a NumPy program to compute the determinant of an array

(Python Example for Beginners)   Write a NumPy program to compute the determinant of an array. From Wikipedia: In linear algebra, the determinant is a value that can be computed from the elements of a square matrix. The determinant of a matrix A is denoted det(A), det A, or |A|. Geometrically, it can be viewed …

Python Example – Write a NumPy program to find a matrix or vector norm

(Python Example for Beginners)   Write a NumPy program to find a matrix or vector norm. Notes on Vector and Matrix Norms from here.   Sample Solution : Python Code : import numpy as np v = np.arange(7) result = np.linalg.norm(v) print(“Vector norm:”) print(result) m = np.matrix(‘1, 2; 3, 4’) result1 = np.linalg.norm(m) print(“Matrix norm:”) print(result1) Sample …

Python Example – Write a NumPy program to compute the condition number of a given matrix

(Python Example for Beginners)   Write a NumPy program to compute the condition number of a given matrix. From Wikipedia, In the field of numerical analysis, the condition number of a function with respect to an argument measures how much the output value of the function can change for a small change in the input …

Python Example – Write a Python program to add, subtract, multiply and division of two complex numbers.

(Python Example for Citizen Data Scientist & Business Analyst)   Write a Python program to add, subtract, multiply and division of two complex numbers.   Sample Solution: Python Code: print(“Addition of two complex numbers : “,(4+3j)+(3-7j)) print(“Subtraction of two complex numbers : “,(4+3j)-(3-7j)) print(“Multiplication of two complex numbers : “,(4+3j)*(3-7j)) print(“Division of two complex numbers …

Python Example – Write a Python program to convert a binary number to decimal number.

(Python Example for Citizen Data Scientist & Business Analyst)   Write a Python program to convert a binary number to decimal number.   Sample Solution: Python Code: b_num = list(input(“Input a binary number: “)) value = 0 for i in range(len(b_num)): digit = b_num.pop() if digit == ‘1’: value = value + pow(2, i) print(“The …

Write a program to predict Bank Customer Churn using Random Forest with Monte Carlo Cross Validation in Python

(End-to-End Jupyter Notebook for Citizen Data Scientist & Business Analyst) Write a program to predict Bank Customer Churn using Random Forest with Monte Carlo Cross Validation in Python. In this end-to-end applied machine learning and data science notebook, the reader will learn: How to predict Bank Customer Churn using Random Forest with Monte Carlo Cross …

Write a program to predict Bank Customer Churn using Random Forest with Grid Search Cross Validation in Python

(End-to-End Jupyter Notebook for Citizen Data Scientist & Business Analyst) Write a program to predict Bank Customer Churn using Random Forest with Grid Search Cross Validation in Python. In this end-to-end applied machine learning and data science notebook, the reader will learn: How to predict Bank Customer Churn using Random Forest with Grid Search Cross …

Write a program to predict mobile price using Random Forest Classifier with Monte Carlo CV in Python

(End-to-End Jupyter Notebook for Citizen Data Scientist & Business Analyst) Write a program to predict mobile price using Random Forest Classifier with Monte Carlo CV in Python. In this end-to-end applied machine learning and data science notebook, the reader will learn: How to predict mobile price using Random Forest Algorithm with Monte Carlo CV in …