Question: I have a 2-D numpy array each row of which consists of three elements - ['dataframe\_column\_name', 'dataframe\_index', 'value'].
Now, I tried populating the pandas dataframe using iloc double for loop but it is quite slow. Is there any faster way of doing this. I am a bit new to pandas, so apologies in case this is something very basic.
Here is the code snippet :

```
my_nparray = [['a', 1, 123], ['b', 1, 230], ['a', 2, 321]]
for r in range(my_nparray.shape[0]):
    [col, ind, value] = my_nparray[r]
    df.iloc[col][ind] = value

```

This takes a lot of time when my\_nparray is large, is there any other way of doing this?

Initially assume that I can create this data frame :

```
  'a' 'b'
1 NaN NaN
2 NaN NaN

```

I want the output as :

```
  'a' 'b'
1 123 230
2 321 NaN

```

Answer: 
Wouldn't this work:

```
 def convert_to_klist(map) do
   Enum.map(map, fn({key, value}) -> {String.to_existing_atom(key), value} end)
 end

```
For future reference. You can also use [Enum.into/3](https://hexdocs.pm/elixir/Enum.html#into/3)

```
%{"browser_name" => "Chrome", "platform" => "linux"}
|> Enum.into([], fn {k, v} -> {String.to_existing_atom(k), v} end)

```

or in its shorter version:

```
%{"browser_name" => "Chrome", "platform" => "linux"}
|> Enum.into([], &{String.to_existing_atom(elem(&1,0)), elem(&1,1)})

```