Hi
I am having problems with creating a matplot lib table using python.
The example i have been following : http://matplotlib.sourceforge.net/examples/pylab_examples/table_demo.html
My data :
I have two for loops where in the first For loop i get the Protocol Name and in the second for loop i get the module name. I need the data to be like this for pushing it into the matplotlib table.
data = [[ 66386, 174296, 75131, 577908, 32015],
[ 58230, 381139, 78045, 99308, 160454]]
Instead my Data is like this
data = [[ 66386, 174296, 75131, 577908, 32015,
58230, 381139, 78045, 99308, 160454]],
My Code :
ProtocolList = [DHCP , PPOEE ,WANe ]
passList = []
for protocol in protocolList:
# Comment- modules= [ frag,app,scale] This below line gets all the module names
moduleNames = d[ protocol ].getModuleNames()
for module in moduleNames:
# This line gets all the passes for each module
numberOfPasses = d[protocol].getModule(module)[1]
passList.append(numberOfPasses)
print passList
My Output : [6, 3, 1, 2, 22, 3, 3, 4, 13, 0, 7, 27, 5, 8, 4, 8, 1, 7, 6, 13, 7, 9, 23, 3, 4,
1, 7, 4, 0, 22, 8, 6, 7, 27, 4, 3, 1, 3, 1, 12, 3, 6, 8, 2, 9, 19, 3, 6, 2, 22,
2, 8, 4, 3, 0, 7, 10, 27, 5, 8, 4, 1, 7, 6, 13, 1, 9, 23, 3, 4]
Its Combining all the passes all modules in one list where i want the passes for each module to go into individual lists so i can put it use it for the matplotlib table data
So basically i have to put the pass and fail values in individual lists
like this [[ pass] [fail] [pass] [fail] ]
Instead its like this [[ pass , pass , fail , fail ]]