rint<\/em> tool rounds to the nearest integer of input element-wise.<\/p>\n\n\n\nimport numpy\n\nmy_array = numpy.array([1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9])\nprint numpy.rint(my_array) #[ 1. 2. 3. 4. 6. 7. 8. 9. 10.]<\/code><\/pre>\n\n\n\n<\/span>Task<\/strong><\/span><\/h2>\n\n\n\nYou are given a 1-D array, A<\/em><\/strong>. Your task is to print the floor<\/strong><\/em>, ceil<\/strong><\/em> and rint<\/strong><\/em> of all the elements of A<\/strong><\/em>.<\/p>\n\n\n\nNote<\/strong>
In order to get the correct output format, add the line numpy.set_printoptions(legacy=”1.13)<\/strong> below the numpy import.<\/p>\n\n\n\n<\/span>Input Format<\/strong><\/span><\/h2>\n\n\n\nA single line of input containing the space separated elements of array A<\/strong><\/em>.<\/p>\n\n\n\n<\/span>Output Format<\/strong><\/span><\/h2>\n\n\n\nOn the first line, print the floor<\/strong><\/em> of A.
On the second line, print the ceil<\/strong><\/em> of A.
On the third line, print the rint<\/strong><\/em> of A.<\/p>\n\n\n\nSample Input<\/strong><\/p>\n\n\n\n1.1 2.2 3.3 4.4 5.5 6.6 7.7 8.8 9.9<\/code><\/pre>\n\n\n\nSample Output<\/strong><\/p>\n\n\n\n[ 1. 2. 3. 4. 5. 6. 7. 8. 9.]\n[ 2. 3. 4. 5. 6. 7. 8. 9. 10.]\n[ 1. 2. 3. 4. 6. 7. 8. 9. 10.]<\/code><\/pre>\n\n\n\n<\/span>Solution – Floor, Ceil and Rint in Python <\/strong><\/span><\/h2>\n\n\n\nimport numpy\n\nnumpy.set_printoptions(sign=' ')\n\na = numpy.array(input().split(),float)\n\nprint(numpy.floor(a))\nprint(numpy.ceil(a))\nprint(numpy.rint(a))<\/pre>\n\n\n\n