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 modified __pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified q01_load_data/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified q01_load_data/__pycache__/build.cpython-36.pyc
Binary file not shown.
12 changes: 11 additions & 1 deletion q01_load_data/build.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# %load q01_load_data/build.py
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split


def q01_load_data(path):
"write your solution here"
'write your solution here'
# use .read_csv function to read the
# data and header=0 to skip the first row
df = pd.read_csv(path, header=0)
header = df.iloc[0]
header[0] = 'country name'
df = df.iloc[1:,:]
df.columns = header
return df




Binary file modified q01_load_data/tests/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified q01_load_data/tests/__pycache__/test.cpython-36.pyc
Binary file not shown.
Binary file modified q02_rename_columns/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified q02_rename_columns/__pycache__/build.cpython-36.pyc
Binary file not shown.
13 changes: 11 additions & 2 deletions q02_rename_columns/build.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# %load q02_rename_columns/build.py
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from greyatomlib.olympics_project.q01_load_data.build import q01_load_data

def q02_rename_columns(path):
"write your solution here"
'write your solution here'
df = q01_load_data(path)


df = df.rename(columns={'01 !':'Gold', '02 !':'Silver', '03 !':'Bronze'})

return df





Binary file modified q02_rename_columns/tests/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified q02_rename_columns/tests/__pycache__/test.cpython-36.pyc
Binary file not shown.