image_output_1.png
import csv

import matplotlib.pyplot as plt

def function_general(file_name):
    wav = []
    absr = []
    d = {}
    with open(file_name, 'r') as df:
        reader = csv.reader(df)
        header = next(reader)
        print(header)
        for row in reader:
            d[float(row[0])] = float(row[1])
            wav.append(float(row[0]))
            absr.append(float(row[1]))
    plt.plot(wav, absr)
    plt.ylabel('Absortion')
    plt.xlabel('Wavelength')
function_general('../input/spectra-files/50.csv')