From 6ad1e2d0578758c490b49e08c0a537d225cd54d1 Mon Sep 17 00:00:00 2001 From: avdeshmishra0214 Date: Sat, 8 Sep 2018 11:14:11 +0000 Subject: [PATCH 1/5] Done --- q01_zeros_array/build.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/q01_zeros_array/build.py b/q01_zeros_array/build.py index 5501f7a..4ae1cc8 100644 --- a/q01_zeros_array/build.py +++ b/q01_zeros_array/build.py @@ -1,8 +1,15 @@ +# %load q01_zeros_array/build.py # Default Imports import sys, os sys.path.append(os.path.join(os.path.dirname(os.curdir), '..' )) import numpy as np - # Your solution +def array_zeros(): + zeros_array= np.zeros((3,4,2)) + return zeros_array + + + + From b9ab1e269b3c6a3bd33e55bf60488e91c01318e6 Mon Sep 17 00:00:00 2001 From: avdeshmishra0214 Date: Sat, 8 Sep 2018 11:34:25 +0000 Subject: [PATCH 2/5] Done --- q02_zeros_reshaped/build.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/q02_zeros_reshaped/build.py b/q02_zeros_reshaped/build.py index ed629c7..bc8348c 100644 --- a/q02_zeros_reshaped/build.py +++ b/q02_zeros_reshaped/build.py @@ -1,5 +1,11 @@ +# %load q02_zeros_reshaped/build.py # Default imports import numpy as np from greyatomlib.python_intermediate.q01_zeros_array.build import array_zeros - # Write your code +zeros_array = np.zeros((3,4,2)) +def array_reshaped_zeros(): + zeros_array_reshaped = zeros_array.reshape(2,3,4) + return zeros_array_reshaped + + From 4ffc8d9e5e608dec5b7ce74be5f1ebae6773fd03 Mon Sep 17 00:00:00 2001 From: avdeshmishra0214 Date: Sun, 9 Sep 2018 03:58:19 +0000 Subject: [PATCH 3/5] Done --- q03_create_3d_array/build.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/q03_create_3d_array/build.py b/q03_create_3d_array/build.py index 7bb6e2f..94cdd8a 100644 --- a/q03_create_3d_array/build.py +++ b/q03_create_3d_array/build.py @@ -1,4 +1,12 @@ +# %load q03_create_3d_array/build.py # Default Imports import numpy as np -# Enter solution here \ No newline at end of file +# Enter solution here + +def create_3d_array(): + arr = np.arange(27).reshape(3,3,3) + N = np.size(arr) + return arr + + From e6913ad78b4a286dbaad7116c955c46705bcd7c6 Mon Sep 17 00:00:00 2001 From: avdeshmishra0214 Date: Sun, 7 Oct 2018 17:15:17 +0000 Subject: [PATCH 4/5] Done --- q04_read_csv_data_to_ndarray/build.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/q04_read_csv_data_to_ndarray/build.py b/q04_read_csv_data_to_ndarray/build.py index fb71e6e..aff4778 100644 --- a/q04_read_csv_data_to_ndarray/build.py +++ b/q04_read_csv_data_to_ndarray/build.py @@ -1,5 +1,12 @@ +# %load q04_read_csv_data_to_ndarray/build.py # Default Imports import numpy as np -path = "./data/ipl_matches_small.csv" +path = './data/ipl_matches_small.csv' + +# Enter code here +def read_csv_data_to_ndarray(path,dtype): + return (np.genfromtxt(path, delimiter=',', dtype=dtype,skip_header=1)) + + + -# Enter code here \ No newline at end of file From ff3ea736af6382032c36a6a4abc9a3f9e529e420 Mon Sep 17 00:00:00 2001 From: avdeshmishra0214 Date: Sun, 7 Oct 2018 17:31:26 +0000 Subject: [PATCH 5/5] Done --- q05_read_csv_data/build.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/q05_read_csv_data/build.py b/q05_read_csv_data/build.py index 5c70e6e..60b2c39 100644 --- a/q05_read_csv_data/build.py +++ b/q05_read_csv_data/build.py @@ -1,4 +1,13 @@ +# %load q05_read_csv_data/build.py # Default imports import numpy as np -# Enter code here \ No newline at end of file + +# Enter code here +def read_ipl_data_csv(path,dtype): + ipl_matches_array = np.genfromtxt(path,delimiter=',',dtype=dtype,skip_header=1) + print(type(ipl_matches_array)) + return (ipl_matches_array) +read_ipl_data_csv('data/ipl_matches_small.csv', dtype='|S50') + +