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

# + [markdown] id="67ZXFY5c8q_J"
# # Functions
#
# Functions are essential to the __divide and conquer__ paradigm of problem solving and faciliate program management as the program can be broken into manageable pieces.  
#
# ## Lesson Objectives
#
# *   Define user functions
# *   Import python libraries
# *   Pass data betweeen functions
# *   Gengerate random numbers
# *   Perform simulations (using random numbers)
# *   Pack and upack from tuples
# *   Return multiple values from function
# *   Identify __scope__ of variables
#
#
# ---

# + [markdown] id="jRRKIqLN_38t"
# ## Defining Functions
#
# There are many built-in functions (e.g., `sum`, `len`, `min`, `mean`).  Each function should __perform a single, well-defined task__.  Custom functions, (a.k.a. user-defined functions) can be defined as needed.  
#
# A __function definition__ begins with the ```def``` _keyword_, followed by the name of the function, a set of input values separated by commas enclosed in parenthesis and then a colon.  A __docstring__ should be included and a ```return``` statement which passes control back to the caller with the computed output value of the function.  
# ```
# def function_name(inputs):
#   """Docstring"""
#   return output  
# ```

# + [markdown] id="OwZ85ZyrB4xe"
# A simple example of a function that squares the input value.

# + id="58cW_tDrCGOp"
def square(number):
  """Square a number"""
  return number**2 


# + [markdown] id="7ohtgvs5CQHm"
# A function is callled (invoked) as such:

# + colab={"base_uri": "https://localhost:8080/"} id="2DteVdPFCPEi" executionInfo={"status": "ok", "timestamp": 1632933824529, "user_tz": 240, "elapsed": 106, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="01035fa9-22ef-4b87-b22e-88ddb7f984f1"
square(6)

# + [markdown] id="ViX9BWEoK7u-"
# View the docstring and function information.

# + id="B0C_CEh1LJcn"
import os
# os.open?

# square?

# + [markdown] id="RLutzh03K7rf"
#
# ---

# + [markdown] id="tEsO2MaqCa7c"
# A function is analogous to the concept of __mathematical function__.  In particular, suppose $f(x) = x^2-5x+6$.  In python, we can create this function using the code below.

# + id="45gJl7xt-U0c"
def f(x):
  """f(x) = x^2 -5x + 6"""
  return x**2 - 5*x + 6


# + [markdown] id="XCjkMKkDL8xM"
# And evaluate it at say, 2
#  (at 2)

# + colab={"base_uri": "https://localhost:8080/"} id="oGaY2G5XMDse" executionInfo={"status": "ok", "timestamp": 1632933955999, "user_tz": 240, "elapsed": 109, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="b100198c-fd07-4394-c2be-46f1bceda239"
f(2.3454534)

# + [markdown] id="cIOxSsMoMbol"
# Or 5

# + colab={"base_uri": "https://localhost:8080/"} id="JHN9rHe6MdWE" executionInfo={"status": "ok", "timestamp": 1632933994042, "user_tz": 240, "elapsed": 255, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="f565f44c-2d9d-4d6d-d605-b0043ac52068"
f(6)


# + [markdown] id="Vo61pv8NC_BG"
# A function without a ```return``` statement implicitly returns ```None``` (see Table on page 77) keyword. Use ```pass``` instead of ```return``` when first building a function (before the inner code block is developed), such as a function template or function placeholder.

# + id="Q_gFtRBAC-Vo" colab={"base_uri": "https://localhost:8080/"} executionInfo={"status": "ok", "timestamp": 1632934182717, "user_tz": 240, "elapsed": 136, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="3dd20059-a849-4db8-8b2a-dcab8fe032ef"
def f(x):
  """Does nothing"""
  return None

def g(x):
  return

def h(x):
  """Skips this function.  Does not return None"""
  pass

# Call functions g and h
print(g(3))
h(2)

# + [markdown] id="AO3LigZfSeHg"
# ## Passing by Reference or by Value
# Python passes all arguments __by reference__.

# + colab={"base_uri": "https://localhost:8080/"} id="TkJ9R8AVd7Tm" executionInfo={"status": "ok", "timestamp": 1632934297468, "user_tz": 240, "elapsed": 135, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="f1b198dd-5dfd-46fa-e30c-79cc9d82b805"
y = 4
id(y)

