Question: I am looking to find difference between two rows in a multi-level data by iterating values within certain class and been trying different techniques by reading tutorials as I am still new to python/pandas power.

what I am trying to do is to find out difference between scores of teacher and each student in certain class.

dataframe:

```
Class, Name ,Reference, stats
    X ,SHE ,student, 30
    X ,GHE ,student, 20
    X ,GMK ,student ,10
    X ,JKO ,teacher ,50
    Y ,HHH ,student ,20
    Y ,KLP ,teacher ,30

```

Output:

```
Class,teacher, student, difference
X, JKO, SHE,20
X, JKO,GHE, 30
X, JKO, GMK, 40
Y, KLP, HHH, 10

```

Can anyone help me by guiding me towards the right direction? there can be more than 1 teachers in a class.

Thank you

Answer: 
Have a look at [requestparam](https://stackoverflow.com/questions/22373696/requestparam-in-spring-mvc-handling-optional-parameters)

```
@RequestMapping(value = "/query", method=RequestMethod.POST)
@ResponseBody
public String query(@RequestParam("number") Integer number){
  return dao.query(number);
}

```

The request should be like `/query?number=8`
Change Integer to String and you are good to go without doing anything else. Hope this helps you.

```
@RequestMapping(value="/query",method=RequestMethod.POST)
 @ResponseBody
 public String query(@RequestBody String number ){  

      return dao.query(number);
 }

```