473,325 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Extracting Data from Excel using Python

1
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 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
Jun 10 '22 #1
1 8727
zmbd
5,501 Expert Mod 4TB
Post the code you’ve already done
Simply asking for code isn’t going to get you much help
Jun 10 '22 #2

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

Similar topics

4
by: RK | last post by:
Hi, In my application, I need to copy data from an Excel file into a SQL table. The article related to this can be found at http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B306572 ...
3
by: jonas | last post by:
Guys was wondering has any done this I need to get a heads up as i need to grab data from a databasemake some changes and then put it back in place I'm guessing the MySqlDB Module be it seems...
1
by: santhosh kumar | last post by:
hi all.... i'm an newbie to xml how to transform the data which is obtained dynamically to xml file in Python programming language any comments will be thankfull
0
by: Sunil Basu | last post by:
Hi, I have a interesting thing to know and discuss with you. I am extracting data from an Excel file in a Delphi DbGrid through SQL. I want to create a criteria on a specific cell value of the...
1
by: whitfieldd | last post by:
I am fairly new to the python language. I need to retieve data (XML file data) from http post using python. Are there any libraries that can point me in the right direction? Thanks for your...
1
by: Girish | last post by:
Hi, I want to embed a txt document into an excel using python. Here is my code, but i get an error message =================================================== Traceback (most recent call...
2
by: padmashreeg | last post by:
Hi, How to embed object in excel using python? Thanks, padma
1
by: JSagar | last post by:
Hello Expert ! I am new to python , i had done 'C' Code , which extracted file data , But i don't want to give my exe On remote side. Following thing is it Possible using python? -...
1
by: CORVID6116 | last post by:
Hi Guys, I can read and write .XLS files using Python. But now i need to write an XLS file with conditional formatting on some of the cells. Any help would be appreciated. Thanls
6
gesqo
by: gesqo | last post by:
I have a column of some hundreds rows, obtained by a python program,each cell containing 4 unequal (in length) strings,like: adfhyhh ihhgfdtykk red piuol How can I split it with python in 4...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.