<div dir="ltr">Dear scipy-users:<div><br></div><div>I am trying to write a python program which uses SciPy library that makes hierarchical clustering.<br></div><div><br></div><div>After I type in my input at the "shell> " prompt:  <b>python SciPy_clustering.py </b><br></div><div><br></div><div>gives me the following error:</div><div><br></div><div><b>Segmentation fault (core dumped)</b><br></div><div><br></div><div>How can i fix this problem?</div><div><br></div><div>There is enough memory on my system (516 GB), python code uses just 21GB memory.</div><div><br></div><div>My dataset includes 73.622 data samples (rows)  and 22 features (columns). When i shrink dataset (31.000) it works fine correctly.</div><div><br></div><div>Thanks in Advance.</div><div><br></div><div><b>python Clustering Code:</b></div><div><div># needed imports</div><div>import numpy as np</div><div>import time</div><div>from matplotlib import pyplot as plt</div><div>from scipy.cluster.hierarchy import dendrogram, linkage</div><div>from scipy.cluster.hierarchy import cophenet</div><div>from scipy.spatial.distance import pdist</div><div><br></div><div>start_time = time.clock()</div><div><br></div><div>X=np.loadtxt(open("dataset.txt", "rb"), delimiter=";")</div><div><br></div><div>print ('\nX.shape')</div><div>print (X.shape)</div><div><br></div><div># generate the linkage matrix</div><div>Z = linkage(X, 'single')</div><div><br></div><div>np.savetxt('Z_output.txt', Z, fmt='%-7.5f')</div><div><br></div><div>c, coph_dists = cophenet(Z, pdist(X))</div><div><br></div><div>print("Cophenetic Correlation Coefficient : \n")</div><div>print(c)</div><div><br></div><div>print("\nRunning Time:")</div><div>print (time.clock() - start_time, "seconds")</div></div><div> </div></div>