470,833 Members | 1,464 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

Extracting Data from Excel using Python

blank row
blank row
Run Date: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 ExtensionReport202205.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_excel("C:\\Users\\punk\\Downloads\\samp le.xlsx",skiprows=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_Report202205
2 Weeks Ago #1
1 7864
5,463 Expert Mod 4TB
Post the code you’ve already done
Simply asking for code isn’t going to get you much help
2 Weeks Ago #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by padmashreeg | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.