# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# + [markdown] id="view-in-github" colab_type="text"
# <a href="https://colab.research.google.com/github/alpha9934/GUVI_D20_Assingments/blob/master/Numpy_tasks.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>

# + [markdown] id="vfS7d-Bk5BKg"
# # Numpy
#
#

# + [markdown] id="QPTSGEXa5BKm"
# #### 1. Import the numpy package under the name `np` (★☆☆) 
# (**hint**: import … as …)

# + id="3S3kqPne5BKn"


# + [markdown] id="tGz2jwO65BKo"
# #### 2. Print the numpy version and the configuration (★☆☆) 
# (**hint**: np.\_\_version\_\_, np.show\_config)

# + id="DpqAFrFk5BKp"


# + [markdown] id="eAvVcEol5BKq"
# #### 3. Create a null vector of size 10 (★☆☆) 
# (**hint**: np.zeros)

# + id="1rHTaYbh5BKr"


# + [markdown] id="eolnc8_N5BKs"
# #### 4.  How to find the memory size of any array (★☆☆) 
# (**hint**: size, itemsize)

# + id="G-Hs6YiO5BKt"


# + [markdown] id="RMAKRt2t5BKt"
# #### 5.  How to get the documentation of the numpy add function from the command line? (★☆☆) 
# (**hint**: np.info)

# + id="6iUe5g_S5BKu"


# + [markdown] id="JdSYicnE5BKu"
# #### 6.  Create a null vector of size 10 but the fifth value which is 1 (★☆☆) 
# (**hint**: array\[4\])

# + id="EkI9O88N5BKu"


# + [markdown] id="9QLL9Flt5BKv"
# #### 7.  Create a vector with values ranging from 10 to 49 (★☆☆) 
# (**hint**: np.arange)

# + id="fRr7X3kN5BKv"


# + [markdown] id="6ezQrRl65BKw"
# #### 8.  Reverse a vector (first element becomes last) (★☆☆) 
# (**hint**: array\[::-1\])

# + id="mNAKsjU75BKw"


# + [markdown] id="BBKmuh2r5BKx"
# #### 9.  Create a 3x3 matrix with values ranging from 0 to 8 (★☆☆) 
# (**hint**: reshape)

# + id="9Yh_ADwB5BKx"


# + [markdown] id="43lmfH6u5BKx"
# #### 10. Find indices of non-zero elements from \[1,2,0,0,4,0\] (★☆☆) 
# (**hint**: np.nonzero)

# + id="gDkcvxBQ5BKy"


# + [markdown] id="pP30xGnq5BKy"
# #### 11. Create a 3x3 identity matrix (★☆☆) 
# (**hint**: np.eye)

# + id="QtzEOSWd5BKy"


# + [markdown] id="cFKbPlBB5BKz"
# #### 12. Create a 3x3x3 array with random values (★☆☆) 
# (**hint**: np.random.random)

# + id="8l7pR3Jn5BKz"


# + [markdown] id="LHJfon1l5BKz"
# #### 13. Create a 10x10 array with random values and find the minimum and maximum values (★☆☆) 
# (**hint**: min, max)

# + id="63fAO0o-5BKz"


# + [markdown] id="Rx7k59Ut5BKz"
# #### 14. Create a random vector of size 30 and find the mean value (★☆☆) 
# (**hint**: mean)

# + id="iAqCFuR55BK0"


# + [markdown] id="IXumlGSL5BK0"
# #### 15. Create a 2d array with 1 on the border and 0 inside (★☆☆) 
# (**hint**: array\[1:-1, 1:-1\])

# + id="ihcyv4xy5BK1"


# + [markdown] id="OfbKWzO95BK2"
# #### 16. How to add a border (filled with 0's) around an existing array? (★☆☆) 
# (**hint**: np.pad)

# + id="QLlUlnoW5BK2"


# + [markdown] id="pB8nhpUa5BK2"
# #### 17. What is the result of the following expression? (★☆☆) 
# (**hint**: NaN = not a number, inf = infinity)

# + [markdown] id="UGRRxEc75BK3"
# ```python
# 0 * np.nan
# np.nan == np.nan
# np.inf > np.nan
# np.nan - np.nan
# 0.3 == 3 * 0.1
# ```

# + id="GqEETC0l5BK3"


# + [markdown] id="OdrD9I9m5BK4"
# #### 18. Create a 5x5 matrix with values 1,2,3,4 just below the diagonal (★☆☆) 
# (**hint**: np.diag)

# + id="ZsuDPCGJ5BK4"


# + [markdown] id="k48duux25BK4"
# #### 19. Create a 8x8 matrix and fill it with a checkerboard pattern (★☆☆) 
# (**hint**: array\[::2\])

# + id="FWC1qFMn5BK5"


# + [markdown] id="0HeNisJa5BK5"
# #### 20. Consider a (6,7,8) shape array, what is the index (x,y,z) of the 100th element? 
# (**hint**: np.unravel_index)

# + id="wzVF17Cd5BK5"


# + [markdown] id="O12qhInz5BK6"
# #### 21. Create a checkerboard 8x8 matrix using the tile function (★☆☆) 
# (**hint**: np.tile)

# + id="qOaCvcsj5BK6"


# + [markdown] id="NsDAOMPn5BK6"
# #### 22. Normalize a 5x5 random matrix (★☆☆) 
# (**hint**: (x - min) / (max - min))

# + id="vWVEtYNi5BK6"


# + [markdown] id="sWskj-cb5BK6"
# #### 23. Create a custom dtype that describes a color as four unsigned bytes (RGBA) (★☆☆) 
# (**hint**: np.dtype)

# + id="5UXaaYcg5BK7"


# + [markdown] id="Zx-AyQTm5BK7"
# #### 24. Multiply a 5x3 matrix by a 3x2 matrix (real matrix product) (★☆☆) 
# (**hint**: np.dot | @)

# + id="rq-ejSlb5BK7"


# + [markdown] id="jTBJRNJE5BK7"
# #### 25. Given a 1D array, negate all elements which are between 3 and 8, in place. (★☆☆) 
# (**hint**: >, <=)

# + id="W5NYHxYw5BK7"


# + [markdown] id="h_UhQRsB5BK7"
# #### 26. What is the output of the following script? (★☆☆) 
# (**hint**: np.sum)

# + [markdown] id="FBxdV-rJ5BK8"
# ```python
# # Author: <NAME>
#
# print(sum(range(5),-1))
# from numpy import *
# print(sum(range(5),-1))
# ```

# + id="WnlXltYi5BK8"


# + [markdown] id="HxhV8DM_5BK8"
# #### 27. Consider an integer vector Z, which of these expressions are legal? (★☆☆)

# + [markdown] id="dFCiJZZV5BK8"
# ```python
# Z**Z
# 2 << Z >> 2
# Z <- Z
# 1j*Z
# Z/1/1
# Z<Z>Z
# ```

# + id="YY32J3AN5BK8"


# + [markdown] id="a4xzdOi75BK9"
# #### 28. What are the result of the following expressions?

# + [markdown] id="rbMyDxNa5BK9"
# ```python
# np.array(0) / np.array(0)
# np.array(0) // np.array(0)
# np.array([np.nan]).astype(int).astype(float)
# ```

# + id="HPRj1j4v5BK9"


# + [markdown] id="oATj8L5b5BK9"
# #### 29. How to round away from zero a float array ? (★☆☆) 
# (**hint**: np.uniform, np.copysign, np.ceil, np.abs)

# + id="NttTG8zL5BK-"


# + [markdown] id="636YGPGP5BK-"
# #### 30. How to find common values between two arrays? (★☆☆) 
# (**hint**: np.intersect1d)

# + id="ECSBtbge5BK-"


# + [markdown] id="jn8T8STq5BK-"
# #### 31. How to ignore all numpy warnings (not recommended)? (★☆☆) 
# (**hint**: np.seterr, np.errstate)

# + id="7YszQGvi5BK-"


# + [markdown] id="6_Jqei1J5BK_"
# #### 32. Is the following expressions true? (★☆☆) 
# (**hint**: imaginary number)

# + [markdown] id="FgyZMmth5BK_"
# ```python
# np.sqrt(-1) == np.emath.sqrt(-1)
# ```

# + id="34ygKtuc5BK_"


# + [markdown] id="-y_VtKvS5BK_"
# #### 33. How to get the dates of yesterday, today and tomorrow? (★☆☆) 
# (**hint**: np.datetime64, np.timedelta64)

# + id="y2wK8sWA5BK_"


# + [markdown] id="bs58dbt65BK_"
# #### 34. How to get all the dates corresponding to the month of July 2016? (★★☆) 
# (**hint**: np.arange(dtype=datetime64\['D'\]))

# + id="0yMUTjTo5BLA"


# + [markdown] id="2aRrpX-65BLA"
# #### 35. How to compute ((A+B)\*(-A/2)) in place (without copy)? (★★☆) 
# (**hint**: np.add(out=), np.negative(out=), np.multiply(out=), np.divide(out=))

# + id="hMGX3Fbx5BLA"


# + [markdown] id="AENJm1t15BLA"
# #### 36. Extract the integer part of a random array using 5 different methods (★★☆) 
# (**hint**: %, np.floor, np.ceil, astype, np.trunc)

# + id="WEXucQzx5BLA"


# + [markdown] id="7ltmKtzb5BLA"
# #### 37. Create a 5x5 matrix with row values ranging from 0 to 4 (★★☆) 
# (**hint**: np.arange)

# + id="IPXdP2T05BLA"


# + [markdown] id="GDdgbLbw5BLB"
# #### 38. Consider a generator function that generates 10 integers and use it to build an array (★☆☆) 
# (**hint**: np.fromiter)

# + id="OTVOLZ8w5BLB"


# + [markdown] id="udyAiWIf5BLB"
# #### 39. Create a vector of size 10 with values ranging from 0 to 1, both excluded (★★☆) 
# (**hint**: np.linspace)

# + id="wYXvWpSq5BLB"


# + [markdown] id="dVuj6sVD5BLB"
# #### 40. Create a random vector of size 10 and sort it (★★☆) 
# (**hint**: sort)

# + id="rjOqMzFY5BLB"


# + [markdown] id="WyExY9GI5BLB"
# #### 41. How to sum a small array faster than np.sum? (★★☆) 
# (**hint**: np.add.reduce)

# + id="TVqjBvJe5BLC"


# + [markdown] id="0CNBVCgy5BLC"
# #### 42. Consider two random array A and B, check if they are equal (★★☆) 
# (**hint**: np.allclose, np.array\_equal)

# + id="eBRHW-Fb5BLC"


# + [markdown] id="vX4ASM_U5BLC"
# #### 43. Make an array immutable (read-only) (★★☆) 
# (**hint**: flags.writeable)

# + id="8Luf6p6X5BLC"


# + [markdown] id="wz_q7mvX5BLC"
# #### 44. Consider a random 10x2 matrix representing cartesian coordinates, convert them to polar coordinates (★★☆) 
# (**hint**: np.sqrt, np.arctan2)

# + id="bhyAJ1lS5BLC"


# + [markdown] id="ivqVz7Px5BLD"
# #### 45. Create random vector of size 10 and replace the maximum value by 0 (★★☆) 
# (**hint**: argmax)

# + id="9rM8l1lC5BLD"


# + [markdown] id="BEsN2u-q5BLD"
# #### 46. Create a structured array with `x` and `y` coordinates covering the \[0,1\]x\[0,1\] area (★★☆) 
# (**hint**: np.meshgrid)

# + id="-bVP-TiB5BLD"


# + [markdown] id="PpsWrCM95BLD"
# ####  47. Given two arrays, X and Y, construct the Cauchy matrix C (Cij =1/(xi - yj)) 
# (**hint**: np.subtract.outer)

# + id="j9tvJD1c5BLD"


# + [markdown] id="jY2MvtTc5BLE"
# #### 48. Print the minimum and maximum representable value for each numpy scalar type (★★☆) 
# (**hint**: np.iinfo, np.finfo, eps)

# + id="bJRLV0EU5BLE"


# + [markdown] id="A9hjbivt5BLE"
# #### 49. How to print all the values of an array? (★★☆) 
# (**hint**: np.set\_printoptions)

# + id="HG0m3-Rt5BLE"


# + [markdown] id="mGmEqgyw5BLE"
# #### 50. How to find the closest value (to a given scalar) in a vector? (★★☆) 
# (**hint**: argmin)

# + id="9RNOcMa45BLF"


# + [markdown] id="eGensMpI5BLF"
# #### 51. Create a structured array representing a position (x,y) and a color (r,g,b) (★★☆) 
# (**hint**: dtype)

# + id="ok1_40-R5BLF"


# + [markdown] id="Z-5YGchS5BLG"
# #### 52. Consider a random vector with shape (100,2) representing coordinates, find point by point distances (★★☆) 
# (**hint**: np.atleast\_2d, T, np.sqrt)

# + id="IeLOXtu35BLG"


# + [markdown] id="1Bf5rIn35BLG"
# #### 53. How to convert a float (32 bits) array into an integer (32 bits) in place? 
# (**hint**: astype(copy=False))

# + id="MK45d_X25BLH"


# + [markdown] id="Os2oCBa_5BLH"
# #### 54. How to read the following file? (★★☆) 
# (**hint**: np.genfromtxt)

# + [markdown] id="gD6M0HZQ5BLH"
# ```
# 1, 2, 3, 4, 5
# 6,  ,  , 7, 8
#  ,  , 9,10,11
# ```

# + id="NaRGceNF5BLH"


# + [markdown] id="v_qLSz-a5BLH"
# #### 55. What is the equivalent of enumerate for numpy arrays? (★★☆) 
# (**hint**: np.ndenumerate, np.ndindex)

# + id="NW-B8cDG5BLH"


# + [markdown] id="Jn5Gbo0G5BLH"
# #### 56. Generate a generic 2D Gaussian-like array (★★☆) 
# (**hint**: np.meshgrid, np.exp)

# + id="e2ERmC4_5BLI"


# + [markdown] id="rhua5zO15BLI"
# #### 57. How to randomly place p elements in a 2D array? (★★☆) 
# (**hint**: np.put, np.random.choice)

# + id="wsx8StMf5BLI"


# + [markdown] id="PZcZctkX5BLI"
# #### 58. Subtract the mean of each row of a matrix (★★☆) 
# (**hint**: mean(axis=,keepdims=))

# + id="jLQuIM0b5BLI"


# + [markdown] id="OXNNi3NM5BLI"
# #### 59. How to sort an array by the nth column? (★★☆) 
# (**hint**: argsort)

# + id="xFicKIOJ5BLI"


# + [markdown] id="tGcCKGW15BLJ"
# #### 60. How to tell if a given 2D array has null columns? (★★☆) 
# (**hint**: any, ~)

# + id="W801Mc6l5BLJ"


# + [markdown] id="lZoTwSfj5BLJ"
# #### 61. Find the nearest value from a given value in an array (★★☆) 
# (**hint**: np.abs, argmin, flat)

# + id="xYYOWsnR5BLK"


# + [markdown] id="MzJ_ydop5BLK"
# #### 62. Considering two arrays with shape (1,3) and (3,1), how to compute their sum using an iterator? (★★☆) 
# (**hint**: np.nditer)

# + id="4kcw5qvA5BLK"


# + [markdown] id="BYzheTmg5BLK"
# #### 63. Create an array class that has a name attribute (★★☆) 
# (**hint**: class method)

# + id="cxBmsHrV5BLK"


# + [markdown] id="nSpTGMYW5BLL"
# #### 64. Consider a given vector, how to add 1 to each element indexed by a second vector (be careful with repeated indices)? (★★★) 
# (**hint**: np.bincount | np.add.at)

# + id="DdswqL-o5BLL"


# + [markdown] id="4ZQWEB2q5BLL"
# #### 65. How to accumulate elements of a vector (X) to an array (F) based on an index list (I)? (★★★) 
# (**hint**: np.bincount)

# + id="kvkivJix5BLL"


# + [markdown] id="Gq4KVLwR5BLL"
# #### 66. Considering a (w,h,3) image of (dtype=ubyte), compute the number of unique colors (★★★) 
# (**hint**: np.unique)

# + id="l_AHCNsM5BLL"


# + [markdown] id="27thWlkg5BLL"
# #### 67. Considering a four dimensions array, how to get sum over the last two axis at once? (★★★) 
# (**hint**: sum(axis=(-2,-1)))

# + id="KG_qN_tz5BLM"


# + [markdown] id="GAUvyvOT5BLM"
# #### 68. Considering a one-dimensional vector D, how to compute means of subsets of D using a vector S of same size describing subset  indices? (★★★) 
# (**hint**: np.bincount)

# + id="cFzgQXEK5BLM"


