Python Forum
Computing the distance between each pair of points
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Computing the distance between each pair of points
#7
It looks that this operation adds an axis to my array, turning it from 2D into 3D
X[:, np.newaxis, :]
Output:
array([[[0.37454012, 0.95071431]], [[0.73199394, 0.59865848]], [[0.15601864, 0.15599452]], [[0.05808361, 0.86617615]], [[0.60111501, 0.70807258]], [[0.02058449, 0.96990985]], [[0.83244264, 0.21233911]], [[0.18182497, 0.18340451]], [[0.30424224, 0.52475643]], [[0.43194502, 0.29122914]]])
Reply


Messages In This Thread
RE: Computing the distance between each pair of points - by Truman - Jun-17-2020, 10:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Cloud computing advice needed sawtooth500 3 607 Apr-18-2024, 09:23 PM
Last Post: sawtooth500
  How to most effectively unpack list of name-value pair dictionaries in a dataframe? zlim 1 797 Nov-07-2023, 10:56 PM
Last Post: zlim
  Could anyone help me get the jaccard distance between my dataframes please? :) a_real_phoenix 0 1,831 Jun-27-2019, 06:01 PM
Last Post: a_real_phoenix
  Converting days to years in loop while computing values across grid cells Lightning1800 2 2,728 May-15-2018, 08:44 PM
Last Post: Lightning1800
  Error in computing FFT operation raady07 1 4,405 Jan-18-2017, 08:30 AM
Last Post: j.crater

Forum Jump:

User Panel Messages

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