1
I have a spreadsheet in Excel with all my students and their respective grades (5th to 9th).
I need to find all my students who aren’t in any class. Through the Excel filter I can do, but I have almost 5 thousand registered students and I would like to find a more automatic and quick way to do this work.
As I am starting to learn Python, I would like help to come in this language if possible.
I tried to use a for
loop but I guess I didn’t do it right because it only brings the first name and the first grade of the student (almost like a PROCV
excel).
In the example image, the student Gabriela would be one of the students that I would have to filter, because she is no longer in any class of any grade. The others have already completed some grades and/ or lack to complete others, so at some point these students have their enrollment in effect.
From now on, I appreciate all your help! ;)
--
So far, I’ve written the following code:
aluno = ["Pedro", "Gabriela", "Aluisio", "Deborah"]
matricula = ["Vigente", "Sem turma"]
for n in aluno:
if matricula == "Vigente":
print(f"Curso de {aluno} em andamento.")
else
print(f"Curso de {aluno} concluído.")
Post the Python code you’ve already written so we can help you with your difficulties.
– Augusto Vasques
Thanks, Augusto! I just edited the original post with the code I wrote so far.
– Daniel Buck
This code is not able to manipulate data in Excel. At least you would have to use one of the libraries listed in this page. Or if you’re using Ironpython you’d have to have the line
import clr clr.AddReference("Microsoft.Office.Interop.Excel")
.– Augusto Vasques