How to make code? : <p>I have 3 data.</p>

<pre><code>code2 data : code data(ex:a1,b1,c1)
field data : field data(ex:a2,b2,c2)
file data: row data
</code></pre>

<p>row data format is next line</p>

<pre><code>field1|field2|field3
a1    |a2    |value1
a1    |b2    |value2
a1    |c2    |value3
b1    |a2    |value4
b1    |b2    |value5
...
</code></pre>

<p>I want to make new data. New data format is next line</p>

<pre><code>index|a2|b2|c2
a1   |value1|value2|value3
b1   |vlaue4|value5 ...
</code></pre>

<p>I used numpy and pandas 's array lib but I can't make a newdata</p>

<p>My code is next line</p>

<pre><code>f = open('D:\\file.txt','r')
g = open('D:\\code2.txt','r')
h = open('D:\\field.txt','r')
k = open('D:\\data.txt','w')
import numpy as np
a=[]
b=[]
c = [0 for _ in range(102218)]
d = [0 for _ in range(63)]
f_1 = f.readlines()[1:]
g_1 = g.readlines()
h_1 = h.readlines()
for i in range(0,102219):
    c[i]=""
for lineG in g_1:
    a = lineG.split('|')
    code = int(a)
    for lineH in h_1:
        b = lineH.split('|')
        for lineF in f_1:
            z = lineF.split(',')
            if a == z[1] and b == z[2]:
                array1 = np.arange(6542080).reshape(len(lineG),len(lineH))
                array1 = np.array(ro)
                break
            else:
                continue
k.close()
h.close()
g.close()
f.close()
</code></pre>
