How to create RANDOM Numbers in Python?
DATA MUNGING DATA CLEANING PYTHON MACHINE LEARNING RECIPES PANDAS CHEATSHEET     ALL TAGS

How to create RANDOM Numbers in Python?

How to create RANDOM Numbers in Python?

This recipe helps you create RANDOM Numbers in Python

0

Recipe Objective

Many a times we need a random number so how we can get it?

So this is the recipe on how we can create RANDOM Numbers in Python.

Step 1 - Loading Library

We have imported numpy which is needed. import numpy as np

Step 2 - Generating Random Numbers

We have generated a few random number numbers with the help of function np.random we have used a attribute normal to make sure that it comes from a normal distribution. print(np.random.normal()) print(np.random.normal(size=14)) print(np.random.uniform(size=14)) print(np.random.randint(low=1, high=100, size=14)) So the output comes as

0.13675095711660307

[-1.5024633   0.36342989  0.70793256 -0.9789945   0.61796606  0.98637534
  1.32068877  1.81571864  0.23038631  0.65866147  0.7082002   0.01925767
  1.94746162 -1.38092815]

[0.16054208 0.00366705 0.03862502 0.27800544 0.32018415 0.95070521
 0.34582893 0.40153549 0.37467516 0.36899577 0.47037688 0.74223317
 0.18082368 0.9568694 ]

[83 48 72 16 89 80  6 17 71 59 52 56 87 45]

Relevant Projects

Perform Time series modelling using Facebook Prophet
In this project, we are going to talk about Time Series Forecasting to predict the electricity requirement for a particular house using Prophet.

Zillow’s Home Value Prediction (Zestimate)
Data Science Project in R -Build a machine learning algorithm to predict the future sale prices of homes.

Deep Learning with Keras in R to Predict Customer Churn
In this deep learning project, we will predict customer churn using Artificial Neural Networks and learn how to model an ANN in R with the keras deep learning package.

Choosing the right Time Series Forecasting Methods
There are different time series forecasting methods to forecast stock price, demand etc. In this machine learning project, you will learn to determine which forecasting method to be used when and how to apply with time series forecasting example.

Mercari Price Suggestion Challenge Data Science Project
Data Science Project in Python- Build a machine learning algorithm that automatically suggests the right product prices.

Predict Macro Economic Trends using Kaggle Financial Dataset
In this machine learning project, you will uncover the predictive value in an uncertain world by using various artificial intelligence, machine learning, advanced regression and feature transformation techniques.

Time Series Forecasting with LSTM Neural Network Python
Deep Learning Project- Learn to apply deep learning paradigm to forecast univariate time series data.

Ecommerce product reviews - Pairwise ranking and sentiment analysis
This project analyzes a dataset containing ecommerce product reviews. The goal is to use machine learning models to perform sentiment analysis on product reviews and rank them based on relevance. Reviews play a key role in product recommendation systems.

Data Science Project in Python on BigMart Sales Prediction
The goal of this data science project is to build a predictive model and find out the sales of each product at a given Big Mart store.

Build an Image Classifier for Plant Species Identification
In this machine learning project, we will use binary leaf images and extracted features, including shape, margin, and texture to accurately identify plant species using different benchmark classification techniques.