Data Frames in Pandas - 2D Array

     

  • It is a two dimentional data structure
  •  

  • It is represented in tabular format
  •  

  • It consists of row index and column index
  •  

  • df.columns, denotes about columns
  •  

  • df.index, denotes about rows
  •  

    Structure of Data Frame:

     

     

    Source to create DataFrames:

     

  • Lists
  • Dictionaries
  • Series
  • Numpyndarrays
  • Create one Dataframe to another
  •  

    DataFreame sysntax:

     

     

    Data Frames with Dictionaries

     

  • If data represents to list we need to mention the column headers, whereas data is in form of DICTIONARY, KEY value is conidered as column Headers
  •  

     

    Craete Dataframe without providing values to Index

     

     

    Craete Dataframe after providing values to Index

     

     

    Row index and column Headers

     

     

    Retrieve all the values\rows

     

     

    Retrieve all the values\rows

     

     

    Row slicing

     

     

    Row slicing - multiple rows

     

     

    Row slicing - all rows

     

     

    Dataframe - column slicing - single column

     

     

     

    Dataframe - Delete a column

     

     

     

    Dataframe - row slicing and column slicing

     

     

    Dataframe - Apply condition on a column

     

     

    Dataframe - Transpose