I am working on a dataset. I have one dataset which has three column company SIC code, the second column is also a company SIC code , and third column is their relationship score between two SIC code.
first dataframe
SIC SIC.1 value
10 10 0
10 12 15
10 15 17.9
and second data frame is empty data frame with SIC code in index and column
10 12 13
10
12
13
so I have to write a value in this second dataframe using value column from first dataframe ?
code is
for k in df20.index:
for i in df21.index:
for j in df21.columns:
a = int(i)
b = int(j)
if df20["SIC"][k] == a & df20["SIC.1"][k] == b:
m = df20["value"][k]
df21[i][j] = m
else:
continue
please look into it, I don't know where I am making the mistake.