Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
list from excel
#4
You don't convert to df.to_dict() this takes it out of Pandas(has a lot of poweršŸ’„) and it standard dictionary.
By the look of your Excels file this should work.
import pandas as pd

df = pd.read_excel("book.xlsx")
df_val = df.query('id==1')['Name']
print(df_val)
print(d.values[0])  
Reply


Messages In This Thread
list from excel - by devilonline - Jun-22-2022, 02:10 AM
RE: list from excel - by snippsat - Jun-22-2022, 08:49 AM
RE: list from excel - by devilonline - Jun-22-2022, 10:34 PM
RE: list from excel - by snippsat - Jun-22-2022, 10:46 PM
RE: list from excel - by devilonline - Jun-22-2022, 11:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Search Excel File with a list of values huzzug 4 1,416 Nov-03-2023, 05:35 PM
Last Post: huzzug
  trouble reading string/module from excel as a list popular_dog 0 501 Oct-04-2023, 01:07 PM
Last Post: popular_dog
  Compare two Excel sheets with Python and list diffenrences dmkfon 1 14,914 Oct-09-2021, 03:30 PM
Last Post: Larz60+
Question How to make a 3D List of Excel Spreadsheets? chatguy 4 2,863 Jan-24-2021, 05:24 AM
Last Post: buran
  Convert Excel to complex list and2handles 1 2,117 Jun-23-2020, 01:51 PM
Last Post: DPaul
  Trying to color an excel row based on list curranjohn46 2 6,696 May-19-2020, 10:35 AM
Last Post: KavyaL
  How to list out specific excel files ajay_pal7 2 2,915 Mar-10-2020, 05:43 AM
Last Post: Larz60+
  Exporting list with dictionary to Excel veromi22 0 3,128 Oct-15-2019, 12:54 AM
Last Post: veromi22
  Is it possible to access and list all macro names in an excel file? kwfine 0 2,511 Feb-07-2018, 04:21 PM
Last Post: kwfine
  Excel Column as List champk 2 10,561 Jan-03-2018, 11:30 PM
Last Post: karaokelove

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020