+2 votes
in Programming Languages by (74.2k points)

I am getting error "AttributeError: 'Namespace' object has no attribute 'rfileTr'" for the following code. What's wrong in the code?

 parser = argparse.ArgumentParser(description='Find what percentage of PID are common in R and Python predictions')
 parser.add_argument('--rTr', required=True, help='R classification results file for training data')
 parser.add_argument('--rPr', required=True, help='R classification results file for prediction data')
 parser.add_argument("-v", "--verbose", action="count", default=0, help="verbosity")
 

1 Answer

+1 vote
by (349k points)
selected by
 
Best answer

You don't have 'rfileTr' as an argument in your ArgumentParser. It seems that you have used 'rTr' instead of 'rfileTr'.

Change

parser.add_argument('--rTr', required=True, help='R classification results file for training data')

to

parser.add_argument('--rfileTr', required=True, help='R classification results file for training data')

This should fix the error.


...