0

I am just not getting this. I want to create a simple 2D array. I do not know the size, but it will be N number of rows of 3 columns. I have tried several things:

data_list[v_row][v_trade_date, v_buy_text, v_ticker]
data_list.append[v_trade_date, v_buy_text, v_ticker]
data_list[v_row].append(v_trade_date)
data_list[v_row].append(v_sell_text)
data_list[v_row].append(v_ticker)

Just not getting it. I do not need to use any FOR loop to assign the values, as each time through the outer loop, I'll be getting 3 items, and I'll assign them explicitly into different cells of that row. Maybe my thinking is wrong, and I'm thinking of 2D arrays from other languages, but any help would be great.

2
  • 1
    i think it would be helpful if you described what your outer loop looks like and what is the end result expected. Commented Jun 1, 2020 at 18:16
  • It would be helpful if you posted code and the error messages or output that display when you run it. Commented Jun 1, 2020 at 18:18

1 Answer 1

1

For appending a row:

data_list.append([v_trade_date, v_buy_text, v_ticker])

And for assigning:

data_list[v_row] = [v_trade_date, v_buy_text, v_ticker]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.