Answered>Order 4095

I am having trouble with the following code:

def data(file_1, columns):

  “””This function accepts the name of a .csv data file and a

    list of strings representing column headings in that file

    and return a dict object with each key being a column heading

    and the corresponding value being a numpy array of the values

    in that column of the data file.

  Args:

    filename: the name of a comma separated file containing the data

    filename: str

    columns: a list of column names in the file

    columns:  [str]

  Return:     

    This function will return a dictionary with column names as keys and column values as values

  “””

  dictionary = {}

  with open(filename) as f_in:

    values = np.array(columns)

    dictionary.append(columns, values)

 
"Not answered?"
Get the Answer