Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added __pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified q01_rename_columns/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified q01_rename_columns/__pycache__/build.cpython-36.pyc
Binary file not shown.
13 changes: 13 additions & 0 deletions q01_rename_columns/build.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# %load q01_rename_columns/build.py
# default imports
import pandas as pd

def q01_rename_columns(path):
csv_data = pd.read_csv(path,skiprows=[1])
df = pd.DataFrame(csv_data,columns=['Country', '# Summer', 'Gold_Summer', 'Silver_Summer',
'Bronze_Summer', 'Total_Summer', '# Winter', 'Gold_Winter',
'Silver_Winter', 'Bronze_Winter', 'Total_Winter', '# Games',
'Gold_Total', 'Silver_Total', 'Bronze_Total', 'Total'])
return df

q01_rename_columns('./data/olympics.csv')





Binary file modified q01_rename_columns/tests/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified q01_rename_columns/tests/__pycache__/test.cpython-36.pyc
Binary file not shown.
Binary file modified q02_country_operations/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified q02_country_operations/__pycache__/build.cpython-36.pyc
Binary file not shown.
11 changes: 10 additions & 1 deletion q02_country_operations/build.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# %load q02_country_operations/build.py
# default imports
from greyatomlib.olympics_project_new.q01_rename_columns.build import q01_rename_columns
#Previous Functions
path = "./data/olympics.csv"
path = './data/olympics.csv'
OlympicsDF=q01_rename_columns(path)

def q02_country_operations(OlympicsDF):
OlympicsDF['Country_Name'] = OlympicsDF['Country']
OlympicsDF.iloc[100,16]='Portugal'
return OlympicsDF

q02_country_operations(OlympicsDF)





Expand Down
Binary file modified q02_country_operations/tests/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified q02_country_operations/tests/__pycache__/test.cpython-36.pyc
Binary file not shown.