# -*- coding: utf-8 -*-

import csv


def list_of_lists_as_csv(lol, filename):
    
    with open(filename, "w", newline="\n") as f:
        writer = csv.writer(f)
        writer.writerows(lol)
    
    return

def read_last_csv_column(filename):
    
    labels = []
    with open(filename) as csvfile:
        spamreader = csv.reader(csvfile, delimiter=',')
        for row in spamreader:
            labels.append(row[-1])
    
    return labels
#
#def read_dataset(filename):
#    
#    dataset = []
#    with open(filename) as csvfile:
#        spamreader = csv.reader(csvfile, delimiter=',')
#        for row in spamreader:
#            dataset.append(row)
#    
#    return dataset
