MACHINE LEARNING RECIPES
DATA CLEANING PYTHON
DATA MUNGING
PANDAS CHEATSHEET
ALL TAGS
# How to round away from zero a float array?

# How to round away from zero a float array?

This recipe helps you round away from zero a float array

While dealing arrays, there is need to round off float numbers to some decimal places or even to an integer.

So this recipe is a short example on how to round away from zero a float array. Let's get started.

```
import numpy as np
```

Let's pause and look at these imports. Numpy is generally used for working with arrays and performing mathematical operations in domain of linear algebra, fourier transform and matrices.

```
def round_array(x,y):
return np.round(x,y)
```

This function takes x and y as input and return x rounded to y decimal places.

```
test = np.array([32.11, 51.5, 0.112])
```

We have simply setup one random array

```
print(round_array(test,0))
```

Firslty, we call our round_array function sending in our test dataset and 0 (places to which it will be rounded.

Once we run the above code snippet, we will see:

[32. 52. 0.]

Use the Amazon Reviews/Ratings dataset of 2 Million records to build a recommender system using memory-based collaborative filtering in Python.

In this data science project, you will learn how to perform market basket analysis with the application of Apriori and FP growth algorithms based on the concept of association rule learning.

In this ensemble machine learning project, we will predict what kind of claims an insurance company will get. This is implemented in python using ensemble machine learning algorithms.

In this supervised learning machine learning project, you will predict the availability of a driver in a specific area by using multi step time series analysis.

Data Science Project - Build a recommendation engine which will predict the products to be purchased by an Instacart consumer again.

Machine Learning Project in R-Detect fraudulent click traffic for mobile app ads using R data science programming language.

In this machine learning resume parser example we use the popular Spacy NLP python library for OCR and text classification.

In this machine learning project, you will develop a machine learning model to accurately forecast inventory demand based on historical sales data.

In this data science project, you will predict borrowers chance of defaulting on credit loans by building a credit score prediction model.

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.