Remove middle set of brackets inside numpy.ndarray

I have a numpy.ndarray that looks like this:

[[['37.7602,-122.4703' '37.7602,-122.4703']
['37.7602,-122.4703' '37.7941,-122.4078']
['37.7602,-122.4703' '37.8156,-122.284']
['37.7602,-122.4703' '37.8163,-122.2467']
['37.7602,-122.4703' '37.7599,-122.4148']
['37.7602,-122.4703' '37.8268,-122.2526']]

[['37.7941,-122.4078' '37.7602,-122.4703']
['37.7941,-122.4078' '37.7941,-122.4078']
['37.7941,-122.4078' '37.8156,-122.284']
['37.7941,-122.4078' '37.8163,-122.2467']
['37.7941,-122.4078' '37.7599,-122.4148']
['37.7941,-122.4078' '37.8268,-122.2526']]]

Is there an efficient way to remove the middle set of brackets so that it looks like this instead:

[['37.7602,-122.4703' '37.7602,-122.4703']
['37.7602,-122.4703' '37.7941,-122.4078']
['37.7602,-122.4703' '37.8156,-122.284']
['37.7602,-122.4703' '37.8163,-122.2467']
['37.7602,-122.4703' '37.7599,-122.4148']
['37.7602,-122.4703' '37.8268,-122.2526']
['37.7941,-122.4078' '37.7602,-122.4703']
['37.7941,-122.4078' '37.7941,-122.4078']
['37.7941,-122.4078' '37.8156,-122.284']
['37.7941,-122.4078' '37.8163,-122.2467']
['37.7941,-122.4078' '37.7599,-122.4148']
['37.7941,-122.4078' '37.8268,-122.2526']]

I imagine it can be done with looping, but I’m curious if there’s a non-loop way to do this, since I want my implementation to scale easily.

Thanks!

Answer

Just to formalize what Michael correctly said:

import numpy as np

array = np.array(
[[['37.7602,-122.4703', '37.7602,-122.4703'],
['37.7602,-122.4703', '37.7941,-122.4078'],
['37.7602,-122.4703', '37.8156,-122.284'],
['37.7602,-122.4703', '37.8163,-122.2467'],
['37.7602,-122.4703', '37.7599,-122.4148'],
['37.7602,-122.4703', '37.8268,-122.2526']],

[['37.7941,-122.4078', '37.7602,-122.4703'],
['37.7941,-122.4078', '37.7941,-122.4078'],
['37.7941,-122.4078', '37.8156,-122.284'],
['37.7941,-122.4078', '37.8163,-122.2467'],
['37.7941,-122.4078', '37.7599,-122.4148'],
['37.7941,-122.4078', '37.8268,-122.2526']]])

print(array)
array = array.reshape(-1,array.shape[2])
print(array)

Output:

[[['37.7602,-122.4703' '37.7602,-122.4703']
  ['37.7602,-122.4703' '37.7941,-122.4078']
  ['37.7602,-122.4703' '37.8156,-122.284']
  ['37.7602,-122.4703' '37.8163,-122.2467']
  ['37.7602,-122.4703' '37.7599,-122.4148']
  ['37.7602,-122.4703' '37.8268,-122.2526']]

 [['37.7941,-122.4078' '37.7602,-122.4703']
  ['37.7941,-122.4078' '37.7941,-122.4078']
  ['37.7941,-122.4078' '37.8156,-122.284']
  ['37.7941,-122.4078' '37.8163,-122.2467']
  ['37.7941,-122.4078' '37.7599,-122.4148']
  ['37.7941,-122.4078' '37.8268,-122.2526']]]
[['37.7602,-122.4703' '37.7602,-122.4703']
 ['37.7602,-122.4703' '37.7941,-122.4078']
 ['37.7602,-122.4703' '37.8156,-122.284']
 ['37.7602,-122.4703' '37.8163,-122.2467']
 ['37.7602,-122.4703' '37.7599,-122.4148']
 ['37.7602,-122.4703' '37.8268,-122.2526']
 ['37.7941,-122.4078' '37.7602,-122.4703']
 ['37.7941,-122.4078' '37.7941,-122.4078']
 ['37.7941,-122.4078' '37.8156,-122.284']
 ['37.7941,-122.4078' '37.8163,-122.2467']
 ['37.7941,-122.4078' '37.7599,-122.4148']
 ['37.7941,-122.4078' '37.8268,-122.2526']]