In [1]:
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib

%matplotlib inline
matplotlib.style.use('ggplot')

In [2]:
#plot_df = pandas.DataFrame({
#    'col1': [1, 3, 2, 4],
#    'col2': [3, 6, 5, 1],
#    'col3': [4, 7, 6, 2],
#})
mongo_df = pd.read_csv('./mongo.csv',header=0,index_col=0)
mysql_df = pd.read_csv('./mysql.csv',header=0,index_col=0)

In [3]:
mongo_df


Out[3]:
duration
query
1 25.997
2 2.158
3 0.107
4 0.156
5 0.005
6 0.007

In [4]:
mysql_df


Out[4]:
duration
query
Fill 11.366532
Index 2.153368
Update 0.454594
Delete 0.132651
Count 2.254035
Interval 0.000820

In [5]:
# Cambio los nombres de las columnas para identificar cada dato y copio el index de mysql,
# porque el CSV de mongo no lleva el nombre de las querys.

mongo_df.columns=["MongoDB"]
mysql_df.columns=["MySQL"]
mongo_df.index = mysql_df.index
mongo_df


Out[5]:
MongoDB
query
Fill 25.997
Index 2.158
Update 0.107
Delete 0.156
Count 0.005
Interval 0.007

In [6]:
final_df = pd.concat([mysql_df,mongo_df],axis=1)
final_df


Out[6]:
MySQL MongoDB
query
Fill 11.366532 25.997
Index 2.153368 2.158
Update 0.454594 0.107
Delete 0.132651 0.156
Count 2.254035 0.005
Interval 0.000820 0.007

In [7]:
final_df.plot(kind='bar').set(ylabel='ms')


Out[7]:
[<matplotlib.text.Text at 0x7f0dd97b6750>]

In [8]:
final_df.plot(logy=True,kind='bar',figsize=(15,15*3/4)).set(ylabel='ms')


Out[8]:
[<matplotlib.text.Text at 0x7f0dd9613610>]