With such a dictionary, and the fact that you're trying to put it into a dataframe like structure, I would consider using pandas. It's fast, and you can get your desired frame in one short line (assuming your dictionary is called my_dict):
import pandas as pd
df = pd.DataFrame.from_dict(my_dict, orient='index')
which returns:
0 1 2
PLGLB1 0 2 2
IL20RA 2 0 0
MORC1 2 0 0
I'm unsure of your final goal, but it seems like you want this to end up being outputted as a text file (correct me if I'm wrong), in which case you can just do this:
df.to_csv('filename.txt', sep=' ', header=False)
Which will make a text file called filname.txt looking like this:
PLGLB1 0 2 2
IL20RA 2 0 0
MORC1 2 0 0
Note: If the outputted .txt is your only goal, and you don't want to work with the dataframe in Python, you can even chain the whole thing without saving the frame as df:
pd.DataFrame.from_dict(my_dict, orient='index').to_csv('filename.txt', sep=' ', header=False)
forloop and aprintwould go a long way in solving your problem.{'PLGLB1': array([0, 2, 2]), 'IL20RA': ...is text in a file, right?)