Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7538135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:02:31+00:00 2026-05-30T07:02:31+00:00

Several SciPy functions are documented as taking a condensed distance matrix as returned by

  • 0

Several SciPy functions are documented as taking a “condensed distance matrix as returned by scipy.spatial.distance.pdist“. Now, inspection shows that what pdist returns is the row-major 1D-array form of the upper off-diagonal part of the distance matrix. This is all well and good, and natural and obvious, but is it documented or defined anywhere? I’d rather not assume anything about a data structure that’ll suddenly change. (Granted, there isn’t a lot of things it could change to, but I guess one possibility would be to wrap the array in an object that allows matrix-like indexing.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T07:02:33+00:00Added an answer on May 30, 2026 at 7:02 am

    Honestly, this is a better question for the scipy users or dev list, as it’s about future plans for scipy.

    However, the structure is fairly rigorously documented in the docstrings for both scipy.spatial.pdist and in scipy.spatial.squareform.

    E.g. for pdist:

    Returns a condensed distance matrix Y.  For
        each :math:`i` and :math:`j` (where :math:`i<j<n`), the
        metric ``dist(u=X[i], v=X[j])`` is computed and stored in the
        :math:`ij`th entry.
    
        See ``squareform`` for information on how to calculate the index of
        this entry or to convert the condensed distance matrix to a
        redundant square matrix.
    

    Becuase of this, and the fact that so many other functions in scipy.spatial expect a distance matrix in this form, I’d seriously doubt it’s going to change without a number of depreciation warnings and announcements.

    Modules in scipy itself (as opposed to scipy’s scikits) are fairly stable, and there’s a great deal of consideration put into backwards compatibility when changes are made (and because of this, there’s quite a bit of legacy “cruft” in scipy: e.g. the fact that the core scipy module is just numpy with different defaults on a couple of functions.).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Several times now I've been faced with plans from a team that wants to
Several Linq.Enumerable functions take an IEqualityComparer<T> . Is there a convenient wrapper class that
Several of my ajax applications in the past have used GET request but now
Several times, while perusing the Boost library's documentation, I've run across return values that
Several times in my career, I have worked in a software group that determined
There is one thing, that I do not understand. Why does this import scipy
Several apps including the Facebook App shows an update-cell when the table is moved
Several parts (a WinForms app for exmaple) of my project use a DAL that
Several times I've seen mention that for asynchronous ping is good to use twisted.
Several times now, I've encountered this term in matlab, fortran ... some other ...

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.