# + colab={"base_uri": "https://localhost:8080/"} id="-hdpR1IGTBbJ" executionInfo={"status": "ok", "timestamp": 1632935325801, "user_tz": 240, "elapsed": 120, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="34f06715-ee3c-4d4a-ae58-2214532ca0c4"
x = 7
print('Memory Location of x = ',id(x))
f(x)
print(x)
print('Memory Location of x = ',id(x))

def f(x):
  print('Mem. Loc. of x in f(x) = ',id(x))
  x += 1
  print(x)
  print('Mem. Loc. of NEW x, x+1, in f(x) = ',id(x))
  return None



# + [markdown] id="OIpH33XWptu9"
# ## Default Parameters
#
# When defining a function, __default parameter values__ can be specified in the arguments list.  

# + colab={"base_uri": "https://localhost:8080/"} id="JZygKg7xqCnf" executionInfo={"status": "ok", "timestamp": 1632934694263, "user_tz": 240, "elapsed": 114, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="f67656d5-0c60-4dce-e2ca-006d0b0c5c31"
def area_of_circle(r = 1):
  return 3.1415*r**2

# Determine the area of unit circle
area_of_circle()  # same as area_of_circle(1)


# + [markdown] id="othvLWw4f1cg"
# # Multiple Parameters
# Functions can accept any number of input parameters.  

# + colab={"base_uri": "https://localhost:8080/"} id="Tb7BiNB1f9TA" executionInfo={"status": "ok", "timestamp": 1632934845701, "user_tz": 240, "elapsed": 110, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="e2a5d703-382b-4f57-9fdf-3fbb1eecfe2d"
def f(x,y):
  return x*y

# Call the function 
f(4,9)


# + colab={"base_uri": "https://localhost:8080/"} id="42MhQp6RgJIA" executionInfo={"status": "ok", "timestamp": 1632934918688, "user_tz": 240, "elapsed": 104, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="9afe552e-71fb-4743-a65e-03455a0e1db9"
def f(a,b,c):
  return a+b+c

# Call function 
f(1,2,3)


# + colab={"base_uri": "https://localhost:8080/", "height": 35} id="DCNbHUXMgbz_" executionInfo={"status": "ok", "timestamp": 1632934957032, "user_tz": 240, "elapsed": 111, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="63aee820-2c96-4e2c-a586-aee3c612840c"
def f():
  return "No value"

# Call function 
f()

# + [markdown] id="qA89bgBKrMgy"
# ## Arbitrary Number of Parameters
#
# It is sometimes desirable that a function accepts a variable number of input parameters.  For example, the ```max``` function can take two or more input values.  In particular, 
#
# ```
# max(7,3)
# max(3,1,8,4,9,2)
# ```
#
# ### ```*args```
#
# Use ```*args``` in the function to accept a variable number of input parameters.

# + colab={"base_uri": "https://localhost:8080/"} id="lyNLfpaOgvIl" executionInfo={"status": "ok", "timestamp": 1632935033760, "user_tz": 240, "elapsed": 98, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="7642b4d5-b700-42ad-9112-28acc4a9eeab"
max(7,3,1,9,10,123,456)


# + colab={"base_uri": "https://localhost:8080/"} id="c0suPNCLsGJL" executionInfo={"status": "ok", "timestamp": 1632935097024, "user_tz": 240, "elapsed": 102, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="65f323ec-e2f9-4238-d50c-d1e893f9d9cd"
# Define an average function that accepts variable number of input arguments.
def avg(*args):
  return sum(args) / len(args)


# Test the function
avg(2,7,3,5,3,12,18)

# + id="U6FxXSIKgt34"


# + [markdown] id="n5_dxjs5Gn3p"
# ## Local Variables
#
# When a function is called, an identifier for the input parameter is created (temporarily) to store that value in memory for use in the body of the function.  It is then destroyed as the function passes control back to the caller.  The same applies to variables created (and used) within the function code block.  Any such identifiers are known as a __local variables__.
#
# Attempting to access this identifier after control has return to the caller with result in a ```NameError```.  For example, 

# + id="kMOJf0V-C-K1"
def f(x):
  y = 3*x
  print(x)
  print(id(x))
  return y


# + [markdown] id="8e2wriozJW2f"
# Lets test an input parameter.  Note, first clear any residual values of `x` in scope (in current namespace). 

# + colab={"base_uri": "https://localhost:8080/", "height": 266} id="uHRn_7LzIRPd" executionInfo={"status": "error", "timestamp": 1632935355526, "user_tz": 240, "elapsed": 123, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="4dbd79ec-264b-45f1-aa95-b6d35f73fb61"
# "Main" program
del x
print(f(4))
print(x)

# + [markdown] id="XA5GSVeVKFb5"
# Now test `y`.

# + colab={"base_uri": "https://localhost:8080/"} id="TJ5pbKiVJv14" executionInfo={"status": "ok", "timestamp": 1632935387528, "user_tz": 240, "elapsed": 137, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="f8a87805-999f-4db4-e587-aec852b4038d"
print(f(3))
print(y)


# + [markdown] id="mFAKyhxOMkui"
# ## Multiple input parameters
#
# Functions can take multiple input paramenters.

# + id="lS5xpcxOKNEC"
def maximum(x,y,z):
  """Return the maximum of three values"""
  max_ = x
  if y > max_:
    max_ = y
  if z > max_:
    max_ = z
  
  return max_


# + [markdown] id="rwQoVGQuNpn-"
# Call the maximum function.

# + colab={"base_uri": "https://localhost:8080/"} id="XRtCoDyXNePK" executionInfo={"status": "ok", "timestamp": 1632935449813, "user_tz": 240, "elapsed": 135, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="4f6bb8a2-d259-4126-aef4-eddaceaa7bde"
maximum(4, 1.35, 9)

# + [markdown] id="gTidDj8yN6Wh"
# > Note the output of ```maximum``` when  strings are the inputs.

# + colab={"base_uri": "https://localhost:8080/", "height": 35} id="Rz4sfHv4N0kC" executionInfo={"status": "ok", "timestamp": 1632935456653, "user_tz": 240, "elapsed": 289, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="d37a9400-9f50-4a1f-fd81-cb88912518a6"
maximum('blue', 'red', 'green')

# + [markdown] id="uFXQ0fqwObIk"
# What about mixed types? 

# + colab={"base_uri": "https://localhost:8080/", "height": 130} id="b-3t4nVOOI63" executionInfo={"status": "error", "timestamp": 1632935522587, "user_tz": 240, "elapsed": 1016, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="edea1ce6-582f-48a8-9ca5-bd5674810ecc"
maximum(3, 'blue', 1,, 'brown')

# + [markdown] id="GJACUBSLOs_w"
# ---

# + [markdown] id="0RMXEBVDOupL"
# ## Random-number Generation
#
# Simulation is an important tool in computational science.  It relies on random generation of large sample of numbers.  The `random` module is included in the Python Standard Library. 
#
#
# Simulate rolling a six-sided die 10-times.
#
# First import the `random` module.

# + id="oq2QkTFjOmjd"
import random

# + [markdown] id="rkbC1DAkQbcC"
# Roll 10 times, each time selecting a random integer between 1 and 6.

# + colab={"base_uri": "https://localhost:8080/"} id="Jp7GbuATQOhP" executionInfo={"status": "ok", "timestamp": 1632935773257, "user_tz": 240, "elapsed": 4, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="9c7d66b5-bd00-4677-cc25-2c14e7d09494"
for i in range(10):
  print(random.randint(1,6), end=' ')

# + [markdown] id="LPDQs2bBRYji"
# #### Simulation Project
# What about a more realistic simulation of rolling the die 100000 times?  Write a function that accepts an arbitrary positive integer to simulate rolling a fair, six-sided die that number of times keeping track of the frequency of each face.  Print a table of the results.

# + id="aSjBIi3bQkk9"
import random

# Function defintion
def roll(n):
  """Simulating rolling 6-sided die n-times"""

  frequencies = [0, 0, 0, 0, 0, 0]

  for i in range(n):
    face = random.randint(1,6)
    if face == 1:
      frequencies[0] += 1
    elif face == 2:
      frequencies[1] += 1
    elif face == 3:
      frequencies[2] += 1
    elif face == 4:
      frequencies[3] += 1
    elif face == 5:
      frequencies[4] += 1
    elif face == 6:
      frequencies[5] += 1

  print(f'Face {"Frequency":>13}')
  for i in range(6):
    print(f'{i+1:>4}{frequencies[i]:>13}') 
  


