Python Forum
Access 2D array problem
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Access 2D array problem
#1
I got:

SortedArray2D= [['a', 'b', 'c', 'd', 'e'], ['f', 'g', 'h', 'i', 'j'], ['k', 'l', 'm', 'n', 'o'], ['p', 'q', 'r', 's', 't'], ['u', 'v', 'w', 'x', 'y']]
print(SortedArray2D[:][1])
gives
Quote:['f', 'g', 'h', 'i', 'j']

and
print(SortedArray2D[1][:])
also gives
Quote:['f', 'g', 'h', 'i', 'j']


If I want to 2D array access without numpy, how can I solve this?

I know we can do SortedArray2D[i][j], can't we do SortedArray2D[:][j]?
Reply
#2
actually, what do you want to achieve?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  array coding problem pberrett 3 1,934 May-08-2020, 05:54 AM
Last Post: nnk
  access a very large file? As an array or as a dataframe? Angelika 5 4,857 May-18-2017, 08:15 AM
Last Post: Angelika

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020