Python Forum
Replacing sub array in Numpy array
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Replacing sub array in Numpy array
#5
(Mar-30-2020, 07:24 PM)ThemePark Wrote: Now it's on to multidimensional arrays.
The same rules are true for multidimensional cases.
import numpy as np
x=np.ones((2,2,2), dtype=np.float32)
z =  np.zeros((2,2,2), dtype=np.object)
z[0][0][0] = x
x[0][0][0] = 99
print(z)
Reply


Messages In This Thread
Replacing sub array in Numpy array - by ThemePark - Mar-18-2020, 04:19 AM
RE: Replacing sub array in Numpy array - by scidam - Mar-18-2020, 10:06 AM
RE: Replacing sub array in Numpy array - by scidam - Apr-01-2020, 01:52 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  ndim array Sowmya 2 359 Apr-03-2024, 04:19 AM
Last Post: Sowmya
  [Numpy] How to store different data type in one numpy array? water 7 767 Mar-26-2024, 02:18 PM
Last Post: snippsat
  boolean array: looking for all rows where all is True paul18fr 4 1,258 Jan-04-2023, 09:58 PM
Last Post: paul18fr
  reshaping 2D numpy array paul18fr 3 1,057 Jan-03-2023, 06:45 PM
Last Post: paul18fr
  Turn list of arrays into an array of lists Cola_Reb 6 1,765 Jul-20-2022, 06:55 PM
Last Post: Cola_Reb
  Numpy returns "TypeError: unsupported operand type(s) for *: 'numpy.ufunc' and 'int'" kalle 2 2,689 Jul-19-2022, 06:31 AM
Last Post: paul18fr
Question how to write a function that accepts a 1D array as a parameter in Python SuperNinja3I3 1 1,667 Jul-02-2022, 01:55 PM
Last Post: Larz60+
  replace sets of values in an array without using loops paul18fr 7 1,803 Jun-20-2022, 08:15 PM
Last Post: paul18fr
  how to parse this array with pandas? netanelst 1 1,398 May-17-2022, 12:42 PM
Last Post: netanelst
  semantics of comma inside array brackets usercat123 2 1,404 Apr-23-2022, 09:08 AM
Last Post: usercat123

Forum Jump:

User Panel Messages

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