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 deep learning project, you will build a convolutional neural network using MNIST dataset for handwritten digit recognition.

In this machine learning pricing project, we implement a retail price optimization algorithm using regression trees. This is one of the first steps to building a dynamic pricing model.

Data Science Project in Python- Given his or her job role, predict employee access needs using amazon employee database.

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

Build your own image similarity application using Python to search and find images of products that are similar to any given product. You will implement the K-Nearest Neighbor algorithm to find products with maximum similarity.

Data Science Project in R-Predict the sales for each department using historical markdown data from the Walmart dataset containing data of 45 Walmart stores.

In this project you will use Python to implement various machine learning methods( RNN, LSTM, GRU) for fake news classification.

PySpark Project-Get a handle on using Python with Spark through this hands-on data processing spark python tutorial.

We all at some point in time wished to create our own language as a child! But what if certain words always cooccur with another in a corpus? Thus you can make your own model which will understand which word goes with which one, which words are often coming together etc. This all can be done by building a custom embeddings model which we create in this project