Question: ```
char[][]  moveup()
{
for (int i=0;i<3;i++)
 {
for (int j=0;j<3;j++)
  {

   if(board[i][j]=='X' && board [i-1][j]=='!' ) {
    board [i][j]='!';
    board [i-1][j]='X';
    }
   }
   }
    return board;
  }

```

This is my code and *I want to pass this 2d array then in to a vector* so i want to return a 2d array board without using pointers

Answer: 
I do not know why you use this format but here is a hack with `pandas`:

```
import pandas as pd

df  = pd.DataFrame(x)
df_ = df.groupby('id')['vonmises'].max().reset_index()

In [213]: df_.merge(df, on=['id','vonmises'])[['id','vonmises','subcase']]

Out[213]:
array([[   2.,  400.,   44.],
       [   3.,  400.,   33.],
       [   5.,  500.,   55.]], dtype=float32)

```
Using the [numpy\_indexed](https://github.com/EelcoHoogendoorn/Numpy_arraysetops_EP) package, this would be a simple one-liner:

```
import numpy_indexed as npi
ids, maxvonmises = npi.group_by(x.id).max(x.vonmises)

```

Probably similar performance to pandas, but a lot more readable, and no need to adapt your dataformat to the problem at hand.