[Tutor] NumPy Generates ValueError: Some errors were detected ! Line #9 (got 42 columns instead of 1)

Stephen P. Molnar s.molnar at sbcglobal.net
Fri Sep 27 07:47:31 EDT 2019


0

I am writing code to combine text files and I have encountered an error 
that I am having trouble solving. Google is no help.

The code is:

|#!/usr/bin/env python3# -*- coding: utf-8 -*-""" Created on Thu Sep 26 
09:51:55 2019 @author: comp """importnumpy asnp NAME =input("Enter 
Molecule ID: ")NAME_IN =NAME+'_apo-1acl.RMSD'DATA =[]DATA 
=np.genfromtxt(NAME_IN,skip_header=8,dtype=None)|

The text file is:

|RMSD TABLE __________ 
_____________________________________________________________________ 
||||||Rank|Sub-|Run|Binding|Cluster|Reference|Grep|Rank||Energy|RMSD 
|RMSD 
|Pattern_____|______|______|___________|_________|_________________|___________ 
118-7.230.0093.07RANKING 129-6.791.3992.64RANKING 
2116-7.180.0093.19RANKING 312-6.930.0093.38RANKING 
3217-6.840.2393.45RANKING 4115-6.550.0091.83RANKING 
427-6.340.3391.77RANKING 515-6.410.0093.05RANKING 
613-6.360.0092.84RANKING 6210-6.280.4792.92RANKING 
636-6.270.4392.82RANKING 6418-6.250.3292.88RANKING 
6513-6.240.9692.75RANKING 661-6.240.8792.60RANKING 
6714-6.210.5192.90RANKING 6811-6.140.9892.78RANKING 
6920-6.110.7192.67RANKING 61019-6.011.3693.00RANKING 
7112-6.300.0093.28RANKING 814-5.850.0092.97RANKING 
_______________________________________________________________________|

and the error is:

|runfile('/home/comp/Apps/Models/1-PhosphorusLigands/CombinedLigands/MOL/Docking/Results/RMSDTable/CombineRMSDFiles.py') 
Enter Molecule ID: 13-7 13-7_apo-1acl.RMSD Traceback (most recent call 
last): File 
"/home/comp/Apps/Models/1-PhosphorusLigands/CombinedLigands/MOL/Docking/Results/RMSDTable/CombineRMSDFiles.py", 
line 15, in <module> DATA = np.genfromtxt(NAME_IN, dtype=None, 
skip_header=8) File 
"/home/comp/Apps/Miniconda3/lib/python3.7/site-packages/numpy/lib/npyio.py", 
line 2075, in genfromtxt raise ValueError(errmsg) ValueError: Some 
errors were detected ! Line #29 (got 1 columns instead of 7)|

At this point, I'm not even sure how to ask the question.

Thanks in advance.


-- 
Stephen P. Molnar, Ph.D.            Life is a fuzzy set
http://www.Molecular-Modeling.net   Multivariate and stochastic
614.312.7528 (c)
Skype:  smolnar1



More information about the Tutor mailing list