[SciPy-User] Segmentation fault (core dumped)
Sema Atasever
s.atasever at gmail.com
Thu Oct 12 09:34:31 EDT 2017
Dear scipy-users:
I am trying to write a python program which uses SciPy library that makes
hierarchical clustering.
After I type in my input at the "shell> " prompt: *python
SciPy_clustering.py *
gives me the following error:
*Segmentation fault (core dumped)*
How can i fix this problem?
There is enough memory on my system (516 GB), python code uses just 21GB
memory.
My dataset includes 73.622 data samples (rows) and 22 features (columns).
When i shrink dataset (31.000) it works fine correctly.
Thanks in Advance.
*python Clustering Code:*
# needed imports
import numpy as np
import time
from matplotlib import pyplot as plt
from scipy.cluster.hierarchy import dendrogram, linkage
from scipy.cluster.hierarchy import cophenet
from scipy.spatial.distance import pdist
start_time = time.clock()
X=np.loadtxt(open("dataset.txt", "rb"), delimiter=";")
print ('\nX.shape')
print (X.shape)
# generate the linkage matrix
Z = linkage(X, 'single')
np.savetxt('Z_output.txt', Z, fmt='%-7.5f')
c, coph_dists = cophenet(Z, pdist(X))
print("Cophenetic Correlation Coefficient : \n")
print(c)
print("\nRunning Time:")
print (time.clock() - start_time, "seconds")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-user/attachments/20171012/058be7d2/attachment-0001.html>
More information about the SciPy-User
mailing list