0

I am new to learning python and am hoping to receive a little clarity.

If I have some python code that looks like the following:

for row in my_data:
        for w in row[1:]:

Is that essentially saying:

  1. For each row in the my_data.csv
  2. For each column, in the current row in the my_data.csv, starting at the second column (Column B)

I am trying to understand more directly what the syntax row[1:] means. I have not successfully found documentation that answers that.

Thanks.

artemis
  • 6,857
  • 11
  • 46
  • 99
  • You have interpreted both loops correctly. See the duplicate question to learn more about slice notation (i.e. `[1:]` part). – Selcuk Feb 07 '19 at 01:24
  • 1
    Thank you @Selcuk, I didn't know it was called 'slice' notation. I apologize for making a duplicate. – artemis Feb 07 '19 at 01:25
  • @JerryM. All good. Such questions are difficult to search online when you don't know the correct term. – Selcuk Feb 07 '19 at 01:31

0 Answers0