import math
import matplotlib.pyplot as plt

def display_menu():
    print("""
    Select data to aanlyze
    (C)lose
    (O)pen
    (H)igh
    (L)ow
    (P)ercent Change
    """)
def descriptives(data):
    """mean =
    std =
    pct_25 ="""
    pass
columns = {'C' : close, 'O': opening, 'H' : high,
           'L' : low, 'P': pct_change }
def main():
    file = input('Enter a file name: ') + '.csv'
    f = open('file', 'r')
    header = f.readline()
    data = f.readlines()
    close =[]
    opening = []
    high = []
    low = []
    pct_change = []
    for row in data:
        row = row.strip().split(',')
        close.append(float(row[1]))
        opening.append(float(row[2]))
        high.append(float(row[3]))
        low.append(float(row[4]))
        pct_change.append(float(row[6][:-1]))
   while True:
       display_menu()
       choice = input("Your selection: ")
       if choice == '':
           break
       descriptives(columns[choice])
   plt.plot(columns[choice])
   plt.show()
   plt.hist(columns['P'], bins= 30, edgecolor='w')



if __name__ == "__main__":
    main()