Access an Item by Referring to the Label
Program Info
Program Code
×

Access an Item by Referring to the Label

We are accessing an item by referring to the label when we created own labels.

Footer

×

Access an Item by Referring to the Label

import pandas as pd

a = [1, 7, 2]

myvar = pd.Series(a, index = ["x", "y", "z"])

print(myvar["y"])

Footer

Add a List of Names to Give Each Row a Name
Program Info
Program Code
×

Add a List of Names to Give Each Row a Name

We are adding a list of names to give each row a name.

Footer

×

Add a List of Names to Give Each Row a Name

import pandas as pd

data = {
  "calories": [420, 380, 390],
  "duration": [50, 40, 45]
}

df = pd.DataFrame(data, index = ["day1", "day2", "day3"])

print(df) 

Footer

Check The Number of Maximum Returned Rows
Program Info
Program Code
×

Check The Number of Maximum Returned Rows

We are checking the number of maximum returned rows.

Footer

×

Check The Number of Maximum Returned Rows

import pandas as pd

print(pd.options.display.max_rows)

Footer

Checking Pandas Version
Program Info
Program Code
×

Checking Pandas Version

We are checking pandas version.

Footer

×

Checking Pandas Version

import pandas as pd

print(pd.__version__)

Footer

Create a DataFrame from Two Series
Program Info
Program Code
×

Create a DataFrame from Two Series

We are creating a dataframe from two Series.

Footer

×

Create a DataFrame from Two Series

import pandas as pd

data = {
  "calories": [420, 380, 390],
  "duration": [50, 40, 45]
}

myvar = pd.DataFrame(data)

print(myvar)

Footer

Create Your Own Labels
Program Info
Program Code
×

Create Your Own Labels

We are creating your own labels.

Footer

×

Create Your Own Labels

import pandas as pd

a = [1, 7, 2]

myvar = pd.Series(a, index = ["x", "y", "z"])

print(myvar)

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