Re: [Tutor] Euclidean Distances between Atoms in a Molecule.

2017-04-05 Thread Sergio Rojas
-- Message: 2 Date: Mon, 03 Apr 2017 11:36:10 +0200 From: Peter Otten <__pete...@web.de> To: tutor@python.org Subject: Re: [Tutor] Euclidean Distances between Atoms in a Molecule. Message-ID: <obt525$ths$1...@blaine.gmane.org> Content-Type: text/plain;

Re: [Tutor] Euclidean Distances between Atoms in a Molecule.

2017-04-03 Thread Stephen P. Molnar
On 04/03/2017 05:36 AM, Peter Otten wrote: Stephen P. Molnar wrote: I am trying to port a program that I wrote in FORTRAN twenty years ago into Python 3 and am having a hard time trying to calculate the Euclidean distance between each atom in the molecule and every other atom in the molecule.

Re: [Tutor] Euclidean Distances between Atoms in a Molecule.

2017-04-03 Thread Peter Otten
Stephen P. Molnar wrote: > I am trying to port a program that I wrote in FORTRAN twenty years ago > into Python 3 and am having a hard time trying to calculate the > Euclidean distance between each atom in the molecule and every other > atom in the molecule. > > Here is a typical table of

Re: [Tutor] Euclidean Distances between Atoms in a Molecule.

2017-04-03 Thread Asurin
Dr. Molnar: This might be your solution: >>> import numpy >>> a = numpy.array((-3.265636, 0.198894, 0.090858)) >>> b = numpy.array((-1.307161, 1.522212, 1.003463)) >>> dist = numpy.linalg.norm(a-b) >>> dist 2.5337013913983633 >>> Qiao Qiao > On Apr 2, 2017, at 1:41 PM, Stephen P. Molnar

Re: [Tutor] Euclidean Distances between Atoms in a Molecule.

2017-04-03 Thread Matt Ruffalo
Hi Stephen- The `scipy.spatial.distance` module (part of the SciPy package) contains what you will need -- specifically, the `scipy.spatial.distance.pdist` function, which takes a matrix of m observations in n-dimensional space, and returns a condensed distance matrix as described in

Re: [Tutor] Euclidean Distances between Atoms in a Molecule.

2017-04-02 Thread Steven D'Aprano
On Sun, Apr 02, 2017 at 01:41:27PM -0400, Stephen P. Molnar wrote: > I am trying to port a program that I wrote in FORTRAN twenty years ago > into Python 3 and am having a hard time trying to calculate the > Euclidean distance between each atom in the molecule and every other > atom in the

Re: [Tutor] Euclidean Distances between Atoms in a Molecule.

2017-04-02 Thread Alan Gauld via Tutor
On 02/04/17 18:41, Stephen P. Molnar wrote: > I am trying to port a program that I wrote in FORTRAN twenty years ago > into Python 3 and am having a hard time trying to calculate the > Euclidean distance between each atom in the molecule and every other > atom in the molecule. Sounds highly