473,395 Members | 1,386 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,395 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 8736
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.