I have the following script where I utilize @click.option from the click library in Python. I want to know how to replace it with @click.argument without changing the output.
import sys
import click
import pandas as pd
from sklearn import metrics
@click.command()
@click.option('--filename')
# @click.argument('result.csv', type=click.Path(exists=True))
def main(filename):
df = pd.read_csv(filename)
y_test = df["actual"].values
y_pred = df["predicted"].values
print('R Squared: ' + str(metrics.r2_score(y_test, y_pred)))
if __name__ == '__main__':
sys.argv = ['', '--filename', 'result.csv']
main()