Extracting Data from Excel using Python

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cmpunk
    New Member
    • Jun 2022
    • 1

    Extracting Data from Excel using Python

    blank row
    blank row
    Run Date:2022/05/31
    2022/05/01-2022/05/31
    Deal ID Deal Name Origination Date Maturity Date
    PEP D251 5/1/2019 3/13/2023
    KO D351 10/2/2020 4/15/2025
    MM D451 11/10/2021 12/1/2026


    This data is in table format and I want to use Python and extra data from the 5th line (that is Deal ID, Deal Name, Origination Date, Maturity Date) to the 8th line. Also once I have extracted data I want to save the file in the following format ExtensionReport 202205.csv and whole things should be Dynamic. I used skip rows and iloc to get rows but it is not dynamic? So kindly advise.

    "import pandas as pd df=pd.read_exce l("C:\\Users\\p unk\\Downloads\ \sample.xlsx",s kiprows=4) df2=df.iloc[0:] " Using this code I am able to extract the data along with the header but it is not dynamic. The above image is an excel file called sample and I want to extra data along with header and save file in csv format. I should save file as "Extension_Repo rt202205
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    Post the code you’ve already done
    Simply asking for code isn’t going to get you much help

    Comment

    Working...