# -*- coding: utf-8 -*-
"""
Created on Sat May 22 16:58:44 2021

@author: PC
"""

import pandas as pd
import os

os.chdir(r'C:\Users\PC\Pytho')

df= pd.read_csv('NISPUF17.csv')

def proportion_of_education():
    df= pd.read_csv('NISPUF17.csv', index_col=0)
    result= {'less than high school': df['EDUC1'].value_counts()[1]/len(df),
             'high school' : df['EDUC1'].value_counts()[2]/len(df),
             'more than high school' : df['EDUC1'].value_counts()[3]/len(df),
             'college' : df['EDUC1'].value_counts()[4]/len(df)
             }
    return result
