
Quick Contact
Python Tutorial
- What is Python?
- How to Install Python?
- Python Variables and Operators
- Python Loops
- Python Functions
- Python Files
- Python Errors and Exceptions
- Python Packages
- Python Classes and Objects
- Python Strings
- PostgreSQL Data Types
- Python Generators and Decorators
- Python Dictionary
- Python Date and Time
- Python List and Tuples
- Python Multithreading and Synchronization
- Python Modules
- What is Python bytecode?
- Python Regular Expressions
Python Panda Tutorial
- Python Pandas Tutorial
- Python Pandas Features
- Advantages and Disadvantages of Python Pandas
- Pandas Library In Python
- Pandas Series To Frame
- Python Dataframeaggregate and Assign
- Pandas Dataframe Describe
- Pandas Dataframe Mean
- Pandas Hist
- Pandas Dataframe Sum
- How to convert Pandas DataFrame to Numpy array
- Pandas Concatenation
- Pandas Shift
- Pandas Rolling
- Data Analysis With Pandas and Python
- How Python Panda Are Helpful For With Data Science
Python Selenium
- Selenium Basics
- Selenium with Python Introduction and Installation
- Navigating links using get method Selenium Python
- Locating Single Elements in Selenium Python
- Locating Multiple elements in Selenium Python
Python Flask Tutorial
Python Django
- How to Install Django and Set Up a Virtual Environment in 6 Steps
- Django MTV Architecture
- Django Models
- Django Views
- Django Templates
- Django Template Language
- Django Project Layout
- Django Admin Interface
- Django Database
- Django URLs and URLConf
- Django Redirects
- Django Cookies and Cookies Handling
- Django Caching
- Types of Caching in Django
- Django Sessions
- Django Forms Handling & Validation
- Django Exceptions & Error-handling
- Django Forms Validation
- Django Redirects
- Django Admin Interface
- Django Bootstrap
- Ajax in Django
- Django Migrations and Database Connectivity
- Django Web Hosting and IDE
- Django Admin Customization
- What is CRUD?
- Django ORM
- Django Request-Response Cycle
- Django ORM
- Making a basic_api with DRF
- Django Logging
- Django Applications
- Difference between Flask vs Django
- Difference between Django vs PHP
Numpy
- Numpy Introduction
- NumPy– Environment Setup
- NumPy - Data Types
- NumPy–Functions
- NumPy Histogram
- numPy.where
- numpy.sort
- NumPyfloor
- Matrix in NumPy
- NumPy Arrays
- NumPy Array Functions
- Matrix Multiplication in NumPy
- NumPy Matrix Transpose
- NumPy Array Append
- NumPy empty array
- NumPy Linear Algebra
- numpy.diff()
- numpy.unique()
- numpy.dot()
- numpy.mean()
- Numpy.argsort()
- numpy.pad()
- NumPyvstack
- NumPy sum
- NumPy Normal Distribution
- NumPylogspace()
- NumPy correlation
- Why we learn and use Numpy?
Tensorflow
- Introduction To Tensorflow
- INTRODUCTION TO DEEP LEARNING
- EXPLAIN NEURAL NETWORK?
- CONVOLUTIONAL AND RECURRENT NEURAL NETWORK
- INTRODUCTION TO TENSORFLOW
- INSTALLATION OF TENSORFLOW
- TENSORBOARD VISUALIZATION
- Linear regression in tensorflow
- Word Embedding
- Difference between CNN And RNN
- Explain Keras
- Program elements in tensorflow
- Recurrent Neural Network
- Tensorflow Object Detection
- EXPLAIN MULTILAYER PERCEPTRON
- GRADIENT DESCENT OPTIMIZATION
Interview Questions & Answers
NumPy Normal Distribution is one of the various functions supported by the python numpy library that allows us to create a normal distribution or Gaussian distribution, which is can be used to fit the probability distribution of various elements and events that occur naturally or created by us. Furthermore, with the help of the feature random supported by the numpy library, we can create or generate a random normal distribution, and using various visualization packages in python, we can also plot and visualize the distribution.
Syntax:
The basic syntax of the NumPyNewaxis function is:
numpy.random.normal(loc=, scale= size=)
-
numpy.random.normal:
It is the function that is used to generate the normal distribution of our desired shape and size.
-
loc:
Indicates the mean or average of the distribution; it can be a float or an integer.
-
scale:
A non-negative integer or float that indicates the standard deviation, which is the width of the overall distribution.
-
size:
It can be a tuple with a float or integer, and it represents the distribution’s output size or shape, and when loc and scales are n scalar values, the size will a single value is returned when size is given as none as input.
Examples of NumPy Normal Distribution
Given below are the examples of NumPy Normal Distribution:
Example #1
Let us see a basic example for understanding how the numpy normal distribution function is used to generate a normal distribution.
Code:
importnumpy as np mean = 2 sigma = 0.4 out = np.random.normal(mean, sigma, 500)
Example #2
In this example, we will see how to change the one-dimensional array to a two-dimensional array using the new axis object.
Code:
importnumpy as np out1 = np.random.normal(2, 4.5, size=(4, 8)) out1
Example #3
In this example, we have created two normal distribution arrays, ‘a’ and ‘b’, using different techniques.
Code:
import numpy as np a = np.random.normal(size=(3, 4)) b = np.random.normal(loc=2, scale=3, size=(2, 3)) print(a) print(b)
Example #4
In this example, we will see how we can visualize the normal distribution using both the matplotlib library and seaborn library.
Code:
importnumpy as np import seaborn as sns import matplotlib.pyplot as plt mean = 3 sigm = 5 out = np.random.normal(mean, sigma, 1000) sns.distplot(out,hist=False) plt.hist(out, 25, density=True)
Example #5
In this example, we have created normal distribution and a random distribution and compared both the distribution using histogram from the matplotlib library.
Code:
import numpy as np N, mean, sigm = 1000, 50, 7 a = mean + sigm*np.random.randn(N) b = mean + sigm*(np.random.rand(N)-0.7) fig, axes = plt.subplots(ncols=2) axes[0].set_title('Normal Distribution') x, bin_1, patch1 = axes[0].hist(a, 20, facecolor='R', alpha=0.7) axes[1].set_title('Random Distribution') x2, bins_2, patch2 = axes[1].hist(b, 20, facecolor='K', alpha=0.7) plt.show()