How to read a xlsx file using the pandas Library in iPython

0 votes

I want to read a .xlsx file using the Pandas Library of python and port the data to a postgreSQL table.

All I could do up until now is:

import pandas as pd
data = pd.ExcelFile("*File Name*")

Now I know that the step got executed successfully, but I want to know how i can parse the excel file that has been read so that I can understand how the data in the excel maps to the data in the variable data.
I learnt that data is a Dataframe object if I'm not wrong. So How do i parse this dataframe object to extract each line row by row.

Mar 23 in Database by Edureka
• 13,640 points
134 views

1 answer to this question.

0 votes

Every sheet gets its own DataFrame, which I keep in a dictionary.

xl_file = pd.ExcelFile(file_name)

dfs = {sheet_name: xl_file.parse(sheet_name)
          for sheet_name in xl_file.sheet_names}
answered Mar 25 by anonymous

Related Questions In Database

0 votes
1 answer

How to display the queries executed by a particular user in MySQL?

From the version 5.1.7 onward, MySQL allows ...READ MORE

answered Mar 7, 2019 in Database by Mishti
• 480 points
2,116 views
0 votes
2 answers

How to select the nth row in a SQL database table?

SELECT * FROM ( SELECT ID, NAME, ROW_NUMBER() ...READ MORE

answered Apr 23, 2020 in Database by anand
• 140 points
18,901 views
0 votes
1 answer

How to rename a column in a database table using SQL?

For SQL Server, use sp_rename USE AdventureWorks; GO EXEC sp_rename 'Customers.CustomerTerritory.TerritoryID', ...READ MORE

answered Feb 9 in Database by Neha
• 8,940 points
145 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to download created excel file in node.js using exceljs

Download a sample Excel file using Node. ...READ MORE

answered Apr 4 in Database by Edureka
• 13,640 points
3,654 views
0 votes
1 answer

How to open a password protected excel file using python?

I recently came upon a Python package ...READ MORE

answered Apr 6 in Database by gaurav
• 22,040 points
3,885 views
0 votes
0 answers

How to select the last record of a table in SQL?

Here is an example of code that ...READ MORE

Aug 23 in Database by Kithuzzz
• 20,660 points
242 views
0 votes
1 answer

Insert a value to a cell in excel using formula in another cell

Select the cell where the formula should ...READ MORE

answered Mar 25 in Database by gaurav
• 22,040 points
1,142 views
0 votes
1 answer

How can I calculate deciles with a range of 12,000 cells in excel?

1. Enter the following formula in cell ...READ MORE

answered Mar 25 in Database by gaurav
• 22,040 points
2,013 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP