In [14]:
import pandas as pd;
import datetime;
import pandas_datareader.data as web;
import matplotlib.pyplot as plot;

from matplotlib import style;
style.use("ggplot");

In [21]:
start = datetime.datetime(2010, 1, 1);
end = datetime.datetime(2015, 1, 1);

df = web.DataReader("XOM", "yahoo", start, end);

In [22]:
print(df);


                 Open       High        Low      Close    Volume  Adj Close
Date                                                                       
2010-01-04  68.720001  69.260002  68.190002  69.150002  27809100  56.700952
2010-01-05  69.190002  69.449997  68.800003  69.419998  30174700  56.922342
2010-01-06  69.449997  70.599998  69.339996  70.019997  35044700  57.414323
2010-01-07  69.900002  70.059998  69.419998  69.800003  27192100  57.233934
2010-01-08  69.690002  69.750000  69.220001  69.519997  24891800  57.004337
2010-01-11  69.940002  70.519997  69.650002  70.300003  30685000  57.643919
2010-01-12  69.720001  69.989998  69.519997  69.949997  31496700  57.356925
2010-01-13  69.959999  70.040001  69.260002  69.669998  24884400  57.127334
2010-01-14  69.540001  69.739998  69.349998  69.680000  18630800  57.135536
2010-01-15  69.650002  69.690002  68.650002  69.110001  29411900  56.668153
2010-01-19  68.739998  69.349998  68.419998  69.269997  26081900  56.799345
2010-01-20  68.559998  68.660004  67.930000  68.029999  34629500  55.782583
2010-01-21  68.120003  68.150002  66.500000  66.699997  39114000  54.692021
2010-01-22  66.519997  67.139999  66.000000  66.099998  39085500  54.200040
2010-01-25  66.550003  66.760002  65.690002  65.849998  29305100  53.995048
2010-01-26  65.639999  66.739998  65.500000  65.919998  34083300  54.052445
2010-01-27  65.660004  66.059998  65.000000  65.540001  35723500  53.740859
2010-01-28  65.849998  65.849998  64.570000  64.959999  37349800  53.265274
2010-01-29  65.150002  65.820000  64.019997  64.430000  40880500  52.830691
2010-02-01  65.769997  66.410004  65.349998  66.180000  37703000  54.265639
2010-02-02  66.730003  67.120003  66.470001  66.959999  34057900  54.905215
2010-02-03  66.879997  67.230003  66.559998  66.599998  24024700  54.610025
2010-02-04  66.269997  66.349998  64.680000  64.720001  33858200  53.068483
2010-02-05  64.699997  64.900002  63.560001  64.800003  42297500  53.134082
2010-02-08  64.910004  65.489998  64.339996  64.349998  30519400  53.109322
2010-02-09  65.110001  65.709999  64.559998  65.199997  36243300  53.810842
2010-02-10  65.080002  65.220001  64.160004  64.849998  21699100  53.521982
2010-02-11  64.690002  65.480003  64.410004  65.239998  23555200  53.843856
2010-02-12  64.620003  65.139999  64.279999  64.800003  30636200  53.480720
2010-02-16  65.440002  66.379997  65.080002  66.279999  30514900  54.702189
...               ...        ...        ...        ...       ...        ...
2014-11-18  95.080002  95.750000  94.529999  94.870003   9263200  88.594283
2014-11-19  95.080002  95.739998  94.129997  95.610001   8333200  89.285330
2014-11-20  95.370003  95.900002  95.260002  95.820000   8422400  89.481437
2014-11-21  97.199997  97.199997  96.099998  96.809998  12374900  90.405946
2014-11-24  96.339996  96.800003  95.250000  95.720001  10172400  89.388054
2014-11-25  96.010002  96.029999  94.370003  94.779999  13747400  88.510233
2014-11-26  94.639999  95.129997  94.360001  94.480003   9822100  88.230083
2014-11-28  91.500000  91.849998  90.110001  90.540001  19556700  84.550714
2014-12-01  90.360001  92.870003  90.279999  92.349998  27584200  86.240979
2014-12-02  92.320000  94.669998  92.010002  94.190002  20885300  87.959266
2014-12-03  94.669998  95.330002  94.000000  94.949997  16220400  88.668986
2014-12-04  94.129997  94.610001  93.070000  94.370003  12868600  88.127359
2014-12-05  93.949997  94.589996  93.349998  93.820000  11831900  87.613739
2014-12-08  92.900002  93.129997  91.370003  91.699997  15735900  85.633976
2014-12-09  91.230003  92.059998  90.760002  91.379997  15883800  85.335144
2014-12-10  90.720001  90.730003  88.199997  88.669998  22279400  82.804414
2014-12-11  88.860001  91.540001  88.849998  89.199997  21522200  83.299352
2014-12-12  88.709999  89.000000  86.599998  86.599998  24568300  80.871346
2014-12-15  87.529999  88.599998  86.500000  86.900002  21373600  81.151503
2014-12-16  86.379997  89.199997  86.190002  86.410004  26372400  80.693919
2014-12-17  87.239998  89.900002  87.150002  89.019997  23323000  83.131259
2014-12-18  90.370003  91.160004  88.400002  91.160004  22882700  85.129703
2014-12-19  90.209999  93.639999  89.610001  93.639999  38469000  87.445646
2014-12-22  92.959999  93.669998  92.449997  93.330002  17871800  87.156155
2014-12-23  93.519997  95.180000  93.050003  94.589996  13706500  88.332800
2014-12-24  94.220001  94.250000  92.980003  93.779999   6875700  87.576384
2014-12-26  93.989998  94.430000  92.620003  93.209999  10585000  87.044090
2014-12-29  93.330002  93.860001  92.889999  93.070000   9892100  86.913352
2014-12-30  92.769997  93.389999  92.510002  93.019997   8743400  86.866656
2014-12-31  92.419998  93.129997  92.059998  92.449997  11337200  86.334363

[1258 rows x 6 columns]

In [23]:
df['Adj Close'].plot();
plot.show();



In [ ]: