Task
You are given a space separated list of nine integers. Your task is to convert this list into a X NumPy array.
Input Format
A single line of input containing  space separated integers.
Output Format
Print the X NumPy array.

hackerrank shape and reshape problem solution in python programming

Problem solution in Python 3 programming language.

import numpy

my_array = numpy.array(map(int, input().split()))
print(numpy.reshape(my_array, (3, 3)))

Second solution

import numpy as np
print(np.array(input().split(),int).reshape(3,3))

Problem solution in Python 2 programming language.

import numpy

my_array = numpy.array(map(int, raw_input().split()))
print numpy.reshape(my_array, (3, 3))