Python Forum
Passing a int into the query
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Passing a int into the query
#1
Hi, i have an input on my code and I want that this input pass a int to the query.
For example I type ‘1’ and it search by the number typed.

the code i have

import pandas as pd
 
df = pd.read_excel("book.xlsx")

ser = input("Provide age: ")


df_val = df.query(f"id==1")['Name']





print(df_val.values[0])  
Thanks
Reply


Messages In This Thread
Passing a int into the query - by devilonline - Jun-24-2022, 08:34 PM
RE: Passing a int into the query - by rob101 - Jun-24-2022, 09:05 PM
RE: Passing a int into the query - by snippsat - Jun-24-2022, 09:49 PM
RE: Passing a int into the query - by devilonline - Jun-25-2022, 12:55 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Alteryx QS-Passing pandas dataframe column inside SQL query where condition sanky1990 0 775 Dec-04-2023, 09:48 PM
Last Post: sanky1990

Forum Jump:

User Panel Messages

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