# + colab={"base_uri": "https://localhost:8080/"} id="1OGLX1SUT6NL" executionInfo={"status": "ok", "timestamp": 1632936457108, "user_tz": 240, "elapsed": 148, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="ab9e32b4-c604-4536-e0db-97232e70972e"
# Call Function
roll(120)

# + [markdown] id="d29dx7nBW8Hw"
# ---

# + [markdown] id="Nl68BNfBWvvL"
# __Example__:  Simulate flipping a coin 20 times.

# + colab={"base_uri": "https://localhost:8080/"} id="ULk2Qvc3U98d" executionInfo={"status": "ok", "timestamp": 1632936725442, "user_tz": 240, "elapsed": 123, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="db37cba9-41d4-472d-e3d0-4b6f0493d4e6"
import random 

for i in range(20):
  print('H' if random.randint(0,1) == 0 else 'T', end=' ')

# + [markdown] id="C6o-ln4yVAfX"
# ## Reproducibility
#
# Reproducibility is important to scientific results.  It is also crucial to __debugging__ code.  
#
# Computers actually only generate __psuedorandom__ numbers (seemingling random, for most intent and purposes, but actually deterministic). 
#
# But each call, the psuedorandom generator  __seeds__ the algorithm and the results are different.  If we wish to ensure reproducibility, we can manually set the seed value.

# + colab={"base_uri": "https://localhost:8080/"} id="A-rO3lJEURfN" executionInfo={"status": "ok", "timestamp": 1632936899880, "user_tz": 240, "elapsed": 133, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="fe436ee3-e933-4bfe-c661-0d0c35a60174"
random.seed(345)
roll(10)

# + id="79pr7QV-Ws10"


# + [markdown] id="l2yAU0KaYUAB"
# # Case Study: Craps
#
# The rules for the game of "craps":
# 1. Roll a pair of six-sided dice.
#  - if 7 or 11 $\rightarrow$ W
#  - if 2, 3 or 12 $\rightarrow$ L
#  - if 4,5,6,8,9, or 10, record as "point"
# 2. Roll pair again
#   - if 7 $\rightarrow$ L
#   - if point $\rightarrow$ W
#   - else record point.
# 3. Goto 2.
#
# Write a program to simulate "craps".

# + colab={"base_uri": "https://localhost:8080/"} id="vznMazJuYw9Z" executionInfo={"status": "ok", "timestamp": 1632937121004, "user_tz": 240, "elapsed": 19319, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="8366f8d4-1718-4341-b568-7a5e3daebe78"
"""Simulate Craps"""
# <NAME>
# 2021-09-25 

import random

# Support Functions
def roll_dice():
  return (random.randint(1,6),random.randint(1,6))

def show_roll(dice):
  die1, die2 = dice
  print(f'Player roll {die1} + {die2} = {sum(dice)}')

def game_status(dice, point):
  if sum(dice) == 7:
    return (True,'L')
  elif sum(dice) == point:
    return (True,'W')
  else:
    return (False,'Continue')

# First Roll
dice = roll_dice()
sum_of_dice = sum(dice)
point = sum_of_dice
show_roll(dice)
 
if sum_of_dice in (7,11):
  game_over = game_status((1,1),2)
elif sum_of_dice in (2,3,12):
  game_over = game_status((1,6),0)
else:
  game_over = (False,'Continue')

# Continue Rolling
while not game_over[0]:
  x = input('Enter X to exit: ')
  if x == 'X':
    break
  dice = roll_dice()
  show_roll(dice)
  game_over = game_status(dice, point)
  point = sum(dice)
  print(game_over)



# + [markdown] id="fK94U5_cm3Yd"
# ---

# + [markdown] id="UIV5wvvmm3Pp"
# # Python Standard Library
#
# There are plenty of prebuilt modules in the standard library.  Some popular modules in the standard library are listed in the table below.  See also [1, p. 132].
#
# | Module      |  Description   |
# |-------------|----------------|
# | ```math```  | Comman math constants and operations |
# | ```random```| Psuedorandom number generators|
# |```statistics``` | Statistical functions |
# |```sqlite3``` | SQL functions |
#
#
#

