Question: I was trying to build a scraper to catch league names and odds..Been able to catch the odds but matching the two doesnt seem to work..here is my code:

```
import requests
from bs4 import BeautifulSoup

r = requests.get("http://www.elitebetkenya.com/coupon.php")
soup = BeautifulSoup(r.content)

for i in soup.findAll("tr"):
    tds =  i.findAll("td")
    fixture = soup.findAll("tr", { "class" : "fixture" })

    try:
        if len(tds[0].text)  != 0 :

            print " Bet-type: %s, Choice: %s, Match code: %s, 1: %s, 0:      %s" % \
          (tds[0].text, tds[1].text, tds[2].text,tds[3].text, tds[4].text)
except:
    pass

```

Answer: 
Courtesy of Microsoft Excel: 

[![enter image description here](https://i.stack.imgur.com/8Mbig.png)](https://i.stack.imgur.com/8Mbig.png)
meshgrid helps in creating a rectangular grid from two 1-D arrays of all pairs of points from the two arrays.

```
x = np.array([0, 1, 2, 3, 4])
y = np.array([0, 1, 2, 3, 4])

```

Now, if you have defined a function f(x,y) and you wanna apply this function to all the possible combination of points from the arrays 'x' and 'y', then you can do this:

```
f(*np.meshgrid(x, y))

```

Say, if your function just produces the product of two elements, then this is how a cartesian product can be achieved, efficiently for large arrays.

Referred from [here](https://codereview.stackexchange.com/questions/90005/efficient-element-wise-function-computation-in-python)