Good afternoon here. Please help with the start (algorithm) of the program. I have an excel file that has columns with the names of students, their last names, their phone numbers, what country they are from and their marks.
How can I write a python program with which I can input something of the data (phone number, name or surname) and I have to output all the data about the student, all that is known about him. And preferably in a separate file (excel, csv). Thanks for the help.
excel file:
Name | Last Name | Phone number | Country | Mark |
---|---|---|---|---|
Mike | Jackson | 5534987 | USA | A |
Ani | Ward | 4567456 | UK | A |
Alex | Sid | 7745879 | France | C |
If anything, I don't know how to use json and sql. But if it will be easier, than ok.
I entering: 7745879 Output: | Alex | Sid | 7745879 | France | C |
My code only reads the file. I don't know what to do next.
import pandas as pd
import os
file = 'Students.xlsx'
x1=pd.ExcelFile(file)
df1=x1.parse('Math')
for line in df1:
print(df1.loc[:, 'Phone number'])