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
9 changes: 8 additions & 1 deletion q01_read_csv_data_to_df/build.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# %load q01_read_csv_data_to_df/build.py
# Default Imports
import pandas as pd

# Path has been given to you already to use in function.
path = "data/ipl_dataset.csv"
path = 'data/ipl_dataset.csv'

# Solution
def read_csv_data_to_df(path):
return pd.read_csv(path)


read_csv_data_to_df('data/ipl_dataset.csv')


9 changes: 8 additions & 1 deletion q02_get_unique_values/build.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# %load q02_get_unique_values/build.py
from greyatomlib.pandas_project.q01_read_csv_data_to_df.build import read_csv_data_to_df
import pandas as pd

# You have been given the dataset already in 'ipl_df'.
ipl_df = read_csv_data_to_df("data/ipl_dataset.csv")
ipl_df = read_csv_data_to_df('data/ipl_dataset.csv')

#Solution
def get_unique_venues():
return ipl_df['venue'].unique()
get_unique_venues()


11 changes: 10 additions & 1 deletion q03_get_run_counts/build.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
# %load q03_get_run_counts/build.py
# Default Imports
from greyatomlib.pandas_project.q01_read_csv_data_to_df.build import read_csv_data_to_df

# You have been given the dataset already in 'ipl_df'.
ipl_df = read_csv_data_to_df("./data/ipl_dataset.csv")
ipl_df = read_csv_data_to_df('./data/ipl_dataset.csv')

# Solution
def get_run_counts():
return ipl_df['runs'].value_counts()




get_run_counts()


9 changes: 8 additions & 1 deletion q04_get_match_specific_df/build.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# %load q04_get_match_specific_df/build.py
from greyatomlib.pandas_project.q01_read_csv_data_to_df.build import read_csv_data_to_df
import pandas as pd

# You have been given dataset already in 'ipl_df'.
ipl_df = read_csv_data_to_df("./data/ipl_dataset.csv")
ipl_df = read_csv_data_to_df('./data/ipl_dataset.csv')

# Solution
def get_match_specific_df(match_code):
return ipl_df[(ipl_df['match_code'].astype(int) == match_code)]

get_match_specific_df(392203)