title: How to calculate the Aitchison distance in python
body: <p>I have compositional data for which I would like to calculate the similarity. As input I have two 1D arrays such as:</p>
  <pre><code>data1=[0.03510584946878486, 0.09929433687476773, 0.049647168437383864, 0.03510584946878486, 0.01755292473439243, 0.07021169893756972, 0.07021169893756972, 0.024823584218691932, 0.03510584946878486, 0.01755292473439243, 0.024823584218691932, 0.2808467957502789, 0.03510584946878486, 0.01755292473439243, 0.03510584946878486, 0.049647168437383864, 0.03510584946878486, 0.01755292473439243, 0.024823584218691932, 0.024823584218691932]
  
  data2=[0.036891382048211505, 0.29513105638569204, 0.05217229282726804, 0.02608614641363402, 0.018445691024105752, 0.07378276409642301, 0.05217229282726804, 0.02608614641363402, 0.05217229282726804, 0.018445691024105752, 0.02608614641363402, 0.10434458565453608, 0.036891382048211505, 0.018445691024105752, 0.02608614641363402, 0.036891382048211505, 0.036891382048211505, 0.018445691024105752, 0.02608614641363402, 0.018445691024105752]
  </code></pre>
  <p>These can be thought of as two different conditions, each with its own probability-per-category. From reading around it seems like Aitchison distance is most appropriate for calculating how similar these are, although I might be wrong. It doesn't seem like Scipy has anything implemented for it. Does anyone know how to do it or have thoughts on how to best compare compositional data?</p>