mercredi 27 janvier 2021

How to print specific output based on condition from variable [closed]

I have a database which looks like this:

database

And I would like to know how to do a loop to print an output based on some condition.

Here's the output I would like to have (in a txt file for example):

  • Name 1

    • Mission 1

      • Sentence1
      • Sentence2
    • Mission 2

      • Sentence3
  • Name2

    • Mission3

      • Sentence4
    • Mission4

      • Sentence5

I would like to know how to have an output based on condition on df['Name'] and df['Mission'] in order to have categories but I'm stuck because I never did this kind of condition in a loop.

How can I do that?

Aucun commentaire:

Enregistrer un commentaire