Python – Bray-Curtis distance between two 1-D arrays
scipy.stats.braycurtis(array, axis=0) function calculates the Bray-Curtis distance between two 1-D arrays.
array: Input array or object having the elements to calculate the distance between each pair of the two collections of inputs.
axis: Axis along which to be computed. By default axis = 0
Returns : distance between each pair of the two collections of inputs.
Code #1 : 1D Array
Value of braycurtis is : 0.14285714285714285
Code #2 : 2D Array
Value of braycurtis is : 0.5
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course