import csv


def read_csv_from_file(filename, path_name="."):
    """
    Read from .csv file

    Args:
        filename: filename of the destination with suffix example: "aaa.csv"
        path_name: path name of the destination example: "./MESH"
    Returns:
        data: data in the file
    """
    data = []
    assert filename.endswith(".csv"), "The filename is not ended with csv."
    with open(path_name + "/" + filename, newline='') as file:
        csv_reader = csv.reader(file, delimiter=',')
        for line in csv_reader:
            if line:
                line = [float(x) for x in line]
                data.append(line)
    return data