擅长:python、mysql、java
<p>您可以尝试:</p>
<pre><code>a=[95, 66, 137, 70, 20]
b=[36, 66, 44, 214, 105, 133]
c=[170, 66, 97, 153, 105, 138]
df = pd.DataFrame()
count=0
for j in [a,b,c]:
col = [1 if i in j else 0 for i in range(229)]
df[count] = col
count+=1
mat = np.matrix(df).reshape(3,228)
</code></pre>