# + [markdown] id="HHbBJvX95BLM"
# #### 69. How to get the diagonal of a dot product? (★★★) 
# (**hint**: np.diag)

# + id="mpXhteKE5BLN"


# + [markdown] id="SNRmPITF5BLN"
# #### 70. Consider the vector \[1, 2, 3, 4, 5\], how to build a new vector with 3 consecutive zeros interleaved between each value? (★★★) 
# (**hint**: array\[::4\])

# + id="3cpCRNkz5BLN"


# + [markdown] id="oqV-1WJo5BLN"
# #### 71. Consider an array of dimension (5,5,3), how to mulitply it by an array with dimensions (5,5)? (★★★) 
# (**hint**: array\[:, :, None\])

# + id="zKTO8_gK5BLO"


# + [markdown] id="Io06tEo75BLO"
# #### 72. How to swap two rows of an array? (★★★) 
# (**hint**: array\[\[\]\] = array\[\[\]\])

# + id="J9gjyyNn5BLO"


# + [markdown] id="xsRd-qxP5BLO"
# #### 73. Consider a set of 10 triplets describing 10 triangles (with shared vertices), find the set of unique line segments composing all the  triangles (★★★) 
# (**hint**: repeat, np.roll, np.sort, view, np.unique)

# + id="UjUxGQ5J5BLP"


# + [markdown] id="mNVhanKi5BLP"
# #### 74. Given an array C that is a bincount, how to produce an array A such that np.bincount(A) == C? (★★★) 
# (**hint**: np.repeat)

# + id="lw76zdjv5BLP"


# + [markdown] id="c1l-LKgB5BLQ"
# #### 75. How to compute averages using a sliding window over an array? (★★★) 
# (**hint**: np.cumsum)

# + id="OSNgd7655BLQ"


# + [markdown] id="9vf708Io5BLQ"
# #### 76. Consider a one-dimensional array Z, build a two-dimensional array whose first row is (Z\[0\],Z\[1\],Z\[2\]) and each subsequent row is  shifted by 1 (last row should be (Z\[-3\],Z\[-2\],Z\[-1\]) (★★★) 
# (**hint**: from numpy.lib import stride_tricks)

# + id="fm-chUQD5BLQ"


# + [markdown] id="wgcfH_9g5BLQ"
# #### 77. How to negate a boolean, or to change the sign of a float inplace? (★★★) 
# (**hint**: np.logical_not, np.negative)

# + id="RB54vqzr5BLQ"


# + [markdown] id="7JQjgjZA5BLR"
# #### 78. Consider 2 sets of points P0,P1 describing lines (2d) and a point p, how to compute distance from p to each line i  (P0\[i\],P1\[i\])? (★★★)

# + id="mS-WIfc45BLR"


# + [markdown] id="XN0kAkHw5BLR"
# #### 79. Consider 2 sets of points P0,P1 describing lines (2d) and a set of points P, how to compute distance from each point j (P\[j\]) to each line i (P0\[i\],P1\[i\])? (★★★)

# + id="kAAtpTDN5BLS"


# + [markdown] id="OR2HMlNa5BLS"
# #### 80. Consider an arbitrary array, write a function that extract a subpart with a fixed shape and centered on a given element (pad with a `fill` value when necessary) (★★★) 
# (**hint**: minimum, maximum)

# + id="vM7ZFGnQ5BLS"


# + [markdown] id="GT9jhrFz5BLS"
# #### 81. Consider an array Z = \[1,2,3,4,5,6,7,8,9,10,11,12,13,14\], how to generate an array R = \[\[1,2,3,4\], \[2,3,4,5\], \[3,4,5,6\], ..., \[11,12,13,14\]\]? (★★★) 
# (**hint**: stride\_tricks.as\_strided)

# + id="DrLDUM-k5BLS"


# + [markdown] id="aQDpVHlW5BLT"
# #### 82. Compute a matrix rank (★★★) 
# (**hint**: np.linalg.svd) (suggestion: np.linalg.svd)

# + id="RyXbxqSv5BLT"


# + [markdown] id="Symg5_zj5BLT"
# #### 83. How to find the most frequent value in an array? 
# (**hint**: np.bincount, argmax)

# + id="K8QDW74B5BLU"


# + [markdown] id="h5T-j28W5BLU"
# #### 84. Extract all the contiguous 3x3 blocks from a random 10x10 matrix (★★★) 
# (**hint**: stride\_tricks.as\_strided)

