Question: I'm a beginner using python and pandas. I'm trying to save some results that I produced through a function. I'm having several problems at the moment to generate the dataframe with desired results. Here is an example of an iterable function that I wrote (To simplify the description I'm using the example of the area of several triangles. My real function is more complicated and has several intermediate steps):

```
Base = 5
H = [1, 2, 3, 4, 5]

for i in H:

    def Triangle_area():

        H = [i]
        ratio = (Base*H)
        area = np.divide(ratio,2)

        ms = pd.DataFrame(area, columns=[i])
        A = ms[i].mean()
        A1 = pd.DataFrame({'area':A}, index=[i])

        return A1

    areas = Triangle_area()
    print(areas)

```

The result is a dataframe or a series of dataframes as follows:

```
   area
1   0.5
   area
2   1.0
   area 
3   1.5
   area
4   2.0
   area
5   2.5

```

But what I want should look like this:

```
H   area
1   0.5
2   1.0
3   1.5
4   2.0
5   2.5

```

I think that there must exist several ways to do this, but I can not find the way to do it. Thanks in advance for your comments.

Answer: 
The tag is `{% csrf_token %}`, not `{% csrf token %}`.
You are not using the tag correctly. No space between both words:

```
{% csrf_token %}

```

You could over the tutorial on CSRF (again) to ensure all the other necessary parts are in place:

[Cross Site Request Forgery protection](https://docs.djangoproject.com/en/1.11/ref/csrf/).