'How to print complete row from excel Sheet using python pandas from user input?

I asked the same question but it is closed and I am not clear with that answer so I am asking again.

I have an excel file similar to this:

enter image description here

Above is the attached picture to see what the excel sheet looks like.

I am learning to write a program if the user input "Martin" it should displays the entire row.

Still learning the basics. Can someone help me how to display the entire row using user input?

below is the code which is not giving output or error.

import pandas as pd
import os

student = pd.read_excel("student.xlsx",sheet_name="Sheet1")

i = input("enter store number: ")

found = []

for letter in i:
    if letter in student:
        if letter not in found:
            found.append(letter)
for student in found:
    print(student)


Solution 1:[1]

Obviously you are trying to a select the rows where your column value = input. This is the best way to do that :)

import pandas as pd
import os

student = pd.read_excel("student.xlsx",sheet_name="Sheet1")

i = input("enter store number: ")
print(student[student['Name'] == i])

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1