title: Python: "AttributeError: 'Namespace' object has no attribute" argparse
body: <p>My code looks like this:</p>
  
  <pre><code>parser.add_argument('-i', '--input', help='Input path/to/file.csv', required=True)
  parser.add_argument('-oh', '--output-html', help='Output path/to/confusion_matrix.html', required=True)
  parser.add_argument('-oc', '--output-csv', help='Output path/to/confusion_matrix.csv', required=True)
  args = parser.parse_args()
  
  ....
  
  y_true = pd.Series(true_data, name="Actual")
  y_pred = pd.Series(pred_data, name="Predicted")
  df_confusion = pd.crosstab(y_true, y_pred)
  df_confusion.to_html(args.output-html)
  df_confusion.to_csv(args.output-csv)
  </code></pre>
  
  <p>When i try to run it, it gives me this error:</p>
  
  <pre><code>df_confusion.to_html(args.output-html)
  AttributeError: 'Namespace' object has no attribute 'output'
  </code></pre>
  
  <p>However, if i change from</p>
  
  <pre><code>df_confusion.to_html(args.output-html)
  </code></pre>
  
  <p>To </p>
  
  <pre><code>df_confusion.to_html(args.output)
  </code></pre>
  
  <p>It works as it should. Can anyone explain why it doesn't work, and how can i make it work with args.output-html?</p>