Question about a code block

Hello :grinning:
I’m newbie,
now I’m studying a dynamo script that someone already maded.
But there a thing that I can’t understand.

  1. what is “a” mean in the Code Block node?
  2. why the Code Block list is not showing all lists for column 5,6,7 of CSV file inputed?
  3. why the Code Block list is not showing the list in order?
    image

please answer me …! thank you :grinning:

The ‘a’ is a variable and is whatever you set it to be in the input. It could just as easily be ‘i’ or ‘x’, and there can be as many or as few as you like. You’ll see you’re telling it it get index 5 of a, index 6 of a, etc, and you’ve connected a wire from your csv import to a to tell it what ‘a’ is.

The drop down preview on code blocks only shows the last output, i.e. a[7]. You could connect a watch node to each output if you wanted a preview of them all.

The list of a[7] is in order.

Thank you so much! It it so clear! :grinning:
then now I have one more question…!
so if i want to extract the elements of RAW in the CVS file that I inputed,
what would I write in the code block?

ex. for extract the elements of 5th column in the CVS → a[5];
for extract the elements of 5th raw in the CVS → a[??];

in the question marks, what should I have to write?

You could List.Transpose the list first. This essentially flips the columns and rows.

1 Like

oh, there it is! Thank you so much! :grinning: