Python Forum
How to concatenate nested numpy arrays?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to concatenate nested numpy arrays?
#2
Try:
np.concatenate((first_array, second_array), 2)
   
You can also flatten both arrays:

shape = (1, 1, 609768, 1)
flat_a = np.zeros(shape).flatten()
flat_b = np.ones(shape).flatten()
flat_ab = np.concatenate((flat_a, flat_b))
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
RE: How to concatenate nested numpy arrays? - by DeaD_EyE - Apr-16-2019, 06:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  problem adding two numpy arrays djf123 2 2,145 Aug-09-2022, 08:31 PM
Last Post: deanhystad
  how to join by stack multiple types in numpy arrays caro 1 1,173 Jun-20-2022, 05:02 PM
Last Post: deanhystad
  numpy.dot() result different with classic computation for large-size arrays geekgeek 5 1,978 Jan-25-2022, 09:45 PM
Last Post: Gribouillis
  Concatenate str JohnnyCoffee 2 2,971 May-01-2021, 03:58 PM
Last Post: JohnnyCoffee
  Two numpy arrays Sandra2312 1 1,838 Jan-18-2021, 06:10 PM
Last Post: paul18fr
  Save Numpy Array in Another Numpy Array (not Concatenate!) quest 1 1,896 Nov-06-2020, 01:06 PM
Last Post: quest
  numpy in1d with two simple arrays claw91 3 2,634 Sep-21-2020, 12:43 PM
Last Post: scidam
  Concatenate two dataframes moralear27 2 1,925 Sep-15-2020, 08:04 AM
Last Post: moralear27
  Type coercion with Numpy arrays Mark17 2 2,577 Jul-24-2020, 02:04 AM
Last Post: scidam
  filling and printing numpy arrays of str pjfarley3 4 3,389 Jun-07-2020, 09:09 PM
Last Post: pjfarley3

Forum Jump:

User Panel Messages

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