# + id="gHBCotX65BLV"


# + [markdown] id="ihGBs5535BLV"
# #### 85. Create a 2D array subclass such that Z\[i,j\] == Z\[j,i\] (★★★) 
# (**hint**: class method)

# + id="5CnI-fId5BLV"


# + [markdown] id="QwaKdBFU5BLW"
# #### 86. Consider a set of p matrices wich shape (n,n) and a set of p vectors with shape (n,1). How to compute the sum of of the p matrix products at once? (result has shape (n,1)) (★★★) 
# (**hint**: np.tensordot)

# + id="lrWgqJUI5BLW"


# + [markdown] id="2hCyUQ5g5BLW"
# #### 87. Consider a 16x16 array, how to get the block-sum (block size is 4x4)? (★★★) 
# (**hint**: np.add.reduceat)

# + id="zcKp_pgl5BLX"


# + [markdown] id="Z7j4c5fu5BLX"
# #### 88. How to implement the Game of Life using numpy arrays? (★★★)

# + id="MrbTeawy5BLX"


# + [markdown] id="KvMC_yYD5BLX"
# #### 89. How to get the n largest values of an array (★★★) 
# (**hint**: np.argsort | np.argpartition)

# + id="Qw-NhZty5BLY"


# + [markdown] id="_QbNu80I5BLY"
# #### 90. Given an arbitrary number of vectors, build the cartesian product (every combinations of every item) (★★★) 
# (**hint**: np.indices)

# + id="Kj3BZhkI5BLY"


# + [markdown] id="lSSaNHde5BLY"
# #### 91. How to create a record array from a regular array? (★★★) 
# (**hint**: np.core.records.fromarrays)

# + id="kySJf2nA5BLZ"


# + [markdown] id="EUMKcKzs5BLZ"
# #### 92. Consider a large vector Z, compute Z to the power of 3 using 3 different methods (★★★) 
# (**hint**: np.power, \*, np.einsum)

# + id="0AtRNCjD5BLZ"


# + [markdown] id="F4QxsVuG5BLa"
# #### 93. Consider two arrays A and B of shape (8,3) and (2,2). How to find rows of A that contain elements of each row of B regardless of the order of the elements in B? (★★★) 
# (**hint**: np.where)

# + id="62EQq6D25BLa"


# + [markdown] id="DTZ486FL5BLa"
# #### 94. Considering a 10x3 matrix, extract rows with unequal values (e.g. \[2,2,3\]) (★★★)

# + id="Koyd0yzg5BLb"


# + [markdown] id="EUasd8oA5BLb"
# #### 95. Convert a vector of ints into a matrix binary representation (★★★) 
# (**hint**: np.unpackbits)

# + id="ai3SZ2AP5BLb"


# + [markdown] id="qhlWaMla5BLb"
# #### 96. Given a two dimensional array, how to extract unique rows? (★★★) 
# (**hint**: np.ascontiguousarray)

# + id="3G_LgbUY5BLc"


# + [markdown] id="sPaU5Gwr5BLc"
# #### 97. Considering 2 vectors A & B, write the einsum equivalent of inner, outer, sum, and mul function (★★★) 
# (**hint**: np.einsum)

# + id="2rIrs8hy5BLc"


# + [markdown] id="UalfnIs-5BLc"
# #### 98. Considering a path described by two vectors (X,Y), how to sample it using equidistant samples (★★★)? 
# (**hint**: np.cumsum, np.interp)

# + id="qAGF9R_25BLd"


# + [markdown] id="0Ogd4Wnb5BLd"
# #### 99. Given an integer n and a 2D array X, select from X the rows which can be interpreted as draws from a multinomial distribution with n degrees, i.e., the rows which only contain integers and which sum to n. (★★★) 
# (**hint**: np.logical\_and.reduce, np.mod)

# + id="o81mKFXN5BLd"


# + [markdown] id="wX3qa88S5BLd"
# #### 100. Compute bootstrapped 95% confidence intervals for the mean of a 1D array X (i.e., resample the elements of an array with replacement N times, compute the mean of each sample, and then compute percentiles over the means). (★★★) 
# (**hint**: np.percentile)

# + id="uT9t3FF25BLd"


StarcoderdataJupyterScriptsDedupFiltered