Skip to content

Commit

Permalink
IC class working in ETL API concept
Browse files Browse the repository at this point in the history
  • Loading branch information
Btibert3 committed May 13, 2019
1 parent 768927a commit 1abad55
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 200 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ Currently you can use:

- [x] example code to loop and build file, may need a function first
- [x] add WICHE dataset
- [x] review and consider classes for each survey (keep as functions for now)
- [x] classes are now more pythonic
- [x] add altair for viz
- [] decide on classes and if so, feature parity & update READMe
- [] go back on older surveys farther than standard naming syntax (hd is older than 2002)
16 changes: 11 additions & 5 deletions pypeds/ipeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,16 @@ class IC(object):
def __init__(self, years=[2017]):
"""Constructor"""
self.years = years
self.df = pd.DataFrame()

# testing
def get_test(self):
for year in self.years:
print(year)
# def _testyears(self):
# for year in self.years:
# print(year)


# method to get the data and return a dataframe
def get(self):
def extract(self):
# setup the df
init_df = pd.DataFrame({'pypeds_init': [True]})
for year in self.years:
Expand All @@ -289,4 +290,9 @@ def get(self):
pd.options.mode.chained_assignment = None
init_df = init_df.loc[init_df.pypeds_init != True, ]
init_df.drop(columns=['pypeds_init'], inplace=True)
return(init_df)
#return(init_df)
self.df = self.df.append(init_df, ignore_index = True)

# method to return the data
def load(self):
return(self.df)
Loading

0 comments on commit 1abad55

Please sign in to comment.