import pandas as pd
import sys
import pathlib


def main():
    input_file = sys.argv[1]
    assert pathlib.Path(input_file).suffix == ".csv", "Input needs to be a .csv file"

    input_df = pd.read_csv(input_file)
    output_df = input_df.copy()
    output_df["u_opt_2"] = 1 / input_df["u_opt_2"]
    output_df.to_csv("./output.csv")


if __name__ == "__main__":
    assert len(sys.argv) > 1, "Need filename of the file to preprocess."
    main()
