Sorry about that. I was able to fix the error by changing x = frame[:type] 
to x = frame[type]

Apologies for the trouble caused

On Sunday, 18 September 2016 22:45:27 UTC+2, varu...@gmail.com wrote:
>
>
> Hi,
>
> I seem to have run into a problem here. I firstly have a function as 
> follows:
>
> function gen(type, frame1, frame2)
>
>   x = frame1[:type]
>   z = frame2[:type]
>   y = []
>  
>   for i in length(frame1)
>
>     push!(y, x[i] * z[i])
>
>   end
>
> end
>
> Now, when I call:   ans = gen(I, frame1, frame2), I get a keyError saying 
> type not found.
>
> sample dataframe
>
> dataframe1
>
> Row I  II III IV V
> 1    0.2   0.4   0.6   0.7   0.4
> 2 .....
> 3....
> .
> .
> .
> Can you please let me know where I'm making a mistake and how I can fix 
> it? Thanks guys
>

Reply via email to