Access The Element on the Second Row, Fifth Column
Program Info
Program Code
×

Access The Element on the Second Row, Fifth Column

We are accessing the element on the second row, fifth column.

Footer

×

Access The Element on the Second Row, Fifth Column

import numpy as np

arr = np.array([[1,2,3,4,5], [6,7,8,9,10]])

print('5th element on 2nd row: ', arr[1, 4])

Footer

Access The Splitted Arrays
Program Info
Program Code
×

Access The Splitted Arrays

We are accessing the splitted arrays.

Footer

×

Access The Splitted Arrays

import numpy as np

arr = np.array([1, 2, 3, 4, 5, 6])

newarr = np.array_split(arr, 3)

print(newarr[0])
print(newarr[1])
print(newarr[2])

Footer

ceil Function Rounds Off Decimal to Nearest Upper Integer
Program Info
Program Code
×

ceil Function Rounds Off Decimal to Nearest Upper Integer

We using ceil function that rounds off decimal to nearest upper integer.

Footer

×

ceil Function Rounds Off Decimal to Nearest Upper Integer

import numpy as np

arr = np.ceil([-3.1666, 3.6667])

print(arr)

Footer

Change Data Type from Float to Integer
Program Info
Program Code
×

Change Data Type from Float to Integer

We are changing data type from float to integer.

Footer

×

Change Data Type from Float to Integer

import numpy as np

arr = np.array([1.1, 2.1, 3.1])

newarr = arr.astype('i')

print(newarr)
print(newarr.dtype)

Footer

Checking NumPy Version
Program Info
Program Code
×

Checking NumPy Version

We are checking numpy version.

Footer

×

Checking NumPy Version

import numpy as np

print(np.__version__)

Footer

Checking The Data Type of an Array
Program Info
Program Code
×

Checking The Data Type of an Array

We are checking the data type of an array.

Footer

×

Checking The Data Type of an Array

import numpy as np

arr = np.array([1, 2, 3, 4])

print(arr.dtype)

Footer


×

Name : Krishna Verma    |    Father's Name : Mr. Satish Kumar    |    Email ID : krishnaverma28081997@gmail.com    |    Religion : Hindu    |    Address : Dayampur, kanker khera, Meerut Cantt (250001), UP    |    Date of Birth : 28 August 1997    |    Marital Status : Non-Married    |    Place of Birth : Dayampur Kanker Khera Meerut Cantt.    |    Gender : Male    |    Age : 28    |    Contact : 9520335394    |    Father's Occupation : Sports man    |    Mother's Name : Smt. Kuntesh Devi    |    Mother's Occupation : Homemaker    |    Number of Brothers : 1    |    Number of Sisters : 1    |    Current Residence : Dayampur kanker khera meerut cantt    |    Family Type : Nuclear Family    |    Family Name : verma    |    Height : 5' 6''    |    Weight : 70 kg    |    Complexion : Fair    |    Body Type : Athletic    |    Hair Color : Black    |    Health Status : Good    |    Any Physical Disability : No    |    Highest Qualification : B.Tech (CSE)    |    Master Skill : PHP Laravel    |    Total Projects : 40 +    |    Total Skills : 25 +    |    Languages Known : Hindi and English    |    Website : krishnaportfolio.in    |    Siblings : 3    |    Nationality : Indian    |    Total Experience : 5 Years    |    LinkedIn : https://www.linkedin.com/in/krishna-verma-840b71356/    |    Total Programs : 10000    |    Total Projects : 40    |    Total Skills : 25    |    Total Experience : 5    |    Total DSA Problems : 165    |    Total Served Companies : 2