# + [markdown] id="br-eOPZBolVm"
# ### ```math``` Module

# + colab={"base_uri": "https://localhost:8080/"} id="bnRaQWCBojS0" executionInfo={"status": "ok", "timestamp": 1632937214762, "user_tz": 240, "elapsed": 144, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="c335468e-a9d5-4b04-944c-7ff3dca49a91"
import math

x = 4.762

math.ceil(x)
math.floor(x)

math.sin(x)
math.cos(x)
math.tan(x)

math.exp(x)
math.log(x)
math.log10(x)

math.pow(x,2)
math.sqrt(x)

math.fabs(x)
math.fmod(17,4)

math.pi

# + colab={"base_uri": "https://localhost:8080/"} id="m57C9kKspKoY" executionInfo={"status": "ok", "timestamp": 1632937282595, "user_tz": 240, "elapsed": 123, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="ba3418f1-1c3f-45b6-e80d-c85a8f46db9d"
import math
math.cos(0)

# + colab={"base_uri": "https://localhost:8080/", "height": 164} id="vwOux2b7pdLY" executionInfo={"status": "error", "timestamp": 1632937353224, "user_tz": 240, "elapsed": 128, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="48102b09-e2a7-4dd7-e8be-281d0eeda2fb"
del math

# + colab={"base_uri": "https://localhost:8080/"} id="9ZfoaUoppfUg" executionInfo={"status": "ok", "timestamp": 1632937343879, "user_tz": 240, "elapsed": 135, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="cd15f59e-ebb3-41ab-972a-a798966a2f27"
from math import cos
cos(0)

# + colab={"base_uri": "https://localhost:8080/"} id="f2SmUmOkpsDX" executionInfo={"status": "ok", "timestamp": 1632937440122, "user_tz": 240, "elapsed": 4, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="a845d2d1-3dc1-4008-ab43-774cb5a22ae5"
import math as m

m.sin(0)

# + [markdown] id="gIY_VPNVph-F"
# There are many other functions included in the ```math``` module.

# + id="7j_rjR-ZpFiO"


# + [markdown] id="c-sQ5jzc-DKr"
# ## `import`: A closer look
#
# We can import the entire library
# ```
# import math
# ```
#
# Or only parts of a library, in particular, certain functions
#
# ```
# from math import ceil
# ```
#
# It is possible to import multiple functions by a comma-separated list.
# ```
# from math import ceil, floor
# ```

# + [markdown] id="aM81_BM5QAk6"
# In the first case, i.e., `import library`, must use fully qualified name with functions.  For example, 

# + colab={"base_uri": "https://localhost:8080/", "height": 227} id="bQ1bH3cA-X1p" executionInfo={"status": "error", "timestamp": 1632930718979, "user_tz": 240, "elapsed": 197, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="14510787-ea4b-483f-9908-2e0448f71c8a"
import math
sqrt(5)
math.ceil(sqrt(5))

# + [markdown] id="8Huv3hDeQeDw"
# In the second case where only certain functions are included, a call to the function works.

# + colab={"base_uri": "https://localhost:8080/"} id="NeBfIrlj-aCE" executionInfo={"status": "ok", "timestamp": 1632930805708, "user_tz": 240, "elapsed": 145, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="bd32910f-17f7-4336-9260-df41db2579aa"
from math import ceil

ceil(5)

# + [markdown] id="17jozQczRkb7"
# ## Wildcard Imports
#  __Advoid__ using the wildcard to import "everything".  Loads everything into the current scope. 
# ```
# from math import *
# ```

# + [markdown] id="MPjiZLF8QswD"
# ## Aliasing the namespace

# + id="m8hBvhQ4_Re2" colab={"base_uri": "https://localhost:8080/"} executionInfo={"status": "ok", "timestamp": 1632931006785, "user_tz": 240, "elapsed": 172, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", "userId": "09730783492511667700"}} outputId="a30f48bc-e421-445c-b2f6-7a2f9caa2a5e"
import numpy as np

np.zeros((5,2), dtype=int)

# + id="vAQ3e-KSAfPS"
# Data Science Libraries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt


StarcoderdataJupyterScriptsDedupFiltered