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.]

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.

In this machine learning churn project, we implement a churn prediction model in python using ensemble techniques.

In this data science project in R, we are going to talk about subjective segmentation which is a clustering technique to find out product bundles in sales data.

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

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.

Text data requires special preparation before you can start using it for any machine learning project.In this ML project, you will learn about applying Machine Learning models to create classifiers and learn how to make sense of textual data.

Deep Learning Project- Learn to apply deep learning paradigm to forecast univariate time series data.

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

In this project, we are going to work on Sequence to Sequence Prediction using IMDB Movie Review Datasetâ€‹ using Keras in Python.

This data science in python project predicts if a loan should be given to an applicant or not. We predict if the customer is eligible for loan based on several factors like credit score and past history.