Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
numpy 2-dimentional
#1
I am trying to learn numpy and I am trying to print some data as shown below:

import numpy as np

names = np.array([["Rami", "Taher", "Wahdan"],["First", "Middle", "Last"]])
print(names[[0,0],[1,0]])
The output I am getting is:
Output:
['Taher' 'Rami']
But it should show:
Output:
['Rami' 'First']
What did I do wrong?
Reply


Messages In This Thread
numpy 2-dimentional - by rwahdan - Sep-11-2021, 04:54 PM
RE: numpy 2-dimentional - by jefsummers - Sep-11-2021, 05:35 PM
RE: numpy 2-dimentional - by perfringo - Sep-11-2021, 08:44 PM
RE: numpy 2-dimentional - by deanhystad - Sep-21-2021, 07:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Numpy] How to store different data type in one numpy array? water 7 300 Mar-26-2024, 02:18 PM
Last Post: snippsat
  Numpy returns "TypeError: unsupported operand type(s) for *: 'numpy.ufunc' and 'int'" kalle 2 2,530 Jul-19-2022, 06:31 AM
Last Post: paul18fr
  "erlarge" a numpy-matrix to numpy-array PhysChem 2 2,934 Apr-09-2019, 04:54 PM
Last Post: PhysChem
  Convert element of list to integer(Two dimentional array) zorro_phu 3 4,634 Jun-12-2018, 04:49 AM
Last Post: zorro_phu

Forum Jump:

User Panel Messages

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