convert array to int code example

Example 1: np convert to int

>>> x = np.array([[1.0, 2.3], [1.3, 2.9]])
>>> x
array([[ 1. ,  2.3],
       [ 1.3,  2.9]])
>>> x.astype(int)
array([[1, 2],
       [1, 2]])

Example 2: java int to int array

int number = 110101; 
String temp = Integer.toString(number);
int[] numbers = new int[temp.length()];
for (int i = 0; i < temp.length(); i++) {
    numbers[i] = temp.charAt(i) - '0';
}

Example 3: convert array to number

let x = [1,2,3,4,5]
let num = +x.join("")

Example 4: how to convert array to int

int i, k = 0;
for (i = 0; i < n; i++)
    k = 10 * k + a[i];