<jupyter_start><jupyter_text>Imports<jupyter_code>import pandas as pd
import quiz_tests<jupyter_output><empty_output><jupyter_text>Quiz Solution<jupyter_code>def csv_to_close(csv_filepath, field_names):
    """Reads in data from a csv file and produces a DataFrame with close data.
    
    Parameters
    ----------
    csv_filepath : str
        The name of the csv file to read
    field_names : list of str
        The field names of the field in the csv file

    Returns
    -------
    close : DataFrame
        Close prices for each ticker and date
    """
    
    # TODO: Implement Function
    
    return pd.read_csv(csv_filepath, names=field_names).pivot(index='date', columns='ticker', values='close')


quiz_tests.test_csv_to_close(csv_to_close)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09240506329113925, 'fraction_numerical': 0.0, 'mean_word_length': 3.3701657458563536, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '275891', 'license': 'Apache-2.0', 'n_tokens_mistral': 262, 'n_tokens_neox': 252, 'n_words': 67, 'path': 'Quiz/m1_quant_basics/l2_stock_prices/stock_data_solution.ipynb', 'repo_name': 'scumabo/AI4Trading', 'size': '790'}