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
8 changes: 8 additions & 0 deletions q01_zeros_array/build.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# %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

array_zeros()




9 changes: 9 additions & 0 deletions q02_zeros_reshaped/build.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# %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
def array_reshaped_zeros():
zeros_array = np.zeros((3,4,2))
zeros_array_reshaped = zeros_array.reshape((2,3,4))
return zeros_array_reshaped

array_reshaped_zeros()


13 changes: 12 additions & 1 deletion q03_create_3d_array/build.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# %load q03_create_3d_array/build.py
# Default Imports
import numpy as np

# Enter solution here
# Enter solution here
def create_3d_array():
N= 27
a=np.arange(N).reshape(3,3,3)
#print(a)
return a

create_3d_array()



17 changes: 14 additions & 3 deletions q04_read_csv_data_to_ndarray/build.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Default Imports
# %load q04_read_csv_data_to_ndarray/build.py
import numpy as np
path = "./data/ipl_matches_small.csv"
path = './data/ipl_matches_small.csv'
dtype = float
def read_csv_data_to_ndarray():
my_data = np.genfromtxt(path,dtype=dtype,skip_header =1,delimiter=',')
return my_data

read_csv_data_to_ndarray()

# Enter code here

T



# Enter code here
12 changes: 11 additions & 1 deletion q05_read_csv_data/build.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# %load q05_read_csv_data/build.py
# Default imports
import numpy as np
path = './data/ipl_matches_small.csv'
dtype = float
def read_ipl_data_csv(path,dtype):
ipl_array = np.genfromtxt(path,dtype=dtype,skip_header=1,delimiter=',')
return ipl_array


# Enter code here



# Enter code here