title stringlengths 1 185 | diff stringlengths 0 32.2M | body stringlengths 0 123k ⌀ | url stringlengths 57 58 | created_at stringlengths 20 20 | closed_at stringlengths 20 20 | merged_at stringlengths 20 20 ⌀ | updated_at stringlengths 20 20 |
|---|---|---|---|---|---|---|---|
DOC: Remove quasi-non-public parts of Index API from API docs | diff --git a/doc/source/api.rst b/doc/source/api.rst
index 4ecde7e05256a..c442f2c48cd81 100644
--- a/doc/source/api.rst
+++ b/doc/source/api.rst
@@ -972,31 +972,31 @@ used before calling these methods directly.**
Index
-Modifying and Computations
-~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set Operations
+~~~~~~~~~~~~~~
.. autosummary::
:toctree: generated/
- Index.copy
- Index.delete
Index.diff
- Index.drop
+ Index.intersection
+ Index.union
+
+Comparisons and Metadata
+~~~~~~~~~~~~~~~~~~~~~~~~
+.. autosummary::
+ :toctree: generated/
+
+ Index.copy
Index.equals
Index.identical
- Index.insert
- Index.order
- Index.reindex
- Index.repeat
Index.set_names
- Index.unique
-Conversion
-~~~~~~~~~~
+Type Conversions
+~~~~~~~~~~~~~~~~
.. autosummary::
:toctree: generated/
- Index.astype
- Index.tolist
Index.to_datetime
Index.to_series
@@ -1005,49 +1005,8 @@ Sorting
.. autosummary::
:toctree: generated/
- Index.argsort
- Index.order
Index.sort
-Time-specific operations
-~~~~~~~~~~~~~~~~~~~~~~~~
-.. autosummary::
- :toctree: generated/
-
- Index.shift
-
-Combining / joining / merging
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. autosummary::
- :toctree: generated/
-
- Index.append
- Index.intersection
- Index.join
- Index.union
-
-Selecting
-~~~~~~~~~
-.. autosummary::
- :toctree: generated/
-
- Index.get_indexer
- Index.get_indexer_non_unique
- Index.get_level_values
- Index.get_loc
- Index.get_value
- Index.isin
- Index.slice_indexer
- Index.slice_locs
-
-Properties
-~~~~~~~~~~
-.. autosummary::
- :toctree: generated/
-
- Index.is_monotonic
- Index.is_numeric
-
.. _api.datetimeindex:
DatetimeIndex
@@ -1058,39 +1017,6 @@ DatetimeIndex
DatetimeIndex
-Time/Date Components
-~~~~~~~~~~~~~~~~~~~~
-
-.. autosummary::
- :toctree: generated/
-
- DatetimeIndex.year
- DatetimeIndex.month
- DatetimeIndex.day
- DatetimeIndex.hour
- DatetimeIndex.minute
- DatetimeIndex.second
- DatetimeIndex.microsecond
- DatetimeIndex.nanosecond
- DatetimeIndex.date
- DatetimeIndex.time
- DatetimeIndex.dayofyear
- DatetimeIndex.weekofyear
- DatetimeIndex.week
- DatetimeIndex.dayofweek
- DatetimeIndex.weekday
- DatetimeIndex.quarter
-
-
-Selecting
-~~~~~~~~~
-.. autosummary::
- :toctree: generated/
-
- DatetimeIndex.indexer_at_time
- DatetimeIndex.indexer_between_time
-
-
Time-specific operations
~~~~~~~~~~~~~~~~~~~~~~~~
.. autosummary::
| We added some notes on Index to the API Reference that probably
shouldn't be there at all, since they're not meant for public
consumption or not documented. I've slimmed down the methods to set
ops, copy, metadata (i.e. names) and a few of the DatetimeIndex methods.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5621 | 2013-11-30T16:10:11Z | 2014-02-18T20:05:24Z | null | 2014-06-15T18:49:12Z |
RLS: first release candidate for v0.13 | diff --git a/setup.py b/setup.py
index 44229fa64d4cd..cf9d036f1b1ff 100755
--- a/setup.py
+++ b/setup.py
@@ -189,11 +189,11 @@ def build_extensions(self):
]
MAJOR = 0
-MINOR = 12
+MINOR = 13
MICRO = 0
-ISRELEASED = False
+ISRELEASED = True
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
-QUALIFIER = ''
+QUALIFIER = 'rc1'
FULLVERSION = VERSION
if not ISRELEASED:
| https://api.github.com/repos/pandas-dev/pandas/pulls/5617 | 2013-11-29T18:10:35Z | 2013-11-29T20:53:06Z | 2013-11-29T20:53:06Z | 2014-07-16T08:42:08Z | |
DOC: SQL to pandas comparison (#4524) | diff --git a/doc/source/comparison_with_sql.rst b/doc/source/comparison_with_sql.rst
new file mode 100644
index 0000000000000..3d8b85e9460c4
--- /dev/null
+++ b/doc/source/comparison_with_sql.rst
@@ -0,0 +1,380 @@
+.. currentmodule:: pandas
+.. _compare_with_sql:
+
+Comparison with SQL
+********************
+Since many potential pandas users have some familiarity with
+`SQL <http://en.wikipedia.org/wiki/SQL>`_, this page is meant to provide some examples of how
+various SQL operations would be performed using pandas.
+
+If you're new to pandas, you might want to first read through :ref:`10 Minutes to Pandas<10min>`
+to familiarize yourself with the library.
+
+As is customary, we import pandas and numpy as follows:
+
+.. ipython:: python
+
+ import pandas as pd
+ import numpy as np
+
+Most of the examples will utilize the ``tips`` dataset found within pandas tests. We'll read
+the data into a DataFrame called `tips` and assume we have a database table of the same name and
+structure.
+
+.. ipython:: python
+
+ url = 'https://raw.github.com/pydata/pandas/master/pandas/tests/data/tips.csv'
+ tips = pd.read_csv(url)
+ tips.head()
+
+SELECT
+------
+In SQL, selection is done using a comma-separated list of columns you'd like to select (or a ``*``
+to select all columns):
+
+.. code-block:: sql
+
+ SELECT total_bill, tip, smoker, time
+ FROM tips
+ LIMIT 5;
+
+With pandas, column selection is done by passing a list of column names to your DataFrame:
+
+.. ipython:: python
+
+ tips[['total_bill', 'tip', 'smoker', 'time']].head(5)
+
+Calling the DataFrame without the list of column names would display all columns (akin to SQL's
+``*``).
+
+WHERE
+-----
+Filtering in SQL is done via a WHERE clause.
+
+.. code-block:: sql
+
+ SELECT *
+ FROM tips
+ WHERE time = 'Dinner'
+ LIMIT 5;
+
+DataFrames can be filtered in multiple ways; the most intuitive of which is using
+`boolean indexing <http://pandas.pydata.org/pandas-docs/stable/indexing.html#boolean-indexing>`_.
+
+.. ipython:: python
+
+ tips[tips['time'] == 'Dinner'].head(5)
+
+The above statement is simply passing a ``Series`` of True/False objects to the DataFrame,
+returning all rows with True.
+
+.. ipython:: python
+
+ is_dinner = tips['time'] == 'Dinner'
+ is_dinner.value_counts()
+ tips[is_dinner].head(5)
+
+Just like SQL's OR and AND, multiple conditions can be passed to a DataFrame using | (OR) and &
+(AND).
+
+.. code-block:: sql
+
+ -- tips of more than $5.00 at Dinner meals
+ SELECT *
+ FROM tips
+ WHERE time = 'Dinner' AND tip > 5.00;
+
+.. ipython:: python
+
+ # tips of more than $5.00 at Dinner meals
+ tips[(tips['time'] == 'Dinner') & (tips['tip'] > 5.00)]
+
+.. code-block:: sql
+
+ -- tips by parties of at least 5 diners OR bill total was more than $45
+ SELECT *
+ FROM tips
+ WHERE size >= 5 OR total_bill > 45;
+
+.. ipython:: python
+
+ # tips by parties of at least 5 diners OR bill total was more than $45
+ tips[(tips['size'] >= 5) | (tips['total_bill'] > 45)]
+
+NULL checking is done using the :meth:`~pandas.Series.notnull` and :meth:`~pandas.Series.isnull`
+methods.
+
+.. ipython:: python
+
+ frame = pd.DataFrame({'col1': ['A', 'B', np.NaN, 'C', 'D'],
+ 'col2': ['F', np.NaN, 'G', 'H', 'I']})
+ frame
+
+Assume we have a table of the same structure as our DataFrame above. We can see only the records
+where ``col2`` IS NULL with the following query:
+
+.. code-block:: sql
+
+ SELECT *
+ FROM frame
+ WHERE col2 IS NULL;
+
+.. ipython:: python
+
+ frame[frame['col2'].isnull()]
+
+Getting items where ``col1`` IS NOT NULL can be done with :meth:`~pandas.Series.notnull`.
+
+.. code-block:: sql
+
+ SELECT *
+ FROM frame
+ WHERE col1 IS NOT NULL;
+
+.. ipython:: python
+
+ frame[frame['col1'].notnull()]
+
+
+GROUP BY
+--------
+In pandas, SQL's GROUP BY operations performed using the similarly named
+:meth:`~pandas.DataFrame.groupby` method. :meth:`~pandas.DataFrame.groupby` typically refers to a
+process where we'd like to split a dataset into groups, apply some function (typically aggregation)
+, and then combine the groups together.
+
+A common SQL operation would be getting the count of records in each group throughout a dataset.
+For instance, a query getting us the number of tips left by sex:
+
+.. code-block:: sql
+
+ SELECT sex, count(*)
+ FROM tips
+ GROUP BY sex;
+ /*
+ Female 87
+ Male 157
+ */
+
+
+The pandas equivalent would be:
+
+.. ipython:: python
+
+ tips.groupby('sex').size()
+
+Notice that in the pandas code we used :meth:`~pandas.DataFrameGroupBy.size` and not
+:meth:`~pandas.DataFrameGroupBy.count`. This is because :meth:`~pandas.DataFrameGroupBy.count`
+applies the function to each column, returning the number of ``not null`` records within each.
+
+.. ipython:: python
+
+ tips.groupby('sex').count()
+
+Alternatively, we could have applied the :meth:`~pandas.DataFrameGroupBy.count` method to an
+individual column:
+
+.. ipython:: python
+
+ tips.groupby('sex')['total_bill'].count()
+
+Multiple functions can also be applied at once. For instance, say we'd like to see how tip amount
+differs by day of the week - :meth:`~pandas.DataFrameGroupBy.agg` allows you to pass a dictionary
+to your grouped DataFrame, indicating which functions to apply to specific columns.
+
+.. code-block:: sql
+
+ SELECT day, AVG(tip), COUNT(*)
+ FROM tips
+ GROUP BY day;
+ /*
+ Fri 2.734737 19
+ Sat 2.993103 87
+ Sun 3.255132 76
+ Thur 2.771452 62
+ */
+
+.. ipython:: python
+
+ tips.groupby('day').agg({'tip': np.mean, 'day': np.size})
+
+Grouping by more than one column is done by passing a list of columns to the
+:meth:`~pandas.DataFrame.groupby` method.
+
+.. code-block:: sql
+
+ SELECT smoker, day, COUNT(*), AVG(tip)
+ FROM tip
+ GROUP BY smoker, day;
+ /*
+ smoker day
+ No Fri 4 2.812500
+ Sat 45 3.102889
+ Sun 57 3.167895
+ Thur 45 2.673778
+ Yes Fri 15 2.714000
+ Sat 42 2.875476
+ Sun 19 3.516842
+ Thur 17 3.030000
+ */
+
+.. ipython:: python
+
+ tips.groupby(['smoker', 'day']).agg({'tip': [np.size, np.mean]})
+
+.. _compare_with_sql.join:
+
+JOIN
+----
+JOINs can be performed with :meth:`~pandas.DataFrame.join` or :meth:`~pandas.merge`. By default,
+:meth:`~pandas.DataFrame.join` will join the DataFrames on their indices. Each method has
+parameters allowing you to specify the type of join to perform (LEFT, RIGHT, INNER, FULL) or the
+columns to join on (column names or indices).
+
+.. ipython:: python
+
+ df1 = pd.DataFrame({'key': ['A', 'B', 'C', 'D'],
+ 'value': np.random.randn(4)})
+ df2 = pd.DataFrame({'key': ['B', 'D', 'D', 'E'],
+ 'value': np.random.randn(4)})
+
+Assume we have two database tables of the same name and structure as our DataFrames.
+
+Now let's go over the various types of JOINs.
+
+INNER JOIN
+~~~~~~~~~~
+.. code-block:: sql
+
+ SELECT *
+ FROM df1
+ INNER JOIN df2
+ ON df1.key = df2.key;
+
+.. ipython:: python
+
+ # merge performs an INNER JOIN by default
+ pd.merge(df1, df2, on='key')
+
+:meth:`~pandas.merge` also offers parameters for cases when you'd like to join one DataFrame's
+column with another DataFrame's index.
+
+.. ipython:: python
+
+ indexed_df2 = df2.set_index('key')
+ pd.merge(df1, indexed_df2, left_on='key', right_index=True)
+
+LEFT OUTER JOIN
+~~~~~~~~~~~~~~~
+.. code-block:: sql
+
+ -- show all records from df1
+ SELECT *
+ FROM df1
+ LEFT OUTER JOIN df2
+ ON df1.key = df2.key;
+
+.. ipython:: python
+
+ # show all records from df1
+ pd.merge(df1, df2, on='key', how='left')
+
+RIGHT JOIN
+~~~~~~~~~~
+.. code-block:: sql
+
+ -- show all records from df2
+ SELECT *
+ FROM df1
+ RIGHT OUTER JOIN df2
+ ON df1.key = df2.key;
+
+.. ipython:: python
+
+ # show all records from df2
+ pd.merge(df1, df2, on='key', how='right')
+
+FULL JOIN
+~~~~~~~~~
+pandas also allows for FULL JOINs, which display both sides of the dataset, whether or not the
+joined columns find a match. As of writing, FULL JOINs are not supported in all RDBMS (MySQL).
+
+.. code-block:: sql
+
+ -- show all records from both tables
+ SELECT *
+ FROM df1
+ FULL OUTER JOIN df2
+ ON df1.key = df2.key;
+
+.. ipython:: python
+
+ # show all records from both frames
+ pd.merge(df1, df2, on='key', how='outer')
+
+
+UNION
+-----
+UNION ALL can be performed using :meth:`~pandas.concat`.
+
+.. ipython:: python
+
+ df1 = pd.DataFrame({'city': ['Chicago', 'San Francisco', 'New York City'],
+ 'rank': range(1, 4)})
+ df2 = pd.DataFrame({'city': ['Chicago', 'Boston', 'Los Angeles'],
+ 'rank': [1, 4, 5]})
+
+.. code-block:: sql
+
+ SELECT city, rank
+ FROM df1
+ UNION ALL
+ SELECT city, rank
+ FROM df2;
+ /*
+ city rank
+ Chicago 1
+ San Francisco 2
+ New York City 3
+ Chicago 1
+ Boston 4
+ Los Angeles 5
+ */
+
+.. ipython:: python
+
+ pd.concat([df1, df2])
+
+SQL's UNION is similar to UNION ALL, however UNION will remove duplicate rows.
+
+.. code-block:: sql
+
+ SELECT city, rank
+ FROM df1
+ UNION
+ SELECT city, rank
+ FROM df2;
+ -- notice that there is only one Chicago record this time
+ /*
+ city rank
+ Chicago 1
+ San Francisco 2
+ New York City 3
+ Boston 4
+ Los Angeles 5
+ */
+
+In pandas, you can use :meth:`~pandas.concat` in conjunction with
+:meth:`~pandas.DataFrame.drop_duplicates`.
+
+.. ipython:: python
+
+ pd.concat([df1, df2]).drop_duplicates()
+
+
+UPDATE
+------
+
+
+DELETE
+------
\ No newline at end of file
diff --git a/doc/source/index.rst b/doc/source/index.rst
index 02e193cdb6938..c406c4f2cfa27 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -132,5 +132,6 @@ See the package overview for more detail about what's in the library.
r_interface
related
comparison_with_r
+ comparison_with_sql
api
release
diff --git a/doc/source/merging.rst b/doc/source/merging.rst
index a68fc6e0739d5..8f1eb0dc779be 100644
--- a/doc/source/merging.rst
+++ b/doc/source/merging.rst
@@ -305,7 +305,10 @@ better) than other open source implementations (like ``base::merge.data.frame``
in R). The reason for this is careful algorithmic design and internal layout of
the data in DataFrame.
-See the :ref:`cookbook<cookbook.merge>` for some advanced strategies
+See the :ref:`cookbook<cookbook.merge>` for some advanced strategies.
+
+Users who are familiar with SQL but new to pandas might be interested in a
+:ref:`comparison with SQL<compare_with_sql.join>`.
pandas provides a single function, ``merge``, as the entry point for all
standard database join operations between DataFrame objects:
diff --git a/doc/source/v0.13.0.txt b/doc/source/v0.13.0.txt
index a39e415abe519..9f410cf7b4f8b 100644
--- a/doc/source/v0.13.0.txt
+++ b/doc/source/v0.13.0.txt
@@ -10,6 +10,9 @@ Highlights include support for a new index type ``Float64Index``, support for ne
Several experimental features are added, including new ``eval/query`` methods for expression evaluation, support for ``msgpack`` serialization,
and an io interface to Google's ``BigQuery``.
+The docs also received a new section, :ref:`Comparison with SQL<compare_with_sql>`, which should
+be useful for those familiar with SQL but still learning pandas.
+
.. warning::
In 0.13.0 ``Series`` has internally been refactored to no longer sub-class ``ndarray``
| @jtratner I was a little slower moving on this than I'd hoped, but it's a pretty good start.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5615 | 2013-11-29T06:15:33Z | 2013-12-07T00:40:20Z | 2013-12-07T00:40:20Z | 2014-06-17T19:04:21Z |
BUG: repr formating to use iloc rather than getitem for element access (GH5605) | diff --git a/pandas/core/format.py b/pandas/core/format.py
index cc6f5bd516a19..8bc74f2ff4c08 100644
--- a/pandas/core/format.py
+++ b/pandas/core/format.py
@@ -284,6 +284,7 @@ def __init__(self, frame, buf=None, columns=None, col_space=None,
self.line_width = line_width
self.max_rows = max_rows
self.max_cols = max_cols
+ self.max_rows_displayed = min(max_rows or len(self.frame),len(self.frame))
self.show_dimensions = show_dimensions
if justify is None:
@@ -483,7 +484,7 @@ def write(buf, frame, column_format, strcols):
def _format_col(self, i):
formatter = self._get_formatter(i)
- return format_array(self.frame.icol(i)[:self.max_rows].get_values(),
+ return format_array((self.frame.iloc[:self.max_rows_displayed,i]).get_values(),
formatter, float_format=self.float_format,
na_rep=self.na_rep,
space=self.col_space)
diff --git a/pandas/tests/test_format.py b/pandas/tests/test_format.py
index 8e23176e9d005..fce2bdceba570 100644
--- a/pandas/tests/test_format.py
+++ b/pandas/tests/test_format.py
@@ -1455,6 +1455,22 @@ def test_repr_html_long(self):
assert u('%d rows ') % h in long_repr
assert u('2 columns') in long_repr
+ def test_repr_html_float(self):
+ max_rows = get_option('display.max_rows')
+ h = max_rows - 1
+ df = pandas.DataFrame({'idx':np.linspace(-10,10,h), 'A':np.arange(1,1+h), 'B': np.arange(41, 41+h) }).set_index('idx')
+ reg_repr = df._repr_html_()
+ assert '...' not in reg_repr
+ assert str(40 + h) in reg_repr
+
+ h = max_rows + 1
+ df = pandas.DataFrame({'idx':np.linspace(-10,10,h), 'A':np.arange(1,1+h), 'B': np.arange(41, 41+h) }).set_index('idx')
+ long_repr = df._repr_html_()
+ assert '...' in long_repr
+ assert str(40 + h) not in long_repr
+ assert u('%d rows ') % h in long_repr
+ assert u('2 columns') in long_repr
+
def test_repr_html_long_multiindex(self):
max_rows = get_option('display.max_rows')
max_L1 = max_rows//2
| closes #5605
| https://api.github.com/repos/pandas-dev/pandas/pulls/5606 | 2013-11-28T02:33:38Z | 2013-11-28T03:19:25Z | 2013-11-28T03:19:24Z | 2014-07-04T06:16:27Z |
Expand groupby dispatch whitelist (GH5480) | diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py
index c635baa0e2739..7a7fe32963457 100644
--- a/pandas/core/groupby.py
+++ b/pandas/core/groupby.py
@@ -50,13 +50,30 @@
# forwarding methods from NDFrames
_plotting_methods = frozenset(['plot', 'boxplot', 'hist'])
-_apply_whitelist = frozenset(['last', 'first',
- 'mean', 'sum', 'min', 'max',
- 'cumsum', 'cumprod', 'cummin', 'cummax',
- 'resample',
- 'describe',
- 'rank', 'quantile', 'count',
- 'fillna', 'dtype']) | _plotting_methods
+_common_apply_whitelist = frozenset([
+ 'last', 'first',
+ 'head', 'tail', 'median',
+ 'mean', 'sum', 'min', 'max',
+ 'cumsum', 'cumprod', 'cummin', 'cummax', 'cumcount',
+ 'resample',
+ 'describe',
+ 'rank', 'quantile', 'count',
+ 'fillna',
+ 'mad',
+ 'any', 'all',
+ 'irow', 'take',
+ 'shift', 'tshift',
+ 'ffill', 'bfill',
+ 'pct_change', 'skew',
+ 'corr', 'cov',
+]) | _plotting_methods
+
+_series_apply_whitelist = \
+ (_common_apply_whitelist - set(['boxplot'])) | \
+ frozenset(['dtype', 'value_counts'])
+
+_dataframe_apply_whitelist = \
+ _common_apply_whitelist | frozenset(['dtypes', 'corrwith'])
class GroupByError(Exception):
@@ -185,6 +202,7 @@ class GroupBy(PandasObject):
len(grouped) : int
Number of groups
"""
+ _apply_whitelist = _common_apply_whitelist
def __init__(self, obj, keys=None, axis=0, level=None,
grouper=None, exclusions=None, selection=None, as_index=True,
@@ -252,7 +270,7 @@ def _selection_list(self):
return self._selection
def _local_dir(self):
- return sorted(set(self.obj._local_dir() + list(_apply_whitelist)))
+ return sorted(set(self.obj._local_dir() + list(self._apply_whitelist)))
def __getattr__(self, attr):
if attr in self.obj:
@@ -268,7 +286,7 @@ def __getitem__(self, key):
raise NotImplementedError
def _make_wrapper(self, name):
- if name not in _apply_whitelist:
+ if name not in self._apply_whitelist:
is_callable = callable(getattr(self.obj, name, None))
kind = ' callable ' if is_callable else ' '
msg = ("Cannot access{0}attribute {1!r} of {2!r} objects, try "
@@ -1605,6 +1623,7 @@ def _convert_grouper(axis, grouper):
class SeriesGroupBy(GroupBy):
+ _apply_whitelist = _series_apply_whitelist
def aggregate(self, func_or_funcs, *args, **kwargs):
"""
@@ -2401,6 +2420,7 @@ def add_indices():
class DataFrameGroupBy(NDFrameGroupBy):
+ _apply_whitelist = _dataframe_apply_whitelist
_block_agg_axis = 1
diff --git a/pandas/tests/test_groupby.py b/pandas/tests/test_groupby.py
index 76fee1702d64a..6802b57bc39d1 100644
--- a/pandas/tests/test_groupby.py
+++ b/pandas/tests/test_groupby.py
@@ -3221,10 +3221,67 @@ def test_groupby_whitelist(self):
'letters': Series(random_letters)})
s = df.floats
- blacklist = ['eval', 'query', 'abs', 'shift', 'tshift', 'where',
- 'mask', 'align', 'groupby', 'clip', 'astype',
- 'at', 'combine', 'consolidate', 'convert_objects',
- 'corr', 'corr_with', 'cov']
+ df_whitelist = frozenset([
+ 'last', 'first',
+ 'mean', 'sum', 'min', 'max',
+ 'head', 'tail',
+ 'cumsum', 'cumprod', 'cummin', 'cummax', 'cumcount',
+ 'resample',
+ 'describe',
+ 'rank', 'quantile', 'count',
+ 'fillna',
+ 'mad',
+ 'any', 'all',
+ 'irow', 'take',
+ 'shift', 'tshift',
+ 'ffill', 'bfill',
+ 'pct_change', 'skew',
+ 'plot', 'boxplot', 'hist',
+ 'median', 'dtypes',
+ 'corrwith', 'corr', 'cov',
+ ])
+ s_whitelist = frozenset([
+ 'last', 'first',
+ 'mean', 'sum', 'min', 'max',
+ 'head', 'tail',
+ 'cumsum', 'cumprod', 'cummin', 'cummax', 'cumcount',
+ 'resample',
+ 'describe',
+ 'rank', 'quantile', 'count',
+ 'fillna',
+ 'mad',
+ 'any', 'all',
+ 'irow', 'take',
+ 'shift', 'tshift',
+ 'ffill', 'bfill',
+ 'pct_change', 'skew',
+ 'plot', 'hist',
+ 'median', 'dtype',
+ 'corr', 'cov',
+ 'value_counts',
+ ])
+
+ for obj, whitelist in zip((df, s),
+ (df_whitelist, s_whitelist)):
+ gb = obj.groupby(df.letters)
+ self.assertEqual(whitelist, gb._apply_whitelist)
+ for m in whitelist:
+ getattr(gb, m)
+
+ def test_groupby_blacklist(self):
+ from string import ascii_lowercase
+ letters = np.array(list(ascii_lowercase))
+ N = 10
+ random_letters = letters.take(np.random.randint(0, 26, N))
+ df = DataFrame({'floats': N / 10 * Series(np.random.random(N)),
+ 'letters': Series(random_letters)})
+ s = df.floats
+
+ blacklist = [
+ 'eval', 'query', 'abs', 'where',
+ 'mask', 'align', 'groupby', 'clip', 'astype',
+ 'at', 'combine', 'consolidate', 'convert_objects',
+ ]
to_methods = [method for method in dir(df) if method.startswith('to_')]
blacklist.extend(to_methods)
@@ -3319,8 +3376,12 @@ def test_tab_completion(self):
'groups','hist','indices','last','max','mean','median',
'min','name','ngroups','nth','ohlc','plot', 'prod',
'size','std','sum','transform','var', 'count', 'head', 'describe',
- 'cummax', 'dtype', 'quantile', 'rank', 'cumprod', 'tail',
- 'resample', 'cummin', 'fillna', 'cumsum', 'cumcount'])
+ 'cummax', 'quantile', 'rank', 'cumprod', 'tail',
+ 'resample', 'cummin', 'fillna', 'cumsum', 'cumcount',
+ 'all', 'shift', 'skew', 'bfill', 'irow', 'ffill',
+ 'take', 'tshift', 'pct_change', 'any', 'mad', 'corr', 'corrwith',
+ 'cov', 'dtypes',
+ ])
self.assertEqual(results, expected)
def assert_fp_equal(a, b):
| (and create a groupby dispatch blacklist)
closes #5480.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5604 | 2013-11-28T00:56:41Z | 2013-12-07T14:16:56Z | 2013-12-07T14:16:56Z | 2014-07-06T11:29:07Z |
ENH: Added method to pandas.data.Options to download all option data for... | diff --git a/doc/source/release.rst b/doc/source/release.rst
index fb2c24acff30d..da6c46ce37a94 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -55,6 +55,10 @@ performance improvements along with a large number of bug fixes.
Highlights include:
+Experimental Features
+~~~~~~~~~~~~~~~~~~~~~
+- ``pandas.io.data.Options`` has a get_all_data method and now consistently returns a multi-indexed ''DataFrame'' (:issue:`5602`)
+
See the :ref:`v0.14.1 Whatsnew <whatsnew_0141>` overview or the issue tracker on GitHub for an extensive list
of all API changes, enhancements and bugs that have been fixed in 0.14.1.
diff --git a/doc/source/remote_data.rst b/doc/source/remote_data.rst
index b0cd96cac6f5f..aae36ee1d54b3 100644
--- a/doc/source/remote_data.rst
+++ b/doc/source/remote_data.rst
@@ -52,6 +52,43 @@ Yahoo! Finance
f=web.DataReader("F", 'yahoo', start, end)
f.ix['2010-01-04']
+.. _remote_data.yahoo_Options:
+
+Yahoo! Finance Options
+----------------------
+***Experimental***
+
+The Options class allows the download of options data from Yahoo! Finance.
+
+The ''get_all_data'' method downloads and caches option data for all expiry months
+and provides a formatted ''DataFrame'' with a hierarchical index, so its easy to get
+to the specific option you want.
+
+.. ipython:: python
+
+ from pandas.io.data import Options
+ aapl = Options('aapl', 'yahoo')
+ data = aapl.get_all_data()
+ data.head()
+
+ #Show the $600 strike puts at all expiry dates:
+ data.loc[(600, slice(None), 'put'),:].head()
+
+ #Show the volume traded of $600 strike puts at all expiry dates:
+ data.loc[(600, slice(None), 'put'),'Vol'].head()
+
+If you don't want to download all the data, more specific requests can be made.
+
+.. ipython:: python
+
+ import datetime
+ expiry = datetime.date(2016, 1, 1)
+ data = aapl.get_call_data(expiry=expiry)
+ data.head()
+
+Note that if you call ''get_all_data'' first, this second call will happen much faster, as the data is cached.
+
+
.. _remote_data.google:
Google Finance
diff --git a/doc/source/v0.14.1.txt b/doc/source/v0.14.1.txt
index 4959f52183a92..b72d48735d39a 100644
--- a/doc/source/v0.14.1.txt
+++ b/doc/source/v0.14.1.txt
@@ -148,7 +148,23 @@ Performance
Experimental
~~~~~~~~~~~~
-There are no experimental changes in 0.14.1
+``pandas.io.data.Options`` has a get_all_data method and now consistently returns a multi-indexed ''DataFrame'' (PR `#5602`)
+ See :ref:`the docs<remote_data.yahoo_Options>` ***Experimental***
+
+ .. ipython:: python
+
+ from pandas.io.data import Options
+ aapl = Options('aapl', 'yahoo')
+ data = aapl.get_all_data()
+ data.head()
+
+ .. ipython:: python
+
+ from pandas.io.data import Options
+ aapl = Options('aapl', 'yahoo')
+ data = aapl.get_all_data()
+ data.head()
+
.. _whatsnew_0141.bug_fixes:
diff --git a/pandas/io/data.py b/pandas/io/data.py
index 525a7ce64f0c2..fe87c0d9fb5e7 100644
--- a/pandas/io/data.py
+++ b/pandas/io/data.py
@@ -16,10 +16,11 @@
StringIO, bytes_to_str, range, lrange, lmap, zip
)
import pandas.compat as compat
-from pandas import Panel, DataFrame, Series, read_csv, concat
+from pandas import Panel, DataFrame, Series, read_csv, concat, to_datetime
from pandas.core.common import is_list_like, PandasError
from pandas.io.parsers import TextParser
from pandas.io.common import urlopen, ZipFile, urlencode
+from pandas.tseries.offsets import MonthBegin
from pandas.util.testing import _network_error_classes
@@ -518,12 +519,21 @@ def get_data_famafrench(name):
# Items needed for options class
CUR_MONTH = dt.datetime.now().month
CUR_YEAR = dt.datetime.now().year
-
+CUR_DAY = dt.datetime.now().day
def _unpack(row, kind):
- els = row.xpath('.//%s' % kind)
- return [val.text_content() for val in els]
+ def _parse_row_values(val):
+ ret = val.text_content()
+ if 'neg_arrow' in val.xpath('.//@class'):
+ try:
+ ret = float(ret.replace(',', ''))*(-1.0)
+ except ValueError:
+ ret = np.nan
+
+ return ret
+ els = row.xpath('.//%s' % kind)
+ return [_parse_row_values(val) for val in els]
def _parse_options_data(table):
rows = table.xpath('.//tr')
@@ -540,42 +550,49 @@ def _two_char_month(s):
class Options(object):
"""
+ ***Experimental***
This class fetches call/put data for a given stock/expiry month.
It is instantiated with a string representing the ticker symbol.
The class has the following methods:
- get_options:(month, year)
- get_calls:(month, year)
- get_puts: (month, year)
+ get_options_data:(month, year, expiry)
+ get_call_data:(month, year, expiry)
+ get_put_data: (month, year, expiry)
get_near_stock_price(opt_frame, above_below)
- get_forward(months, call, put)
+ get_all_data(call, put)
+ get_forward_data(months, call, put) (deprecated)
Examples
--------
# Instantiate object with ticker
>>> aapl = Options('aapl', 'yahoo')
- # Fetch September 2012 call data
- >>> calls = aapl.get_calls(9, 2012)
+ # Fetch May 2014 call data
+ >>> expiry = datetime.date(2014, 5, 1)
+ >>> calls = aapl.get_call_data(expiry=expiry)
# Can now access aapl.calls instance variable
>>> aapl.calls
- # Fetch September 2012 put data
- >>> puts = aapl.get_puts(9, 2012)
+ # Fetch May 2014 put data
+ >>> puts = aapl.get_put_data(expiry=expiry)
# Can now access aapl.puts instance variable
>>> aapl.puts
# cut down the call data to be 3 below and 3 above the stock price.
- >>> cut_calls = aapl.get_near_stock_price(calls, above_below=3)
+ >>> cut_calls = aapl.get_near_stock_price(call=True, above_below=3)
# Fetch call and put data with expiry from now to 8 months out
- >>> forward_calls, forward_puts = aapl.get_forward_data(8,
- ... call=True, put=True)
+ >>> forward_data = aapl.get_forward_data(8, call=True, put=True)
+ # Fetch all call and put data
+ >>> all_data = aapl.get_all_data()
"""
+
+ _TABLE_LOC = {'calls': 9, 'puts': 13}
+
def __init__(self, symbol, data_source=None):
""" Instantiates options_data with a ticker saved as symbol """
self.symbol = symbol.upper()
@@ -588,6 +605,7 @@ def __init__(self, symbol, data_source=None):
def get_options_data(self, month=None, year=None, expiry=None):
"""
+ ***Experimental***
Gets call/put data for the stock with the expiration data in the
given month and year
@@ -598,15 +616,30 @@ def get_options_data(self, month=None, year=None, expiry=None):
Returns
-------
- call_data: pandas.DataFrame
- A DataFrame with call options data.
-
- put_data: pandas.DataFrame
- A DataFrame with call options data.
-
+ pandas.DataFrame
+ A DataFrame with requested options data.
+
+ Index:
+ Strike: Option strike, int
+ Expiry: Option expiry, datetime.date
+ Type: Call or Put, string
+ Symbol: Option symbol as reported on Yahoo, string
+ Columns:
+ Last: Last option price, float
+ Chg: Change from prior day, float
+ Bid: Bid price, float
+ Ask: Ask price, float
+ Vol: Volume traded, int64
+ Open_Int: Open interest, int64
+ IsNonstandard: True if the the deliverable is not 100 shares, otherwise false
+ Underlying: Ticker of the underlying security, string
+ Underlying_Price: Price of the underlying security, float64
+ Quote_Time: Time of the quote, Timestamp
Notes
-----
+ Note: Format of returned data frame is dependent on Yahoo and may change.
+
When called, this function will add instance variables named
calls and puts. See the following example:
@@ -618,67 +651,96 @@ def get_options_data(self, month=None, year=None, expiry=None):
Also note that aapl.calls and appl.puts will always be the calls
and puts for the next expiry. If the user calls this method with
a different month or year, the ivar will be named callsMMYY or
- putsMMYY where MM and YY are, repsectively, two digit
+ putsMMYY where MM and YY are, respectively, two digit
representations of the month and year for the expiry of the
options.
"""
- return [f(month, year, expiry) for f in (self.get_put_data,
- self.get_call_data)]
+ return concat([f(month, year, expiry)
+ for f in (self.get_put_data,
+ self.get_call_data)]).sortlevel()
_OPTIONS_BASE_URL = 'http://finance.yahoo.com/q/op?s={sym}'
- def _get_option_data(self, month, year, expiry, table_loc, name):
- if (month is None or year is None) and expiry is None:
- msg = "You must specify either (`year` and `month`) or `expiry`."
- raise ValueError(msg)
+ def _get_option_tables(self, month, year, expiry):
- year, month = self._try_parse_dates(year, month, expiry)
+ year, month, expiry = self._try_parse_dates(year, month, expiry)
url = self._OPTIONS_BASE_URL.format(sym=self.symbol)
if month and year: # try to get specified month from yahoo finance
- m1, m2 = _two_char_month(month), month
+ m1 = _two_char_month(month)
# if this month use other url
- if m1 != CUR_MONTH and m2 != CUR_MONTH:
- url += '&m={year}-{m1}'.format(year=year, m1=m1)
- else:
+ if month == CUR_MONTH and year == CUR_YEAR:
url += '+Options'
+ else:
+ url += '&m={year}-{m1}'.format(year=year, m1=m1)
else: # Default to current month
url += '+Options'
- try:
- from lxml.html import parse
- except ImportError:
- raise ImportError("Please install lxml if you want to use the "
- "{0!r} class".format(self.__class__.__name__))
- try:
- doc = parse(url)
- except _network_error_classes:
- raise RemoteDataError("Unable to parse tables from URL "
- "{0!r}".format(url))
+ root = self._parse_url(url)
+ tables = root.xpath('.//table')
+ table_name = '_tables' + m1 + str(year)[-2:]
+ setattr(self, table_name, tables)
+
+ self.underlying_price, self.quote_time = self._get_underlying_price(root)
+
+ return tables
+
+ def _get_underlying_price(self, root):
+ underlying_price = float(root.xpath('.//*[@class="time_rtq_ticker"]')[0]\
+ .getchildren()[0].text)
+
+ #Gets the time of the quote, note this is actually the time of the underlying price.
+ quote_time_text = root.xpath('.//*[@class="time_rtq"]')[0].getchildren()[0].text
+ if quote_time_text:
+ #weekend and prior to market open time format
+ split = quote_time_text.split(",")
+ timesplit = split[1].strip().split(":")
+ timestring = split[0] + ", " + timesplit[0].zfill(2) + ":" + timesplit[1]
+ quote_time = dt.datetime.strptime(timestring, "%b %d, %H:%M%p EDT")
+ quote_time = quote_time.replace(year=CUR_YEAR)
else:
- root = doc.getroot()
- if root is None:
- raise RemoteDataError("Parsed URL {0!r} has no root"
- "element".format(url))
- tables = root.xpath('.//table')
- ntables = len(tables)
- if ntables == 0:
- raise RemoteDataError("No tables found at {0!r}".format(url))
- elif table_loc - 1 > ntables:
- raise IndexError("Table location {0} invalid, {1} tables"
- " found".format(table_loc, ntables))
+ quote_time_text = root.xpath('.//*[@class="time_rtq"]')[0].getchildren()[0].getchildren()[0].text
+ quote_time = dt.datetime.strptime(quote_time_text, "%H:%M%p EDT")
+ quote_time = quote_time.replace(year=CUR_YEAR, month=CUR_MONTH, day=CUR_DAY)
+
+ return underlying_price, quote_time
+
+
+ def _get_option_data(self, month, year, expiry, name):
+ year, month, expiry = self._try_parse_dates(year, month, expiry)
+ m1 = _two_char_month(month)
+ table_name = '_tables' + m1 + str(year)[-2:]
+
+ try:
+ tables = getattr(self, table_name)
+ except AttributeError:
+ tables = self._get_option_tables(month, year, expiry)
+
+ ntables = len(tables)
+ table_loc = self._TABLE_LOC[name]
+ if ntables == 0:
+ raise RemoteDataError("No tables found at {0!r}".format(url))
+ elif table_loc - 1 > ntables:
+ raise IndexError("Table location {0} invalid, {1} tables"
+ " found".format(table_loc, ntables))
option_data = _parse_options_data(tables[table_loc])
+ option_data = self._process_data(option_data)
+ option_data['Type'] = name[:-1]
+ option_data.set_index(['Strike', 'Expiry', 'Type', 'Symbol'], inplace=True)
- if month:
- name += m1 + str(year)[-2:]
+ if month == CUR_MONTH and year == CUR_YEAR:
+ setattr(self, name, option_data)
+
+ name += m1 + str(year)[-2:]
setattr(self, name, option_data)
return option_data
def get_call_data(self, month=None, year=None, expiry=None):
"""
+ ***Experimental***
Gets call/put data for the stock with the expiration data in the
given month and year
@@ -690,10 +752,29 @@ def get_call_data(self, month=None, year=None, expiry=None):
Returns
-------
call_data: pandas.DataFrame
- A DataFrame with call options data.
+ A DataFrame with requested options data.
+
+ Index:
+ Strike: Option strike, int
+ Expiry: Option expiry, datetime.date
+ Type: Call or Put, string
+ Symbol: Option symbol as reported on Yahoo, string
+ Columns:
+ Last: Last option price, float
+ Chg: Change from prior day, float
+ Bid: Bid price, float
+ Ask: Ask price, float
+ Vol: Volume traded, int64
+ Open_Int: Open interest, int64
+ IsNonstandard: True if the the deliverable is not 100 shares, otherwise false
+ Underlying: Ticker of the underlying security, string
+ Underlying_Price: Price of the underlying security, float64
+ Quote_Time: Time of the quote, Timestamp
Notes
-----
+ Note: Format of returned data frame is dependent on Yahoo and may change.
+
When called, this function will add instance variables named
calls and puts. See the following example:
@@ -705,13 +786,14 @@ def get_call_data(self, month=None, year=None, expiry=None):
Also note that aapl.calls will always be the calls for the next
expiry. If the user calls this method with a different month
or year, the ivar will be named callsMMYY where MM and YY are,
- repsectively, two digit representations of the month and year
+ respectively, two digit representations of the month and year
for the expiry of the options.
"""
- return self._get_option_data(month, year, expiry, 9, 'calls')
+ return self._get_option_data(month, year, expiry, 'calls').sortlevel()
def get_put_data(self, month=None, year=None, expiry=None):
"""
+ ***Experimental***
Gets put data for the stock with the expiration data in the
given month and year
@@ -723,10 +805,29 @@ def get_put_data(self, month=None, year=None, expiry=None):
Returns
-------
put_data: pandas.DataFrame
- A DataFrame with call options data.
+ A DataFrame with requested options data.
+
+ Index:
+ Strike: Option strike, int
+ Expiry: Option expiry, datetime.date
+ Type: Call or Put, string
+ Symbol: Option symbol as reported on Yahoo, string
+ Columns:
+ Last: Last option price, float
+ Chg: Change from prior day, float
+ Bid: Bid price, float
+ Ask: Ask price, float
+ Vol: Volume traded, int64
+ Open_Int: Open interest, int64
+ IsNonstandard: True if the the deliverable is not 100 shares, otherwise false
+ Underlying: Ticker of the underlying security, string
+ Underlying_Price: Price of the underlying security, float64
+ Quote_Time: Time of the quote, Timestamp
Notes
-----
+ Note: Format of returned data frame is dependent on Yahoo and may change.
+
When called, this function will add instance variables named
puts. See the following example:
@@ -743,11 +844,12 @@ def get_put_data(self, month=None, year=None, expiry=None):
repsectively, two digit representations of the month and year
for the expiry of the options.
"""
- return self._get_option_data(month, year, expiry, 13, 'puts')
+ return self._get_option_data(month, year, expiry, 'puts').sortlevel()
def get_near_stock_price(self, above_below=2, call=True, put=False,
month=None, year=None, expiry=None):
"""
+ ***Experimental***
Cuts the data frame opt_df that is passed in to only take
options that are near the current stock price.
@@ -774,9 +876,11 @@ def get_near_stock_price(self, above_below=2, call=True, put=False,
The resultant DataFrame chopped down to be 2 * above_below + 1 rows
desired. If there isn't data as far out as the user has asked for
then
+
+ Note: Format of returned data frame is dependent on Yahoo and may change.
+
"""
- year, month = self._try_parse_dates(year, month, expiry)
- price = float(get_quote_yahoo([self.symbol])['last'])
+ year, month, expiry = self._try_parse_dates(year, month, expiry)
to_ret = Series({'calls': call, 'puts': put})
to_ret = to_ret[to_ret].index
@@ -792,30 +896,60 @@ def get_near_stock_price(self, above_below=2, call=True, put=False,
df = getattr(self, name)
except AttributeError:
meth_name = 'get_{0}_data'.format(nam[:-1])
- df = getattr(self, meth_name)(month, year)
+ df = getattr(self, meth_name)(expiry=expiry)
- start_index = np.where(df['Strike'] > price)[0][0]
+ start_index = np.where(df.index.get_level_values('Strike')
+ > self.underlying_price)[0][0]
get_range = slice(start_index - above_below,
start_index + above_below + 1)
chop = df[get_range].dropna(how='all')
- chop.reset_index(inplace=True)
data[nam] = chop
- return [data[nam] for nam in to_ret]
- def _try_parse_dates(self, year, month, expiry):
- if year is not None or month is not None:
+ return concat([data[nam] for nam in to_ret]).sortlevel()
+
+ @staticmethod
+ def _try_parse_dates(year, month, expiry):
+ """
+ Validates dates provided by user. Ensures the user either provided both a month and a year or an expiry.
+
+ Parameters
+ ----------
+ year: Calendar year, int (deprecated)
+
+ month: Calendar month, int (deprecated)
+
+ expiry: Expiry date (month and year), datetime.date, (preferred)
+
+ Returns
+ -------
+ Tuple of year (int), month (int), expiry (datetime.date)
+ """
+
+ #Checks if the user gave one of the month or the year but not both and did not provide an expiry:
+ if (month is not None and year is None) or (month is None and year is not None) and expiry is None:
+ msg = "You must specify either (`year` and `month`) or `expiry` " \
+ "or none of these options for the current month."
+ raise ValueError(msg)
+
+ if (year is not None or month is not None) and expiry is None:
warnings.warn("month, year arguments are deprecated, use expiry"
" instead", FutureWarning)
if expiry is not None:
year = expiry.year
month = expiry.month
- return year, month
+ elif year is None and month is None:
+ year = CUR_YEAR
+ month = CUR_MONTH
+ expiry = dt.date(year, month, 1)
+
+ return year, month, expiry
def get_forward_data(self, months, call=True, put=False, near=False,
above_below=2):
"""
+ ***Experimental***
Gets either call, put, or both data for months starting in the current
month and going out in the future a specified amount of time.
@@ -841,7 +975,28 @@ def get_forward_data(self, months, call=True, put=False, near=False,
Returns
-------
- data : dict of str, DataFrame
+ pandas.DataFrame
+ A DataFrame with requested options data.
+
+ Index:
+ Strike: Option strike, int
+ Expiry: Option expiry, datetime.date
+ Type: Call or Put, string
+ Symbol: Option symbol as reported on Yahoo, string
+ Columns:
+ Last: Last option price, float
+ Chg: Change from prior day, float
+ Bid: Bid price, float
+ Ask: Ask price, float
+ Vol: Volume traded, int64
+ Open_Int: Open interest, int64
+ IsNonstandard: True if the the deliverable is not 100 shares, otherwise false
+ Underlying: Ticker of the underlying security, string
+ Underlying_Price: Price of the underlying security, float64
+ Quote_Time: Time of the quote, Timestamp
+
+ Note: Format of returned data frame is dependent on Yahoo and may change.
+
"""
warnings.warn("get_forward_data() is deprecated", FutureWarning)
in_months = lrange(CUR_MONTH, CUR_MONTH + months + 1)
@@ -860,10 +1015,9 @@ def get_forward_data(self, months, call=True, put=False, near=False,
to_ret = Series({'calls': call, 'puts': put})
to_ret = to_ret[to_ret].index
- data = {}
+ all_data = []
for name in to_ret:
- all_data = DataFrame()
for mon in range(months):
m2 = in_months[mon]
@@ -882,22 +1036,148 @@ def get_forward_data(self, months, call=True, put=False, near=False,
frame = self.get_near_stock_price(call=call, put=put,
above_below=above_below,
month=m2, year=y2)
- tick = str(frame.Symbol[0])
- start = len(self.symbol)
- year = tick[start:start + 2]
- month = tick[start + 2:start + 4]
- day = tick[start + 4:start + 6]
- expiry = month + '-' + day + '-' + year
- frame['Expiry'] = expiry
-
- if not mon:
- all_data = all_data.join(frame, how='right')
- else:
- all_data = concat([all_data, frame])
- data[name] = all_data
- ret = [data[k] for k in to_ret]
- if len(ret) == 1:
- return ret.pop()
- if len(ret) != 2:
- raise AssertionError("should be len 2")
- return ret
+ frame = self._process_data(frame)
+
+ all_data.append(frame)
+
+ return concat(all_data).sortlevel()
+
+ def get_all_data(self, call=True, put=True):
+ """
+ ***Experimental***
+ Gets either call, put, or both data for all available months starting
+ in the current month.
+
+ Parameters
+ ----------
+ call: bool, optional (default=True)
+ Whether or not to collect data for call options
+
+ put: bool, optional (default=True)
+ Whether or not to collect data for put options.
+
+ Returns
+ -------
+ pandas.DataFrame
+ A DataFrame with requested options data.
+
+ Index:
+ Strike: Option strike, int
+ Expiry: Option expiry, datetime.date
+ Type: Call or Put, string
+ Symbol: Option symbol as reported on Yahoo, string
+ Columns:
+ Last: Last option price, float
+ Chg: Change from prior day, float
+ Bid: Bid price, float
+ Ask: Ask price, float
+ Vol: Volume traded, int64
+ Open_Int: Open interest, int64
+ IsNonstandard: True if the the deliverable is not 100 shares, otherwise false
+ Underlying: Ticker of the underlying security, string
+ Underlying_Price: Price of the underlying security, float64
+ Quote_Time: Time of the quote, Timestamp
+
+ Note: Format of returned data frame is dependent on Yahoo and may change.
+
+ """
+ to_ret = Series({'calls': call, 'puts': put})
+ to_ret = to_ret[to_ret].index
+
+ try:
+ months = self.months
+ except AttributeError:
+ months = self._get_expiry_months()
+
+ all_data = []
+
+ for name in to_ret:
+
+ for month in months:
+ m2 = month.month
+ y2 = month.year
+
+ m1 = _two_char_month(m2)
+ nam = name + str(m1) + str(y2)[2:]
+
+ try: # Try to access on the instance
+ frame = getattr(self, nam)
+ except AttributeError:
+ meth_name = 'get_{0}_data'.format(name[:-1])
+ frame = getattr(self, meth_name)(expiry=month)
+
+ all_data.append(frame)
+
+ return concat(all_data).sortlevel()
+
+ def _get_expiry_months(self):
+ """
+ Gets available expiry months.
+
+ Returns
+ -------
+ months : List of datetime objects
+ """
+
+ url = 'http://finance.yahoo.com/q/op?s={sym}'.format(sym=self.symbol)
+ root = self._parse_url(url)
+
+ links = root.xpath('.//*[@id="yfncsumtab"]')[0].xpath('.//a')
+ month_gen = (element.attrib['href'].split('=')[-1]
+ for element in links
+ if '/q/op?s=' in element.attrib['href']
+ and '&m=' in element.attrib['href'])
+
+ months = [dt.date(int(month.split('-')[0]),
+ int(month.split('-')[1]), 1)
+ for month in month_gen]
+
+ current_month_text = root.xpath('.//*[@id="yfncsumtab"]')[0].xpath('.//strong')[0].text
+ current_month = dt.datetime.strptime(current_month_text, '%b %y')
+ months.insert(0, current_month)
+ self.months = months
+
+ return months
+
+ def _parse_url(self, url):
+ """
+ Downloads and parses a URL, returns xml root.
+
+ """
+ try:
+ from lxml.html import parse
+ except ImportError:
+ raise ImportError("Please install lxml if you want to use the "
+ "{0!r} class".format(self.__class__.__name__))
+ try:
+ doc = parse(url)
+ except _network_error_classes:
+ raise RemoteDataError("Unable to parse URL "
+ "{0!r}".format(url))
+ else:
+ root = doc.getroot()
+ if root is None:
+ raise RemoteDataError("Parsed URL {0!r} has no root"
+ "element".format(url))
+ return root
+
+
+ def _process_data(self, frame):
+ """
+ Adds columns for Expiry, IsNonstandard (ie: deliverable is not 100 shares)
+ and Tag (the tag indicating what is actually deliverable, None if standard).
+
+ """
+ frame["Rootexp"] = frame.Symbol.str[0:-9]
+ frame["Root"] = frame.Rootexp.str[0:-6]
+ frame["Expiry"] = to_datetime(frame.Rootexp.str[-6:])
+ #Removes dashes in equity ticker to map to option ticker.
+ #Ex: BRK-B to BRKB140517C00100000
+ frame["IsNonstandard"] = frame['Root'] != self.symbol.replace('-','')
+ del frame["Rootexp"]
+ frame["Underlying"] = self.symbol
+ frame['Underlying_Price'] = self.underlying_price
+ frame["Quote_Time"] = self.quote_time
+ frame.rename(columns={'Open Int': 'Open_Int'}, inplace=True)
+
+ return frame
diff --git a/pandas/io/tests/data/yahoo_options1.html b/pandas/io/tests/data/yahoo_options1.html
new file mode 100644
index 0000000000000..987072b15e280
--- /dev/null
+++ b/pandas/io/tests/data/yahoo_options1.html
@@ -0,0 +1,329 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>AAPL Options | Apple Inc. Stock - Yahoo! Finance</title><script type="text/javascript" src="http://l.yimg.com/a/i/us/fi/03rd/yg_csstare_nobgcolor.js"></script><link rel="stylesheet" href="http://l.yimg.com/zz/combo?kx/yucs/uh3/uh/css/1014/uh_non_mail-min.css&kx/yucs/uh_common/meta/3/css/meta-min.css&kx/yucs/uh3/uh3_top_bar/css/280/no_icons-min.css&kx/yucs/uh3/search/css/576/blue_border-min.css&kx/yucs/uh3/breakingnews/css/1/breaking_news-min.css&kx/yucs/uh3/promos/get_the_app/css/74/get_the_app-min.css&bm/lib/fi/common/p/d/static/css/2.0.333292/2.0.0/mini/yfi_yoda_legacy_lego_concat.css&bm/lib/fi/common/p/d/static/css/2.0.333292/2.0.0/mini/yfi_symbol_suggest.css&bm/lib/fi/common/p/d/static/css/2.0.333292/2.0.0/mini/yui_helper.css&bm/lib/fi/common/p/d/static/css/2.0.333292/2.0.0/mini/yfi_theme_teal.css" type="text/css"><script language="javascript">
+ ll_js = new Array();
+ </script><script type="text/javascript" src="http://l1.yimg.com/bm/combo?fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yui-min-3.9.1.js&fi/common/p/d/static/js/2.0.333292/yui_2.8.0/build/yuiloader-dom-event/2.0.0/mini/yuiloader-dom-event.js&fi/common/p/d/static/js/2.0.333292/yui_2.8.0/build/container/2.0.0/mini/container.js&fi/common/p/d/static/js/2.0.333292/yui_2.8.0/build/datasource/2.0.0/mini/datasource.js&fi/common/p/d/static/js/2.0.333292/yui_2.8.0/build/autocomplete/2.0.0/mini/autocomplete.js"></script><link rel="stylesheet" href="http://l1.yimg.com/bm/combo?fi/common/p/d/static/css/2.0.333292/2.0.0/mini/yfi_follow_quote.css" type="text/css"><link rel="stylesheet" href="http://l1.yimg.com/bm/combo?fi/common/p/d/static/css/2.0.333292/2.0.0/mini/yfi_follow_stencil.css" type="text/css"><script language="javascript">
+ ll_js.push({
+ 'success_callback' : function() {
+ YUI().use('stencil', 'follow-quote', 'node', function (Y) {
+ var conf = {'xhrBase': '/', 'lang': 'en-US', 'region': 'US', 'loginUrl': 'https://login.yahoo.com/config/login_verify2?&.done=http://finance.yahoo.com/q?s=AAPL&.intl=us'};
+
+ Y.Media.FollowQuote.init(conf, function () {
+ var exchNode = null,
+ followSecClass = "",
+ followHtml = "",
+ followNode = null;
+
+ followSecClass = Y.Media.FollowQuote.getFollowSectionClass();
+ followHtml = Y.Media.FollowQuote.getFollowBtnHTML({ ticker: 'AAPL', addl_classes: "follow-quote-always-visible", showFollowText: true });
+ followNode = Y.Node.create(followHtml);
+ exchNode = Y.one(".wl_sign");
+ if (!Y.Lang.isNull(exchNode)) {
+ exchNode.append(followNode);
+ }
+ });
+ });
+ }
+ });
+ </script><style>
+ /* [bug 3856904]*/
+ #ygma.ynzgma #teleban {width:100%;}
+
+ /* Style to override message boards template CSS */
+ .mboard div#footer {width: 970px !important;}
+ .mboard #screen {width: 970px !important; text-align:left !important;}
+ .mboard div#screen {width: 970px !important; text-align:left !important;}
+ .mboard table.yfnc_modtitle1 td{padding-top:10px;padding-bottom:10px;}
+ </style><meta name="keywords" content="AAPL, Apple Inc., AAPL options, Apple Inc. options, options, stocks, quotes, finance"><meta name="description" content="Discover the AAPL options chain with both straddle and stacked view on Yahoo! Finance. View Apple Inc. options listings by expiration date."><script type="text/javascript"><!--
+ var yfid = document;
+ var yfiagt = navigator.userAgent.toLowerCase();
+ var yfidom = yfid.getElementById;
+ var yfiie = yfid.all;
+ var yfimac = (yfiagt.indexOf('mac')!=-1);
+ var yfimie = (yfimac&&yfiie);
+ var yfiie5 = (yfiie&&yfidom&&!yfimie&&!Array.prototype.pop);
+ var yfiie55 = (yfiie&&yfidom&&!yfimie&&!yfiie5);
+ var yfiie6 = (yfiie55&&yfid.compatMode);
+ var yfisaf = ((yfiagt.indexOf('safari')>-1)?1:0);
+ var yfimoz = ((yfiagt.indexOf('gecko')>-1&&!yfisaf)?1:0);
+ var yfiopr = ((yfiagt.indexOf('opera')>-1&&!yfisaf)?1:0);
+ //--></script><link rel="canonical" href="http://finance.yahoo.com/q/op?s=AAPL"></head><body class="options intl-us yfin_gs gsg-0"><div id="masthead"><div class="yfi_doc yog-hd" id="yog-hd"><div class=""><style>#header,#y-hd,#hd .yfi_doc,#yfi_hd{background:#fff !important}#yfin_gs #yfimh #yucsHead,#yfin_gs #yfi_doc #yucsHead,#yfin_gs #yfi_fp_hd #yucsHead,#yfin_gs #y-hd #yucsHead,#yfin_gs #yfi_hd #yucsHead,#yfin_gs #yfi-doc #yucsHead{-webkit-box-shadow:0 0 9px 0 #490f76 !important;-moz-box-shadow:0 0 9px 0 #490f76 !important;box-shadow:0 0 9px 0 #490f76 !important;border-bottom:1px solid #490f76 !important}#yog-hd,#yfi-hd,#ysp-hd,#hd,#yfimh,#yfi_hd,#yfi_fp_hd,#masthead,#yfi_nav_header #navigation,#y-nav #navigation,.ad_in_head{background-color:#fff;background-image:none}#header,#hd .yfi_doc,#y-hd .yfi_doc,#yfi_hd .yfi_doc{width:100% !important}#yucs{margin:0 auto;width:970px}#yfi_nav_header,.y-nav-legobg,#y-nav #navigation{margin:0 auto;width:970px}#yucs .yucs-avatar{height:22px;width:22px}#yucs #yucs-profile_text .yuhead-name-greeting{display:none}#yucs #yucs-profile_text .yuhead-name{top:0;max-width:65px}#yucs-profile_text{max-width:65px}#yog-bd .yom-stage{background:transparent}#yog-hd{height:84px}.yog-bd,.yog-grid{padding:4px 10px}.nav-stack ul.yog-grid{padding:0}#yucs #yucs-search.yucs-bbb .yucs-button_theme{background:-moz-linear-gradient(top, #01a5e1 0, #0297ce 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #01a5e1), color-stop(100%, #0297ce));background:-webkit-linear-gradient(top, #01a5e1 0, #0297ce 100%);background:-o-linear-gradient(top, #01a5e1 0, #0297ce 100%);background:-ms-linear-gradient(top, #01a5e1 0, #0297ce 100%);background:linear-gradient(to bottom, #01a5e1 0, #0297ce 100%);-webkit-box-shadow:inset 0 1px 3px 0 #01c0eb;box-shadow:inset 0 1px 3px 0 #01c0eb;background-color:#019ed8;background-color:transparent\0/IE9;background-color:transparent\9;*background:none;border:1px solid #595959;padding-left:0px;padding-right:0px}#yucs #yucs-search.yucs-bbb #yucs-prop_search_button_wrapper .yucs-gradient{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#01a5e1', endColorstr='#0297ce',GradientType=0 );-ms-filter:"progid:DXImageTransform.Microsoft.gradient( startColorstr='#01a5e1', endColorstr='#0297ce',GradientType=0 )";background-color:#019ed8\0/IE9}#yucs #yucs-search.yucs-bbb #yucs-prop_search_button_wrapper{*border:1px solid #595959}#yucs #yucs-search .yucs-button_theme{background:#0f8ed8;border:0;box-shadow:0 2px #044e6e}@media all{#yucs.yucs-mc,#yucs-top-inner{width:auto !important;margin:0 !important}#yucsHead{_text-align:left !important}#yucs-top-inner,#yucs.yucs-mc{min-width:970px !important;max-width:1240px !important;padding-left:10px !important;padding-right:10px !important}#yucs.yucs-mc{_width:970px !important;_margin:0 !important}#yucsHead #yucs .yucs-fl-left #yucs-search{position:absolute;left:190px !important;max-width:none !important;margin-left:0;_left:190px;_width:510px !important}.yog-ad-billboard #yucs-top-inner,.yog-ad-billboard #yucs.yucs-mc{max-width:1130px !important}#yucs .yog-cp{position:inherit}}#yucs #yucs-logo{width:150px !important;height:34px !important}#yucs #yucs-logo div{width:94px !important;margin:0 auto !important}.lt #yucs-logo div{background-position:-121px center !important}#yucs-logo a{margin-left:-13px !important}</style><style>#yog-hd .yom-bar, #yog-hd .yom-nav, #y-nav, #hd .ysp-full-bar, #yfi_nav_header, #hd .mast {
+float: none;
+width: 970px;
+margin: 0 auto;
+}
+
+#yog-bd .yom-stage {
+background: transparent;
+}
+
+#y-nav .yom-nav {
+padding-top: 0px;
+}
+
+#ysp-search-assist .bd {
+display:none;
+}
+
+#ysp-search-assist h4 {
+padding-left: 8px;
+}
+
+
+ #yfi-portfolios-multi-quotes #y-nav, #yfi-portfolios-multi-quotes #navigation, #yfi-portfolios-multi-quotes .y-nav-legobg,
+ #yfi-portfolios-my-portfolios #y-nav, #yfi-portfolios-my-portfolios #navigation, #yfi-portfolios-my-portfolios .y-nav-legobg {
+ width : 100%;
+ }</style> <div id="yucsHead" class="yucs-finance yucs-en-us yucs-standard"><!-- meta --><div id="yucs-meta" data-authstate="signedout" data-cobrand="standard" data-crumb="KJ5cvmX/6lL" data-device="desktop" data-firstname="" data-flight="1399845989" data-forcecobrand="standard" data-guid="" data-host="finance.yahoo.com" data-https="" data-languagetag="en-us" data-property="finance" data-protocol="" data-shortfirstname="" data-shortuserid="" data-status="active" data-spaceid="" data-userid="" ></div><!-- /meta --><div id="yucs-disclaimer" class="yucs-disclaimer yucs-activate yucs-hide yucs-property-finance yucs-fcb- " data-disclaimertext="Do Not Track is no longer enabled on Yahoo. Your experience is now personalized. {disclaimerLink}More info{linkEnd}" data-ylt-link="https://us.lrd.yahoo.com/_ylt=AlrnuZeqFmgOGWkhRMWB9od0w7kB/SIG=11sjlcu0m/EXP=1401055587/**https%3A//info.yahoo.com/privacy/us/yahoo/" data-ylt-disclaimerbarclose="/;_ylt=AvKzjB05CxXPjqQ6kAvxUgt0w7kB" data-ylt-disclaimerbaropen="/;_ylt=Aib9SZb8Nz5lDV.wJLmORnh0w7kB" data-linktarget="_top" data-property="finance" data-device="Desktop" data-close-txt="Close this window"></div><div id="yucs-top-bar" class='yucs-ps'> <div id='yucs-top-inner'> <ul id='yucs-top-list'> <li id='yucs-top-home'><a href="https://us.lrd.yahoo.com/_ylt=Ao4hB2LxXW8XmCMJy5I2ubR0w7kB/SIG=11a81opet/EXP=1401055587/**https%3A//www.yahoo.com/"><span class="sp yucs-top-ico"></span>Home</a></li> <li id='yucs-top-mail'><a href="https://mail.yahoo.com/;_ylt=Av4abQyBvHtffD0uSZS.CgZ0w7kB?.intl=us&.lang=en-US&.src=ym">Mail</a></li> <li id='yucs-top-news'><a href="http://news.yahoo.com/;_ylt=As_KuRHhUrzj_JMRd1tnrMd0w7kB">News</a></li> <li id='yucs-top-sports'><a href="http://sports.yahoo.com/;_ylt=Aq70tKsnafjNs.l.LkSPFht0w7kB">Sports</a></li> <li id='yucs-top-finance'><a href="http://finance.yahoo.com/;_ylt=AoBGhVjaca1ks.IIM221ntx0w7kB">Finance</a></li> <li id='yucs-top-weather'><a href="https://weather.yahoo.com/;_ylt=AqTDzZLVRHoRvP4BQTqNeVR0w7kB">Weather</a></li> <li id='yucs-top-games'><a href="https://games.yahoo.com/;_ylt=Ak2rNi3L1FFO8oNp65TOzCR0w7kB">Games</a></li> <li id='yucs-top-groups'><a href="https://us.lrd.yahoo.com/_ylt=AorIpkL5Z_7YatnoZxkhTAh0w7kB/SIG=11dhnit72/EXP=1401055587/**https%3A//groups.yahoo.com/">Groups</a></li> <li id='yucs-top-answers'><a href="https://answers.yahoo.com/;_ylt=Akv4ugRIbDKXzi15Cu1qnX10w7kB">Answers</a></li> <li id='yucs-top-screen'><a href="https://us.lrd.yahoo.com/_ylt=Avk.0EzLrYCI9_3Gx7lGuSp0w7kB/SIG=11df1fppc/EXP=1401055587/**https%3A//screen.yahoo.com/">Screen</a></li> <li id='yucs-top-flickr'><a href="https://us.lrd.yahoo.com/_ylt=Aif665hSjubM73bWYfFcr790w7kB/SIG=11b8eiahd/EXP=1401055587/**https%3A//www.flickr.com/">Flickr</a></li> <li id='yucs-top-mobile'><a href="https://mobile.yahoo.com/;_ylt=Ak0VCyjtpB7I0NUOovyR7Jx0w7kB">Mobile</a></li> <li id='yucs-more' class='yucs-menu yucs-more-activate' data-ylt="/;_ylt=AsdlNm59BtZdpeRPmdYxPDd0w7kB"><a href="#" id='yucs-more-link' class='yucs-leavable'>More<span class="sp yucs-top-ico"></span></a> <div id='yucs-top-menu'> <div class='yui3-menu-content'> <ul class='yucs-hide yucs-leavable'> <li id='yucs-top-omg'><a href="https://us.lrd.yahoo.com/_ylt=AqBEA_kq9lVw5IFokeOKonp0w7kB/SIG=11gjvjq1r/EXP=1401055587/**https%3A//celebrity.yahoo.com/">Celebrity</a></li> <li id='yucs-top-shine'><a href="https://shine.yahoo.com/;_ylt=AhGcmSHpA0muhsBdP6H4InF0w7kB">Shine</a></li> <li id='yucs-top-movies'><a href="https://movies.yahoo.com/;_ylt=ApGqYS5_P_Kz8TDn5sHU3ZN0w7kB">Movies</a></li> <li id='yucs-top-music'><a href="https://music.yahoo.com/;_ylt=Aux_oiL3Fo9dDxIbThmyNr90w7kB">Music</a></li> <li id='yucs-top-tv'><a href="https://tv.yahoo.com/;_ylt=AmGbjqPP363VmLAVXTrJFuZ0w7kB">TV</a></li> <li id='yucs-top-health'><a href="http://us.lrd.yahoo.com/_ylt=AtuD8.2uZaENQ.Oo9GJPT950w7kB/SIG=11ca4753j/EXP=1401055587/**http%3A//health.yahoo.com/">Health</a></li> <li id='yucs-top-shopping'><a href="http://shopping.yahoo.com/;_ylt=AhJZ0T6M2dn6SKKuCiiLW2h0w7kB">Shopping</a></li> <li id='yucs-top-travel'><a href="https://us.lrd.yahoo.com/_ylt=AiBvXjaOCqm8KXAdrh8TB_t0w7kB/SIG=11cf1nu28/EXP=1401055587/**https%3A//yahoo.com/travel">Travel</a></li> <li id='yucs-top-autos'><a href="https://autos.yahoo.com/;_ylt=At3otzDnCa76bYOLkzSqF2J0w7kB">Autos</a></li> <li id='yucs-top-homes'><a href="https://us.lrd.yahoo.com/_ylt=Anf_bE5H6GCpnhn6SvBYWXJ0w7kB/SIG=11cbtb109/EXP=1401055587/**https%3A//homes.yahoo.com/">Homes</a></li> </ul> </div> </div> </li> </ul> </div></div><div id="yucs" class="yucs-mc yog-grid" data-lang="en-us" data-property="finance" data-flight="1399845989" data-linktarget="_top" data-uhvc="/;_ylt=AmPCJqJR6.mtFqSkyKWHe410w7kB"> <div class="yucs-fl-left yog-cp"> <div id="yucs-logo"> <style> #yucs #yucs-logo-ani { width:120px ; height:34px; background-image:url(https://s1.yimg.com/rz/l/yahoo_finance_en-US_f_pw_119x34.png) ; _background-image:url(https://s1.yimg.com/rz/l/yahoo_finance_en-US_f_pw_119x34.gif) ; *left: 0px; display:block ; visibility:hidden; clip: rect(22px,154px,42px,0px); *clip: rect(22px 154px 42px 0px); position: absolute; } .lt #yucs-logo-ani { background-position: 100% 0px !important; } .lt #yucs[data-property='mail'] #yucs-logo-ani { background-position: -350px 0px !important; } #yucs-logo { margin-top:0px!important; padding-top: 11px; width: 120px; } #yucs[data-property='homes'] #yucs-logo { width: 102px; } .advisor #yucs-link-ani { left: 21px !important; } #yucs #yucs-logo a {margin-left: 0!important;}#yucs #yucs-link-ani {width: 100% !important;} @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and ( min--moz-device-pixel-ratio: 2), only screen and ( -o-min-device-pixel-ratio: 2/1), only screen and ( min-device-pixel-ratio: 2), only screen and ( min-resolution: 192dpi), only screen and ( min-resolution: 2dppx) { #yucs #yucs-logo-ani { background-image: url(https://s1.yimg.com/rz/l/yahoo_finance_en-US_f_pw_119x34_2x.png) !important; background-size: 235px 34px; } } </style> <div> <a id="yucs-logo-ani" class="" href="http://finance.yahoo.com/;_ylt=AqyNsFNT3Sn_rHS9M12yu_F0w7kB" target="_top" data-alg=""> Yahoo Finance </a> </div> <img id="imageCheck" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" alt=""/> </div><noscript><style>#yucs #yucs-logo-ani {visibility: visible;position: relative;clip: auto;}</style></noscript><script charset='utf-8' type='text/javascript' src='http://l.yimg.com/zz/combo?kx/yucs/uh3/uh/js/49/ai.min.js'></script><script>function isIE() {var myNav = navigator.userAgent.toLowerCase();return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;}function loadAnimAfterOnLoad() { if (typeof Aniden != 'undefined'&& Aniden.play&& (document.getElementById('yucs').getAttribute('data-property') !== 'mail' || document.getElementById('yucs-logo-ani').getAttribute('data-alg'))) {Aniden.play();}}if (isIE()) {var _animPltTimer = setTimeout(function() {this.loadAnimAfterOnLoad();}, 6000);} else if((navigator.userAgent.toLowerCase().indexOf('firefox') > -1)) { var _animFireFoxTimer = setTimeout(function() { this.loadAnimAfterOnLoad(); }, 2000);}else {document.addEventListener("Aniden.animReadyEvent", function() {loadAnimAfterOnLoad();},true);}</script> <div id="yucs-search" style="width: 570px; display: block;" class=' yucs-search-activate'> <form role="search" class="yucs-search yucs-activate" target="_top" data-webaction="https://search.yahoo.com/search;_ylt=Al9HKKV14RT4ajaoHIoqjI50w7kB" action="http://finance.yahoo.com/q;_ylt=Alv1w.AIh8gqgHpvY5YZDrZ0w7kB" method="get"> <table role="presentation"> <tbody role="presentation"> <tr role="presentation"> <td class="yucs-form-input" role="presentation"> <input autocomplete="off" class="yucs-search-input" name="s" type="search" aria-describedby="mnp-search_box" data-yltvsearch="http://finance.yahoo.com/q;_ylt=AghUQQoc7iOA7p.BfWTeUUh0w7kB" data-yltvsearchsugg="/;_ylt=AsQA5kLl4xDNumkZM5uE.rB0w7kB" data-satype="mini" data-gosurl="https://s.yimg.com/aq/autoc" data-pubid="666" data-enter-ylt="http://finance.yahoo.com/q;_ylt=AqIO_a3OBUAN36M.LJKzJA50w7kB" data-enter-fr="" data-maxresults="" id="mnp-search_box"/> </td><td NOWRAP class="yucs-form-btn" role="presentation"><div id="yucs-prop_search_button_wrapper" class="yucs-search-buttons"><div class="yucs-shadow"><div class="yucs-gradient"></div></div><button id="yucs-sprop_button" class="yucs-action_btn yucs-button_theme yucs-vsearch-button" type="submit" data-vfr="uhb2" data-searchNews="uh3_finance_vert_gs" data-vsearch="http://finance.yahoo.com/q">Search Finance</button></div><div id="yucs-web_search_button_wrapper" class="yucs-search-buttons"><div class="yucs-shadow"><div class="yucs-gradient"></div></div><button id="yucs-search_button" class="yucs-action_btn yucs-wsearch-button" onclick="var form=document.getElementById('yucs-search').children[0];var wa=form.getAttribute('data-webaction');form.setAttribute('action',wa);var searchbox=document.getElementById('mnp-search_box');searchbox.setAttribute('name','p');" type="submit">Search Web</button></div></td></tr> </tbody> </table> <input type="hidden" name="uhb" value="uhb2" data-searchNews="uh3_finance_vert_gs" /> <input type="hidden" name="type" value="2button" /> <input type="hidden" id="fr" name="fr" value="uh3_finance_web_gs" /> </form><div id="yucs-satray" class="sa-tray sa-hidden" data-wstext="Search Web for: " data-wsearch="https://search.yahoo.com/search;_ylt=Atjbejl2ejzDyJZX6TzP5o10w7kB" data-vfr="uhb2" data-searchNews="uh3_finance_vert_gs" data-vsearchAll="/;_ylt=AvaeMvKMO66de7oDxAz9rlZ0w7kB" data-vsearch="http://finance.yahoo.com/q;_ylt=AtZa3yYrqYNgXIzFxr0WtdJ0w7kB" data-vstext= "Search news for: " data-vert_fin_search="https://finance.search.yahoo.com/search/;_ylt=AnVmyyaRC7xjHBtYTQkWnzZ0w7kB"></div> </div></div><div class="yucs-fl-right"> <div id="yucs-profile" class="yucs-profile yucs-signedout"> <a id="yucs-menu_link_profile_signed_out" href="https://login.yahoo.com/config/login;_ylt=AgCqTsOwLReBeuF7ReOpSxB0w7kB?.src=quote&.intl=us&.lang=en-US&.done=http://finance.yahoo.com/q/op%3fs=aapl%2bOptions" target="_top" rel="nofollow" class="sp yucs-fc" aria-label="Profile"> </a> <div id="yucs-profile_text" class="yucs-fc"> <a id="yucs-login_signIn" href="https://login.yahoo.com/config/login;_ylt=Av_LzdGBrYXIDe4SgyGOUrF0w7kB?.src=quote&.intl=us&.lang=en-US&.done=http://finance.yahoo.com/q/op%3fs=aapl%2bOptions" target="_top" rel="nofollow" class="yucs-fc"> Sign In </a> </div></div> <div class="yucs-mail_link yucs-mailpreview-ancestor"><a id="yucs-mail_link_id" class="sp yltasis yucs-fc" href="https://mail.yahoo.com/;_ylt=AgF29ftiJQ6BBv7NVbCNH.d0w7kB?.intl=us&.lang=en-US&.src=ym" rel="nofollow" target="_top"> Mail <span class="yucs-activate yucs-mail-count yucs-hide yucs-alert-count-con" data-uri-scheme="https" data-uri-path="mg.mail.yahoo.com/mailservices/v1/newmailcount" data-authstate="signedout" data-crumb="KJ5cvmX/6lL" data-mc-crumb="1h99r1DdxNI"><span class="yucs-alert-count"></span></span></a><div class="yucs-mail-preview-panel yucs-menu yucs-hide" data-mail-txt="Mail" data-uri-scheme="http" data-uri-path="ucs.query.yahoo.com/v1/console/yql" data-mail-view="Go to Mail" data-mail-help-txt="Help" data-mail-help-url="http://help.yahoo.com/l/us/yahoo/mail/ymail/" data-mail-loading-txt="Loading..." data-languagetag="en-us" data-mrd-crumb="r0fFC9ylloc" data-authstate="signedout" data-middleauth-signin-text="Click here to view your mail" data-popup-login-url="https://login.yahoo.com/config/login_verify2?.pd=c%3DOIVaOGq62e5hAP8Tv..nr5E3&.src=sc" data-middleauthtext="You have {count} new messages." data-yltmessage-link="http://us.lrd.yahoo.com/_ylt=AmkPFD5V4gQberQdFe7kqbl0w7kB/SIG=13def5eo3/EXP=1401055587/**http%3A//mrd.mail.yahoo.com/msg%3Fmid=%7BmsgID%7D%26fid=Inbox%26src=uh%26.crumb=r0fFC9ylloc" data-yltviewall-link="https://mail.yahoo.com/;_ylt=Am9m6JDgKq5S58hIybDDSIZ0w7kB" data-yltpanelshown="/;_ylt=AlMCflCWAGc_VSy.J_8dv190w7kB" data-ylterror="/;_ylt=AkV3kRIsxCiH4r52cxXLv950w7kB" data-ylttimeout="/;_ylt=AuIbb5y8pMdT3f3RZqNKH.x0w7kB" data-generic-error="We're unable to preview your mail.<br>Go to Mail." data-nosubject="[No Subject]" data-timestamp='short'></div></div> <div id="yucs-help" class="yucs-activate yucs-help yucs-menu_nav"> <a id="yucs-help_button" class="sp yltasis" href="javascript:void(0);" aria-label="Help" rel="nofollow"> <em class="yucs-hide yucs-menu_anchor">Help</em> </a> <div id="yucs-help_inner" class="yucs-hide yucs-menu yucs-hm-activate" data-yltmenushown="/;_ylt=AoKPkcHYisDqHkDbBxvqZwZ0w7kB"> <span class="sp yucs-dock"></span> <ul id="yuhead-help-panel"> <li><a class="yucs-acct-link" href="https://us.lrd.yahoo.com/_ylt=Ai0bla6vRRki52yROjWvkvt0w7kB/SIG=167k5c9bb/EXP=1401055587/**https%3A//edit.yahoo.com/mc2.0/eval_profile%3F.intl=us%26.lang=en-US%26.done=http%3A//finance.yahoo.com/q/op%253fs=aapl%252bOptions%26amp;.src=quote%26amp;.intl=us%26amp;.lang=en-US" target="_top">Account Info</a></li> <li><a href="https://help.yahoo.com/l/us/yahoo/finance/;_ylt=AifVP1S4jgSp_1f723sjBFR0w7kB" rel="nofollow" >Help</a></li> <span class="yucs-separator" role="presentation" style="display: block;"></span> <li><a href="http://us.lrd.yahoo.com/_ylt=AuMJgYaX0bmdD5NlJJM4IO90w7kB/SIG=11rqb1rgp/EXP=1401055587/**http%3A//feedback.yahoo.com/forums/207809" rel="nofollow" >Suggestions</a></li> </ul> </div></div> <div id="yucs-network_link"><a id="yucs-home_link" href="https://us.lrd.yahoo.com/_ylt=AgC5ky_m8W_H_QK8HAPjn6Z0w7kB/SIG=11a81opet/EXP=1401055587/**https%3A//www.yahoo.com/" rel="nofollow" target="_top">Yahoo</a></div> <div id="yucs-bnews" class="yucs-activate slide yucs-hide" data-linktarget="_top" data-authstate="signedout" data-deflink="http://news.yahoo.com" data-deflinktext="Visit Yahoo News for the latest." data-title="Breaking News" data-close="Close this window" data-lang="en-us" data-property="finance"></div> <div id="uh-dmos-wrapper"><div id="uh-dmos-overlay" class="uh-dmos-overlay"> </div> <div id="uh-dmos-container" class="uh-dmos-hide"> <div id="uh-dmos-msgbox" class="uh-dmos-msgbox" tabindex="0" aria-labelledby="modal-title" aria-describedby="uh-dmos-ticker-gadget"> <div class="uh-dmos-msgbox-canvas"> <div class="uh-dmos-msgbox-close"> <button id="uh-dmos-msgbox-close-btn" class="uh-dmos-msgbox-close-btn" type="button">close button</button> </div> <div id="uh-dmos-imagebg" class="uh-dmos-imagebg"> <h2 id="modal-title" class="uh-dmos-title uh-dmos-strong">Mobile App Promotion</h2> </div> <div id="uh-dmos-bd"> <p class="uh-dmos-Helvetica uh-dmos-alertText">Send me <strong>a link:</strong></p> <div class="uh-dmos-info"> <label for=input-id-phoneNumber>Phone Number</label> <input id="input-id-phoneNumber" class="phone-number-input" type="text" placeholder="+1 (555)-555-5555" name="phoneNumber"> <p id="uh-dmos-text-disclaimer" style="display:block">*Only U.S. numbers are accepted. Text messaging rates may apply.</p><p id="phone-prompt" class = "uh-dmos-Helvetica" style="display:none">Please enter a valid phone number.</p> <p id="phone-or-email-prompt" class = "uh-dmos-Helvetica" style="display:none">Please enter your Phone Number.</p> </div> <div class="uh-dmos-info-button"> <button id="uh-dmos-subscribe" class="subscribe uh-dmos-Helvetica" title="" type="button" data-crumb="RiMvmjcRvwA">Send</button> </div> </div> <div id="uh-dmos-success-message" style="display:none;"> <div class="uh-dmos-success-imagebg"> </div> <div id="uh-dmos-success-bd"> <p class="uh-dmos-Helvetica uh-dmos-confirmation"><strong>Thanks!</strong> A link has been sent.</p> <button id="uh-dmos-successBtn" class="successBtn uh-dmos-Helvetica" title="" type="button">Done</button> </div> </div> </div> </div> </div></div><script id="modal_inline" data-class="yucs_gta_finance" data-button-rev="1" data-modal-rev="1" data-appid ="modal-finance" href="https://mobile.yahoo.com/finance/;_ylt=ArY2hXl5c4FOjNDM0ifbhcF0w7kB" data-button-txt="Get the app" type="text/javascript"></script> </div> </div> <!-- contextual_shortcuts --><!-- /contextual_shortcuts --><!-- property: finance | languagetag: en-us | status: active | spaceid: | cobrand: standard | markup: empty --><div id="yucs-location-js" class="yucs-hide yucs-offscreen yucs-location-activate" data-appid="yahoo.locdrop.ucs.desktop" data-crumb="LdHhxYjbRN5"><!-- empty for ie --></div><div id="yUnivHead" class="yucs-hide"><!-- empty --></div></div></div><script type="text/javascript">
+ var yfi_dd = 'finance.yahoo.com';
+
+ ll_js.push({
+ 'file':'http://l.yimg.com/zz/combo?kx/yucs/uh3/uh/js/998/uh-min.js&kx/yucs/uh3/uh/js/102/gallery-jsonp-min.js&kx/yucs/uh3/uh/js/966/menu_utils_v3-min.js&kx/yucs/uh3/uh/js/834/localeDateFormat-min.js&kx/yucs/uh3/uh/js/872/timestamp_library_v2-min.js&kx/yucs/uh3/uh/js/829/logo_debug-min.js&kx/yucs/uh_common/meta/11/js/meta-min.js&kx/yucs/uh_common/beacon/18/js/beacon-min.js&kx/ucs/comet/js/76/cometd-yui3-min.js&kx/ucs/comet/js/76/conn-min.js&kx/ucs/comet/js/76/dark-test-min.js&kx/yucs/uh3/disclaimer/js/138/disclaimer_seed-min.js&kx/yucs/uh3/uh3_top_bar/js/274/top_bar_v3-min.js&kx/yucs/uh3/search/js/573/search-min.js&kx/ucs/common/js/135/jsonp-super-cached-min.js&kx/yucs/uh3/avatar/js/25/avatar-min.js&kx/yucs/uh3/mail_link/js/89/mailcount_ssl-min.js&kx/yucs/uh3/help/js/55/help_menu_v3-min.js&kx/ucs/common/js/131/jsonp-cached-min.js&kx/yucs/uh3/breakingnews/js/11/breaking_news-min.js&kx/yucs/uh3/promos/get_the_app/js/60/inputMaskClient-min.js&kx/yucs/uh3/promos/get_the_app/js/76/get_the_app-min.js&kx/yucs/uh3/location/js/7/uh_locdrop-min.js'
+ });
+
+ if(window.LH) {
+ LH.init({spaceid:'28951412'});
+ }
+ </script><style>
+ .yfin_gs #yog-hd{
+ position: relative;
+ }
+ html {
+ padding-top: 0 !important;
+ }
+
+ @media screen and (min-width: 806px) {
+ html {
+ padding-top:83px !important;
+ }
+ .yfin_gs #yog-hd{
+ position: fixed;
+ }
+ }
+ /* bug 6768808 - allow UH scrolling for smartphone */
+ @media only screen and (device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2),
+ only screen and (device-width: 320px) and (device-height: 568px) and (-webkit-min-device-pixel-ratio: 1),
+ only screen and (device-width: 320px) and (device-height: 534px) and (-webkit-device-pixel-ratio: 1.5),
+ only screen and (device-width: 720px) and (device-height: 1280px) and (-webkit-min-device-pixel-ratio: 2),
+ only screen and (device-width: 480px) and (device-height: 800px) and (-webkit-device-pixel-ratio: 1.5 ),
+ only screen and (device-width: 384px) and (device-height: 592px) and (-webkit-device-pixel-ratio: 2),
+ only screen and (device-width: 360px) and (device-height: 640px) and (-webkit-device-pixel-ratio: 3){
+ html {
+ padding-top: 0 !important;
+ }
+ .yfin_gs #yog-hd{
+ position: relative;
+ border-bottom: 0 none !important;
+ box-shadow: none !important;
+ }
+ }
+ </style><script type="text/javascript">
+ YUI().use('node',function(Y){
+ var gs_hdr_elem = Y.one('.yfin_gs #yog-hd');
+ var _window = Y.one('window');
+
+ if(gs_hdr_elem) {
+ _window.on('scroll', function() {
+ var scrollTop = _window.get('scrollTop');
+
+ if (scrollTop === 0 ) {
+ gs_hdr_elem.removeClass('yog-hd-border');
+ }
+ else {
+ gs_hdr_elem.addClass('yog-hd-border');
+ }
+ });
+ }
+ });
+ </script><script type="text/javascript">
+ if(typeof YAHOO == "undefined"){YAHOO={};}
+ if(typeof YAHOO.Finance == "undefined"){YAHOO.Finance={};}
+ if(typeof YAHOO.Finance.ComscoreConfig == "undefined"){YAHOO.Finance.ComscoreConfig={};}
+ YAHOO.Finance.ComscoreConfig={ "config" : [
+ {
+ c5: "28951412",
+ c7: "http://finance.yahoo.com/q/op?s=aapl+Options"
+ }
+ ] }
+ ll_js.push({
+ 'file': 'http://l1.yimg.com/bm/lib/fi/common/p/d/static/js/2.0.333292/2.0.0/yfi_comscore.js'
+ });
+ </script><noscript><img src="http://b.scorecardresearch.com/p?c1=2&c2=7241469&c4=http://finance.yahoo.com/q/op?s=aapl+Options&c5=28951412&cv=2.0&cj=1"></noscript></div></div><div class="ad_in_head"><div class="yfi_doc"></div><table width="752" id="yfncmkttme" cellpadding="0" cellspacing="0" border="0"><tr><td></td></tr></table></div><div id="y-nav"><div id="navigation" class="yom-mod yom-nav" role="navigation"><div class="bd"><div class="nav"><div class="y-nav-pri-legobg"><div id="y-nav-pri" class="nav-stack nav-0 yfi_doc"><ul class="yog-grid" id="y-main-nav"><li id="finance%2520home"><div class="level1"><a href="/"><span>Finance Home</span></a></div></li><li class="nav-fin-portfolios"><div class="level1"><a id="yfmya" href="/portfolios.html"><span>My Portfolio</span></a><div class="arrow"><em></em></div><div class="pointer"></div><ul class="nav-sub"><li><a href="/portfolios/">Sign in to access My Portfolios</a></li><li><a href="http://billing.finance.yahoo.com/realtime_quotes/signup?.src=quote&.refer=nb">Free trial of Real-Time Quotes</a></li></ul></div></li><li id="market%2520data"><div class="level1"><a href="/market-overview/"><span>Market Data</span></a><div class="arrow"><em></em></div><div class="pointer"></div><ul class="nav-sub"><li><a href="/stock-center/">Stocks</a></li><li><a href="/funds/">Mutual Funds</a></li><li><a href="/options/">Options</a></li><li><a href="/etf/">ETFs</a></li><li><a href="/bonds">Bonds</a></li><li><a href="/futures">Commodities</a></li><li><a href="/currency-investing">Currencies</a></li></ul></div></li><li id="business%2520%2526%2520finance"><div class="level1"><a href="/news/"><span>Business & Finance</span></a><div class="arrow"><em></em></div><div class="pointer"></div><ul class="nav-sub"><li><a href="/corporate-news/">Company News</a></li><li><a href="/economic-policy-news/">Economic News</a></li><li><a href="/investing-news/">Market News</a></li></ul></div></li><li id="personal%2520finance"><div class="level1"><a href="/personal-finance/"><span>Personal Finance</span></a><div class="arrow"><em></em></div><div class="pointer"></div><ul class="nav-sub"><li><a href="/career-education/">Career & Education</a></li><li><a href="/real-estate/">Real Estate</a></li><li><a href="/retirement/">Retirement</a></li><li><a href="/credit-debt/">Credit & Debt</a></li><li><a href="/taxes/">Taxes</a></li><li><a href="/lifestyle/">Health & Lifestyle</a></li><li><a href="/videos/">Featured Videos</a></li><li><a href="/rates/">Rates in Your Area</a></li><li><a href="/calculator/index/">Calculators</a></li></ul></div></li><li id="yahoo%2520originals"><div class="level1"><a href="/blogs/"><span>Yahoo Originals</span></a><div class="arrow"><em></em></div><div class="pointer"></div><ul class="nav-sub"><li><a href="/blogs/breakout/">Breakout</a></li><li><a href="/blogs/daily-ticker/">The Daily Ticker</a></li><li><a href="/blogs/driven/">Driven</a></li><li><a href="/blogs/the-exchange/">The Exchange</a></li><li><a href="/blogs/hot-stock-minute/">Hot Stock Minute</a></li><li><a href="/blogs/just-explain-it/">Just Explain It</a></li><li><a href="/blogs/michael-santoli/">Unexpected Returns</a></li></ul></div></li><li id="cnbc"><div class="level1"><a href="/cnbc/"><span>CNBC</span></a><div class="arrow"><em></em></div><div class="pointer"></div><ul class="nav-sub"><li><a href="/blogs/big-data-download/">Big Data Download</a></li><li><a href="/blogs/off-the-cuff/">Off the Cuff</a></li><li><a href="/blogs/power-pitch/">Power Pitch</a></li><li><a href="/blogs/talking-numbers/">Talking Numbers</a></li><li><a href="/blogs/top-best-most/">Top/Best/Most</a></li></ul></div></li></ul></div></div> </div></div></div><script>
+
+ (function(el) {
+ function focusHandler(e){
+ if (e && e.target){
+ e.target == document ? null : e.target;
+ document.activeElement = e.target;
+ }
+ }
+ // Handle !IE browsers that do not support the .activeElement property
+ if(!document.activeElement){
+ if (document.addEventListener){
+ document.addEventListener("focus", focusHandler, true);
+ }
+ }
+ })(document);
+
+ </script><div class="y-nav-legobg"><div class="yfi_doc"><div id="y-nav-sec" class="clear"><div id="searchQuotes" class="ticker-search mod" mode="search"><div class="hd"></div><div class="bd"><form id="quote" name="quote" action="/q"><h2 class="yfi_signpost">Search for share prices</h2><label for="txtQuotes">Search for share prices</label><input id="txtQuotes" name="s" value="" type="text" autocomplete="off" placeholder="Enter Symbol"><input id="get_quote_logic_opt" name="ql" value="1" type="hidden" autocomplete="off"><div id="yfi_quotes_submit"><span><span><span><input type="submit" value="Look Up" id="btnQuotes" class="rapid-nf"></span></span></span></div></form></div><div class="ft"><a href="http://finance.search.yahoo.com?fr=fin-v1">Finance Search</a><p><span id="yfs_market_time">Sun, May 11, 2014, 6:06PM EDT - U.S. Markets closed</span></p></div></div></div></div></div></div><div id="screen"><span id="yfs_ad_" ></span><style type="text/css">
+ .yfi-price-change-up{
+ color:#008800
+ }
+
+ .yfi-price-change-down{
+ color:#cc0000
+ }
+ </style><div id="marketindices"> <a href="/q?s=%5EDJI">Dow</a> <span id="yfs_pp0_^dji"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"><b style="color:#008800;">0.20%</b></span> <a href="/q?s=%5EIXIC">Nasdaq</a> <span id="yfs_pp0_^ixic"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"><b style="color:#008800;">0.50%</b></span></div><div id="companynav"><table cellpadding="0" cellspacing="0" border="0"><tr><td height="5"></td></tr></table></div><div id="leftcol"><div id="yfi_investing_nav"><div class="hd"><h2>More On AAPL</h2></div><div class="bd"><h3>Quotes</h3><ul><li><a href="/q?s=AAPL">Summary</a></li><li><a href="/q/ecn?s=AAPL+Order+Book">Order Book</a></li><li class="selected">Options</li><li><a href="/q/hp?s=AAPL+Historical+Prices">Historical Prices</a></li></ul><h3>Charts</h3><ul><li><a href="/echarts?s=AAPL+Interactive#symbol=AAPL;range=">Interactive</a></li><li><a href="/q/bc?s=AAPL+Basic+Chart">Basic Chart</a></li><li><a href="/q/ta?s=AAPL+Basic+Tech.+Analysis">Basic Tech. Analysis</a></li></ul><h3>News & Info</h3><ul><li><a href="/q/h?s=AAPL+Headlines">Headlines</a></li><li><a href="/q/p?s=AAPL+Press+Releases">Press Releases</a></li><li><a href="/q/ce?s=AAPL+Company+Events">Company Events</a></li><li><a href="/mb/AAPL/">Message Boards</a></li><li><a href="/marketpulse/AAPL">Market Pulse</a></li></ul><h3>Company</h3><ul><li><a href="/q/pr?s=AAPL+Profile">Profile</a></li><li><a href="/q/ks?s=AAPL+Key+Statistics">Key Statistics</a></li><li><a href="/q/sec?s=AAPL+SEC+Filings">SEC Filings</a></li><li><a href="/q/co?s=AAPL+Competitors">Competitors</a></li><li><a href="/q/in?s=AAPL+Industry">Industry</a></li><li><a href="/q/ct?s=AAPL+Components">Components</a></li></ul><h3>Analyst Coverage</h3><ul><li><a href="/q/ao?s=AAPL+Analyst+Opinion">Analyst Opinion</a></li><li><a href="/q/ae?s=AAPL+Analyst+Estimates">Analyst Estimates</a></li></ul><h3>Ownership</h3><ul><li><a href="/q/mh?s=AAPL+Major+Holders">Major Holders</a></li><li><a href="/q/it?s=AAPL+Insider+Transactions">Insider Transactions</a></li><li><a href="/q/ir?s=AAPL+Insider+Roster">Insider Roster</a></li></ul><h3>Financials</h3><ul><li><a href="/q/is?s=AAPL+Income+Statement&annual">Income Statement</a></li><li><a href="/q/bs?s=AAPL+Balance+Sheet&annual">Balance Sheet</a></li><li><a href="/q/cf?s=AAPL+Cash+Flow&annual">Cash Flow</a></li></ul></div><div class="ft"></div></div></div><div id="rightcol"><table border="0" cellspacing="0" cellpadding="0" width="580" id="yfncbrobtn" style="padding-top:1px;"><tr><td align="center"><!--ADS:LOCATION=FB2--><span id="yfs_ad_n4FB2" ><!-- APT Vendor: WSOD, Format: Polite in Page -->
+<script type="text/javascript" src="https://ad.wsod.com/embed/8bec9b10877d5d7fd7c0fb6e6a631357/1542.0.js.120x60/1399845989.435266?yud=smpv%3d3%26ed%3dKfb2BHkzObF0OPI9Q.6FtZbkSliqfEhrwqW60UZSoR3xvucF8txzwcjUIdM1FNLOlDMJNO3VKY3lwvdYEY3fDwfAWZ7CQCWWuATZjY6FR39ApR6n7HML9c5BGa46lM3IFeXC791QmLU_5P8ySRjZU52HE7FMYjYP89t3Fl69NTaCpC370qQC2YY8QLoGEerBJanAt.Jr1zL4bn5POCOF9fQ.xA3qWqWdGH8Zek_s9EU.2dd.BOCKiClmLlOPKDp.PZj.Y0en_piXkeV6Sl0hZBuvmlSj7dz6pspxUV98vAz3rpjQFOZCqCQbdzA5VVs2THJ_AIY6drRj34eS0EDA6HzpCAXXrkHF6qybNpcxQXaDCi.VPZjhiQsYZKK1iiD1h_SndNjUeZqQXVboOx1f5toCNPHZyUIFLcwomgdL3cMh9sSwbykyh_5zFQK4iqzEItM3DoaCkVzR_qrtGvh7fDdF6a8OfSRLU24QG2hGdH93EfjtIubjS3eZtf.a_S_59t65mJpmMK3.Z9CNEU6ejIYAOO_8fbHbGVTyz6If.Fg2wA1u1srk8qpNr_Akp306F2aCfDCgZe.Ay7HDimV4_UBmANLJpHwXuO7fzmJ5gwxqgjqXcH6_Rc8dUv3LKv0Nsve1ZrNxpaD.xfVFtbA_VWCM9Q1lbRNn9jTjN6Kmq2cwo_XJLCHNPEw59fQr7_EyXmyw&encver=1&encalgo=3DES-CFB-SHA1&app=apt&intf=1&click=http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3NWVkZnVtcihnaWQkbFljcXlqSXdOaTZ5UmhzbVVwVHlvUU93TVRBNExsTnY5R1BfX3hNQSxzdCQxMzk5ODQ1OTg5MzYyOTU2LHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkNDAwNjQ5MDA1MSx2JDIuMCxhaWQkOVBzTWZHS0xjNkUtLGN0JDI1LHlieCRhdjhyZklraWRLU2FCa1hGLnVub3RRLGJpJDIwOTQ5OTU1NTEsbW1lJDg4MzIxNzA5NjY5NDM0ODk0NDIsciQwLHlvbyQxLGFncCQzMTk1OTM2NTUxLGFwJEZCMikp/0/*"></script><NOSCRIPT><a href="http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3aXZsbjhqbChnaWQkbFljcXlqSXdOaTZ5UmhzbVVwVHlvUU93TVRBNExsTnY5R1BfX3hNQSxzdCQxMzk5ODQ1OTg5MzYyOTU2LHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkNDAwNjQ5MDA1MSx2JDIuMCxhaWQkOVBzTWZHS0xjNkUtLGN0JDI1LHlieCRhdjhyZklraWRLU2FCa1hGLnVub3RRLGJpJDIwOTQ5OTU1NTEsbW1lJDg4MzIxNzA5NjY5NDM0ODk0NDIsciQxLHJkJDE0YnQ3b2dwYix5b28kMSxhZ3AkMzE5NTkzNjU1MSxhcCRGQjIpKQ/2/*https://ad.wsod.com/click/8bec9b10877d5d7fd7c0fb6e6a631357/1542.0.img.120x60/?yud=&encver=${ENC_VERSION}&encalgo=${ENC_ALGO}&app=apt&intf=1" target="_blank"><img width="120" height="60" border="0" src="https://ad.wsod.com/embed/8bec9b10877d5d7fd7c0fb6e6a631357/1542.0.img.120x60/1399845989.435266?yud=smpv%3d3%26ed%3dKfb2BHkzObF0OPI9Q.6FtZbkSliqfEhrwqW60UZSoR3xvucF8txzwcjUIdM1FNLOlDMJNO3VKY3lwvdYEY3fDwfAWZ7CQCWWuATZjY6FR39ApR6n7HML9c5BGa46lM3IFeXC791QmLU_5P8ySRjZU52HE7FMYjYP89t3Fl69NTaCpC370qQC2YY8QLoGEerBJanAt.Jr1zL4bn5POCOF9fQ.xA3qWqWdGH8Zek_s9EU.2dd.BOCKiClmLlOPKDp.PZj.Y0en_piXkeV6Sl0hZBuvmlSj7dz6pspxUV98vAz3rpjQFOZCqCQbdzA5VVs2THJ_AIY6drRj34eS0EDA6HzpCAXXrkHF6qybNpcxQXaDCi.VPZjhiQsYZKK1iiD1h_SndNjUeZqQXVboOx1f5toCNPHZyUIFLcwomgdL3cMh9sSwbykyh_5zFQK4iqzEItM3DoaCkVzR_qrtGvh7fDdF6a8OfSRLU24QG2hGdH93EfjtIubjS3eZtf.a_S_59t65mJpmMK3.Z9CNEU6ejIYAOO_8fbHbGVTyz6If.Fg2wA1u1srk8qpNr_Akp306F2aCfDCgZe.Ay7HDimV4_UBmANLJpHwXuO7fzmJ5gwxqgjqXcH6_Rc8dUv3LKv0Nsve1ZrNxpaD.xfVFtbA_VWCM9Q1lbRNn9jTjN6Kmq2cwo_XJLCHNPEw59fQr7_EyXmyw&encver=1&encalgo=3DES-CFB-SHA1&app=apt&intf=1&" /></a></NOSCRIPT><!--QYZ 2094995551,4006490051,98.139.115.226;;FB2;28951412;1;--><script language=javascript>
+if(window.xzq_d==null)window.xzq_d=new Object();
+window.xzq_d['9PsMfGKLc6E-']='(as$12r85lnt1,aid$9PsMfGKLc6E-,bi$2094995551,cr$4006490051,ct$25,at$H,eob$gd1_match_id=-1:ypos=FB2)';
+</script><noscript><img width=1 height=1 alt="" src="http://csc.beap.bc.yahoo.com/yi?bv=1.0.0&bs=(134q4e8mq(gid$lYcqyjIwNi6yRhsmUpTyoQOwMTA4LlNv9GP__xMA,st$1399845989362956,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3&al=(as$12r85lnt1,aid$9PsMfGKLc6E-,bi$2094995551,cr$4006490051,ct$25,at$H,eob$gd1_match_id=-1:ypos=FB2)"></noscript></span></td><td align="center"><!--ADS:LOCATION=FB2--><span id="yfs_ad_n4FB2" ><!-- APT Vendor: WSOD, Format: Standard Graphical -->
+<script type="text/javascript" src="https://ad.wsod.com/embed/5fbc498f96d2d4ea0e6c7a3e8dc788e2/1.0.js.120x60/1399845989.436058?yud=smpv%3d3%26ed%3dKfb2BHkzObF0OPI9Q.6FtZbkSliqfEhrwqW60UZSoR3xvucF8txzwcjUIdM1FNLOlDMJNO3VKY3lwvdYEY3fDwfAWZ7CQCWWuATZjY6FR39ApR6n7HML9c5BGa46lM3IFeXC791QmLU_5P8ySRjZU52HE7FMYjYP89t3Fl69NTaCpC370qQC2YY8QLoGEerBJanAt.Jr1zL4bn5POCOF9fQ.xA3qWqWdGH8Zek_s9EU.2dd.BOCKiClmLlOPKDp.PZj.Y0en_piXkeV6Sl0hZBuvmlSj7dz6pspxUV98vAz3rpjQFOZCqCQbdzA5VVs2THJ_AIY6drRj34eS0EDA6HzpCAXXrkHF6qybNpcxQXaDCi.VPZjhiQsYZKK1iiD1h_SndNjUeZqQXVboOx1f5toCNPHZyUIFLcwomgdL3cMh9sSwbykyh_5zFQK4iqzEItM3DoaCkVzR_qrtGvh7fDdF6a8OfSRLU24QG2hGdH93EfjtIubjS3eZtf.a_S_59t65mJpmMK3.Z9CNEU6ejIYAOO_8fbHbGVTyz6If.Fg2wA1u1srk8qpNr_Akp306F2aCfDCgZe.Ay7HDimV4_UBmANLJpHwXuO7fzmJ5gwxqgjqXcH6_Rc8dUv3LKv0Nsve1ZrNxpaD.xfVFtbA_VWCM9Q1lbRNn9jTjNqujpGayyGE21V0i2WvCtKx2aOaPCJX0&encver=1&encalgo=3DES-CFB-SHA1&app=apt&intf=1&click=http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3NWVtOGRiNyhnaWQkbFljcXlqSXdOaTZ5UmhzbVVwVHlvUU93TVRBNExsTnY5R1BfX3hNQSxzdCQxMzk5ODQ1OTg5MzYyOTU2LHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkMzk5NDcxNTU1MSx2JDIuMCxhaWQkaWhJTmZHS0xjNkUtLGN0JDI1LHlieCRhdjhyZklraWRLU2FCa1hGLnVub3RRLGJpJDIwODA1NDUwNTEsbW1lJDg3NjU4MDUxMzIyODU2ODA4NDMsciQwLHlvbyQxLGFncCQzMTY3NDIzNTUxLGFwJEZCMikp/0/*"></script><NOSCRIPT><a href="http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3aWh2OHVjaChnaWQkbFljcXlqSXdOaTZ5UmhzbVVwVHlvUU93TVRBNExsTnY5R1BfX3hNQSxzdCQxMzk5ODQ1OTg5MzYyOTU2LHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkMzk5NDcxNTU1MSx2JDIuMCxhaWQkaWhJTmZHS0xjNkUtLGN0JDI1LHlieCRhdjhyZklraWRLU2FCa1hGLnVub3RRLGJpJDIwODA1NDUwNTEsbW1lJDg3NjU4MDUxMzIyODU2ODA4NDMsciQxLHJkJDE0OGt0dHByYix5b28kMSxhZ3AkMzE2NzQyMzU1MSxhcCRGQjIpKQ/2/*https://ad.wsod.com/click/5fbc498f96d2d4ea0e6c7a3e8dc788e2/1.0.img.120x60/?yud=&encver=${ENC_VERSION}&encalgo=${ENC_ALGO}&app=apt&intf=1" target="_blank"><img width="120" height="60" border="0" src="https://ad.wsod.com/embed/5fbc498f96d2d4ea0e6c7a3e8dc788e2/1.0.img.120x60/1399845989.436058?yud=smpv%3d3%26ed%3dKfb2BHkzObF0OPI9Q.6FtZbkSliqfEhrwqW60UZSoR3xvucF8txzwcjUIdM1FNLOlDMJNO3VKY3lwvdYEY3fDwfAWZ7CQCWWuATZjY6FR39ApR6n7HML9c5BGa46lM3IFeXC791QmLU_5P8ySRjZU52HE7FMYjYP89t3Fl69NTaCpC370qQC2YY8QLoGEerBJanAt.Jr1zL4bn5POCOF9fQ.xA3qWqWdGH8Zek_s9EU.2dd.BOCKiClmLlOPKDp.PZj.Y0en_piXkeV6Sl0hZBuvmlSj7dz6pspxUV98vAz3rpjQFOZCqCQbdzA5VVs2THJ_AIY6drRj34eS0EDA6HzpCAXXrkHF6qybNpcxQXaDCi.VPZjhiQsYZKK1iiD1h_SndNjUeZqQXVboOx1f5toCNPHZyUIFLcwomgdL3cMh9sSwbykyh_5zFQK4iqzEItM3DoaCkVzR_qrtGvh7fDdF6a8OfSRLU24QG2hGdH93EfjtIubjS3eZtf.a_S_59t65mJpmMK3.Z9CNEU6ejIYAOO_8fbHbGVTyz6If.Fg2wA1u1srk8qpNr_Akp306F2aCfDCgZe.Ay7HDimV4_UBmANLJpHwXuO7fzmJ5gwxqgjqXcH6_Rc8dUv3LKv0Nsve1ZrNxpaD.xfVFtbA_VWCM9Q1lbRNn9jTjNqujpGayyGE21V0i2WvCtKx2aOaPCJX0&encver=1&encalgo=3DES-CFB-SHA1&app=apt&intf=1&" /></a></NOSCRIPT>
+
+<img src="https://adfarm.mediaplex.com/ad/tr/17113-191624-6548-18?mpt=1399845989.436058" border="0" width=1 height=1><!--QYZ 2080545051,3994715551,98.139.115.226;;FB2;28951412;1;--><script language=javascript>
+if(window.xzq_d==null)window.xzq_d=new Object();
+window.xzq_d['ihINfGKLc6E-']='(as$12rcp3jpe,aid$ihINfGKLc6E-,bi$2080545051,cr$3994715551,ct$25,at$H,eob$gd1_match_id=-1:ypos=FB2)';
+</script><noscript><img width=1 height=1 alt="" src="http://csc.beap.bc.yahoo.com/yi?bv=1.0.0&bs=(134q4e8mq(gid$lYcqyjIwNi6yRhsmUpTyoQOwMTA4LlNv9GP__xMA,st$1399845989362956,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3&al=(as$12rcp3jpe,aid$ihINfGKLc6E-,bi$2080545051,cr$3994715551,ct$25,at$H,eob$gd1_match_id=-1:ypos=FB2)"></noscript></span></td><td align="center"><!--ADS:LOCATION=FB2--><span id="yfs_ad_n4FB2" ><img src="https://secure.insightexpressai.com/adServer/adServerESI.aspx?bannerID=253032&script=false&redir=https://secure.insightexpressai.com/adserver/1pixel.gif"style="display: none;"><a href="http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3aXVyZXZzbShnaWQkbFljcXlqSXdOaTZ5UmhzbVVwVHlvUU93TVRBNExsTnY5R1BfX3hNQSxzdCQxMzk5ODQ1OTg5MzYyOTU2LHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkMzg4MDU4OTA1MSx2JDIuMCxhaWQkSUNrTmZHS0xjNkUtLGN0JDI1LHlieCRhdjhyZklraWRLU2FCa1hGLnVub3RRLGJpJDIwMjM4NDUwNTEsbW1lJDg1MTM4NzA5NDA2MzY2MzU5NzIsciQwLHJkJDExazhkNzkwcyx5b28kMSxhZ3AkMzA2OTk5NTA1MSxhcCRGQjIpKQ/2/*https://ad.doubleclick.net/clk;278245623;105342498;k" target="_blank"><img src="http://ads.yldmgrimg.net/apex/mediastore/4ad179f5-f27a-4bc9-a010-7eced3e1e723" alt="" title="" width=120 height=60 border=0/></a><!--QYZ 2023845051,3880589051,98.139.115.226;;FB2;28951412;1;--><script language=javascript>
+if(window.xzq_d==null)window.xzq_d=new Object();
+window.xzq_d['ICkNfGKLc6E-']='(as$12rgt7l1j,aid$ICkNfGKLc6E-,bi$2023845051,cr$3880589051,ct$25,at$H,eob$gd1_match_id=-1:ypos=FB2)';
+</script><noscript><img width=1 height=1 alt="" src="http://csc.beap.bc.yahoo.com/yi?bv=1.0.0&bs=(134q4e8mq(gid$lYcqyjIwNi6yRhsmUpTyoQOwMTA4LlNv9GP__xMA,st$1399845989362956,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3&al=(as$12rgt7l1j,aid$ICkNfGKLc6E-,bi$2023845051,cr$3880589051,ct$25,at$H,eob$gd1_match_id=-1:ypos=FB2)"></noscript></span></td><td align="center"><!--ADS:LOCATION=FB2--><span id="yfs_ad_n4FB2" ><img src="https://secure.insightexpressai.com/adServer/adServerESI.aspx?bannerID=252780&script=false&redir=https://secure.insightexpressai.com/adserver/1pixel.gif"style="display: none;"><a href="http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3aWlpcG9kbyhnaWQkbFljcXlqSXdOaTZ5UmhzbVVwVHlvUU93TVRBNExsTnY5R1BfX3hNQSxzdCQxMzk5ODQ1OTg5MzYyOTU2LHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkNDAwNjQ5NDU1MSx2JDIuMCxhaWQkdGo4TmZHS0xjNkUtLGN0JDI1LHlieCRhdjhyZklraWRLU2FCa1hGLnVub3RRLGJpJDIwOTQ5OTk1NTEsbW1lJDg4MzIyNzQwNDYxNTg1OTM0NjksciQwLHJkJDExa2JyMWJ2Yyx5b28kMSxhZ3AkMzE5NTk5ODU1MSxhcCRGQjIpKQ/2/*https://ad.doubleclick.net/clk;280783869;105467344;u" target="_blank"><img src="http://ads.yldmgrimg.net/apex/mediastore/184e1bda-75d0-4499-9eff-bb19bcec84cd" alt="" title="" width=120 height=60 border=0/></a><!--QYZ 2094999551,4006494551,98.139.115.226;;FB2;28951412;1;--><script language=javascript>
+if(window.xzq_d==null)window.xzq_d=new Object();
+window.xzq_d['tj8NfGKLc6E-']='(as$12r4964np,aid$tj8NfGKLc6E-,bi$2094999551,cr$4006494551,ct$25,at$H,eob$gd1_match_id=-1:ypos=FB2)';
+</script><noscript><img width=1 height=1 alt="" src="http://csc.beap.bc.yahoo.com/yi?bv=1.0.0&bs=(134q4e8mq(gid$lYcqyjIwNi6yRhsmUpTyoQOwMTA4LlNv9GP__xMA,st$1399845989362956,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3&al=(as$12r4964np,aid$tj8NfGKLc6E-,bi$2094999551,cr$4006494551,ct$25,at$H,eob$gd1_match_id=-1:ypos=FB2)"></noscript></span></td></tr></table><br><div class="rtq_leaf"><div class="rtq_div"><div class="yui-g"><div class="yfi_rt_quote_summary" id="yfi_rt_quote_summary"><div class="hd"><div class="title"><h2>Apple Inc. (AAPL)</h2> <span class="rtq_exch"><span class="rtq_dash">-</span>NasdaqGS </span><span class="wl_sign"></span></div></div><div class="yfi_rt_quote_summary_rt_top sigfig_promo_1"><div> <span class="time_rtq_ticker"><span id="yfs_l84_aapl">585.54</span></span> <span class="down_r time_rtq_content"><span id="yfs_c63_aapl"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> 2.45</span><span id="yfs_p43_aapl">(0.42%)</span> </span><span class="time_rtq"> <span id="yfs_t53_aapl">May 9, 4:00PM EDT</span></span></div><div><span class="rtq_separator">|</span>After Hours
+ :
+ <span class="yfs_rtq_quote"><span id="yfs_l86_aapl">585.73</span></span> <span class="up_g"><span id="yfs_c85_aapl"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> 0.19</span> <span id="yfs_c86_aapl">(0.03%)</span></span><span class="time_rtq"> <span id="yfs_t54_aapl">May 9, 7:59PM EDT</span></span></div></div><style>
+ #yfi_toolbox_mini_rtq.sigfig_promo {
+ bottom:45px !important;
+ }
+ </style><div class="sigfig_promo" id="yfi_toolbox_mini_rtq"><div class="promo_text">Get the big picture on all your investments.</div><div class="promo_link"><a href="https://finance.yahoo.com/portfolio/ytosv2">Sync your Yahoo portfolio now</a></div></div></div></div></div></div><table width="580" id="yfncsumtab" cellpadding="0" cellspacing="0" border="0"><tr><td colspan="3"><table border="0" cellspacing="0" class="yfnc_modtitle1" style="border-bottom:1px solid #dcdcdc; margin-bottom:10px; width:100%;"><form action="/q/op" accept-charset="utf-8"><tr><td><big><b>Options</b></big></td><td align="right"><small><b>Get Options for:</b> <input name="s" id="pageTicker" size="10" /></small><input id="get_quote_logic_opt" name="ql" value="1" type="hidden" autocomplete="off"><input value="GO" type="submit" style="margin-left:3px;" class="rapid-nf"></td></tr></form></table></td></tr><tr valign="top"><td>View By Expiration: <strong>May 14</strong> | <a href="/q/op?s=AAPL&m=2014-06">Jun 14</a> | <a href="/q/op?s=AAPL&m=2014-07">Jul 14</a> | <a href="/q/op?s=AAPL&m=2014-08">Aug 14</a> | <a href="/q/op?s=AAPL&m=2014-10">Oct 14</a> | <a href="/q/op?s=AAPL&m=2015-01">Jan 15</a> | <a href="/q/op?s=AAPL&m=2016-01">Jan 16</a><table cellpadding="0" cellspacing="0" border="0"><tr><td height="2"></td></tr></table><table class="yfnc_mod_table_title1" width="100%" cellpadding="2" cellspacing="0" border="0"><tr valign="top"><td><small><b><strong class="yfi-module-title">Call Options</strong></b></small></td><td align="right">Expire at close Friday, May 30, 2014</td></tr></table><table class="yfnc_datamodoutline1" width="100%" cellpadding="0" cellspacing="0" border="0"><tr valign="top"><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><th scope="col" class="yfnc_tablehead1" width="12%" align="left">Strike</th><th scope="col" class="yfnc_tablehead1" width="12%">Symbol</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Last</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Chg</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Bid</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Ask</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Vol</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Open Int</th></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=330.000000"><strong>330.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00330000">AAPL140517C00330000</a></td><td class="yfnc_h" align="right"><b>263.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00330000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">254.30</td><td class="yfnc_h" align="right">256.90</td><td class="yfnc_h" align="right">6</td><td class="yfnc_h" align="right">2</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=400.000000"><strong>400.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00400000">AAPL140517C00400000</a></td><td class="yfnc_h" align="right"><b>190.70</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00400000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">184.35</td><td class="yfnc_h" align="right">186.40</td><td class="yfnc_h" align="right">873</td><td class="yfnc_h" align="right">5</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=410.000000"><strong>410.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00410000">AAPL140517C00410000</a></td><td class="yfnc_h" align="right"><b>181.30</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00410000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">174.40</td><td class="yfnc_h" align="right">176.45</td><td class="yfnc_h" align="right">68</td><td class="yfnc_h" align="right">10</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=420.000000"><strong>420.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00420000">AAPL140517C00420000</a></td><td class="yfnc_h" align="right"><b>170.80</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00420000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">164.35</td><td class="yfnc_h" align="right">166.50</td><td class="yfnc_h" align="right">124</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=430.000000"><strong>430.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00430000">AAPL140517C00430000</a></td><td class="yfnc_h" align="right"><b>160.75</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00430000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">154.40</td><td class="yfnc_h" align="right">156.50</td><td class="yfnc_h" align="right">376</td><td class="yfnc_h" align="right">22</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=440.000000"><strong>440.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00440000">AAPL140517C00440000</a></td><td class="yfnc_h" align="right"><b>149.70</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00440000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">144.40</td><td class="yfnc_h" align="right">146.60</td><td class="yfnc_h" align="right">90</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=445.000000"><strong>445.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00445000">AAPL140517C00445000</a></td><td class="yfnc_h" align="right"><b>145.55</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00445000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">139.40</td><td class="yfnc_h" align="right">141.45</td><td class="yfnc_h" align="right">106</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=450.000000"><strong>450.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00450000">AAPL140517C00450000</a></td><td class="yfnc_h" align="right"><b>131.27</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00450000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">9.18</b></span></td><td class="yfnc_h" align="right">134.40</td><td class="yfnc_h" align="right">136.90</td><td class="yfnc_h" align="right">4</td><td class="yfnc_h" align="right">52</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=450.000000"><strong>450.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517C00450000">AAPL7140517C00450000</a></td><td class="yfnc_h" align="right"><b>117.45</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517c00450000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">133.40</td><td class="yfnc_h" align="right">137.80</td><td class="yfnc_h" align="right">5</td><td class="yfnc_h" align="right">2</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=455.000000"><strong>455.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00455000">AAPL140517C00455000</a></td><td class="yfnc_h" align="right"><b>134.70</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00455000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">129.40</td><td class="yfnc_h" align="right">131.40</td><td class="yfnc_h" align="right">90</td><td class="yfnc_h" align="right">2</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=460.000000"><strong>460.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00460000">AAPL140517C00460000</a></td><td class="yfnc_h" align="right"><b>130.95</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00460000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">124.40</td><td class="yfnc_h" align="right">126.90</td><td class="yfnc_h" align="right">309</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=460.000000"><strong>460.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517C00460000">AAPL7140517C00460000</a></td><td class="yfnc_h" align="right"><b>122.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517c00460000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">17.50</b></span></td><td class="yfnc_h" align="right">123.30</td><td class="yfnc_h" align="right">127.55</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=465.000000"><strong>465.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00465000">AAPL140517C00465000</a></td><td class="yfnc_h" align="right"><b>125.70</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00465000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">119.45</td><td class="yfnc_h" align="right">121.70</td><td class="yfnc_h" align="right">172</td><td class="yfnc_h" align="right">4</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=470.000000"><strong>470.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00470000">AAPL140517C00470000</a></td><td class="yfnc_h" align="right"><b>111.95</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00470000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">5.76</b></span></td><td class="yfnc_h" align="right">114.45</td><td class="yfnc_h" align="right">116.10</td><td class="yfnc_h" align="right">15</td><td class="yfnc_h" align="right">19</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=470.000000"><strong>470.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517C00470000">AAPL7140517C00470000</a></td><td class="yfnc_h" align="right"><b>62.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517c00470000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">113.40</td><td class="yfnc_h" align="right">116.30</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=470.000000"><strong>470.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00470000">AAPL140523C00470000</a></td><td class="yfnc_h" align="right"><b>122.85</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00470000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">114.50</td><td class="yfnc_h" align="right">116.30</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=475.000000"><strong>475.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00475000">AAPL140517C00475000</a></td><td class="yfnc_h" align="right"><b>108.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00475000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">4.23</b></span></td><td class="yfnc_h" align="right">109.40</td><td class="yfnc_h" align="right">111.70</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">8</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=480.000000"><strong>480.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00480000">AAPL140517C00480000</a></td><td class="yfnc_h" align="right"><b>102.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00480000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">8.60</b></span></td><td class="yfnc_h" align="right">104.40</td><td class="yfnc_h" align="right">106.80</td><td class="yfnc_h" align="right">4</td><td class="yfnc_h" align="right">31</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=485.000000"><strong>485.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00485000">AAPL140517C00485000</a></td><td class="yfnc_h" align="right"><b>107.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00485000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">99.35</td><td class="yfnc_h" align="right">101.85</td><td class="yfnc_h" align="right">302</td><td class="yfnc_h" align="right">3</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=490.000000"><strong>490.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00490000">AAPL140517C00490000</a></td><td class="yfnc_h" align="right"><b>91.90</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00490000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">8.55</b></span></td><td class="yfnc_h" align="right">94.35</td><td class="yfnc_h" align="right">96.90</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">18</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=490.000000"><strong>490.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517C00490000">AAPL7140517C00490000</a></td><td class="yfnc_h" align="right"><b>97.53</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517c00490000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">93.40</td><td class="yfnc_h" align="right">97.35</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">5</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=495.000000"><strong>495.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00495000">AAPL140517C00495000</a></td><td class="yfnc_h" align="right"><b>89.35</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00495000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">3.01</b></span></td><td class="yfnc_h" align="right">89.40</td><td class="yfnc_h" align="right">91.85</td><td class="yfnc_h" align="right">5</td><td class="yfnc_h" align="right">4</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=500.000000"><strong>500.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00500000">AAPL140517C00500000</a></td><td class="yfnc_h" align="right"><b>85.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00500000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">4.75</b></span></td><td class="yfnc_h" align="right">84.45</td><td class="yfnc_h" align="right">85.95</td><td class="yfnc_h" align="right">7</td><td class="yfnc_h" align="right">518</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=500.000000"><strong>500.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517C00500000">AAPL7140517C00500000</a></td><td class="yfnc_h" align="right"><b>95.89</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517c00500000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">83.40</td><td class="yfnc_h" align="right">86.90</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">41</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=500.000000"><strong>500.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00500000">AAPL140523C00500000</a></td><td class="yfnc_h" align="right"><b>85.55</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00500000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.15</b></span></td><td class="yfnc_h" align="right">85.25</td><td class="yfnc_h" align="right">86.00</td><td class="yfnc_h" align="right">103</td><td class="yfnc_h" align="right">260</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=500.000000"><strong>500.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00500000">AAPL140530C00500000</a></td><td class="yfnc_h" align="right"><b>91.45</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00500000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">84.55</td><td class="yfnc_h" align="right">87.00</td><td class="yfnc_h" align="right">85</td><td class="yfnc_h" align="right">5</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=502.500000"><strong>502.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00502500">AAPL140530C00502500</a></td><td class="yfnc_h" align="right"><b>80.20</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00502500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">6.52</b></span></td><td class="yfnc_h" align="right">82.05</td><td class="yfnc_h" align="right">83.70</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=505.000000"><strong>505.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00505000">AAPL140517C00505000</a></td><td class="yfnc_h" align="right"><b>87.73</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00505000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">79.35</td><td class="yfnc_h" align="right">81.25</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">43</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=505.000000"><strong>505.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517C00505000">AAPL7140517C00505000</a></td><td class="yfnc_h" align="right"><b>92.71</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517c00505000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">78.40</td><td class="yfnc_h" align="right">81.30</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">5</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=505.000000"><strong>505.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00505000">AAPL140523C00505000</a></td><td class="yfnc_h" align="right"><b>28.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00505000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">79.50</td><td class="yfnc_h" align="right">81.90</td><td class="yfnc_h" align="right">385</td><td class="yfnc_h" align="right">20</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=510.000000"><strong>510.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00510000">AAPL140517C00510000</a></td><td class="yfnc_h" align="right"><b>71.58</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00510000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">10.95</b></span></td><td class="yfnc_h" align="right">74.45</td><td class="yfnc_h" align="right">76.00</td><td class="yfnc_h" align="right">28</td><td class="yfnc_h" align="right">104</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=515.000000"><strong>515.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00515000">AAPL140517C00515000</a></td><td class="yfnc_h" align="right"><b>67.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00515000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">7.05</b></span></td><td class="yfnc_h" align="right">69.40</td><td class="yfnc_h" align="right">71.00</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">50</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=515.000000"><strong>515.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00515000">AAPL140523C00515000</a></td><td class="yfnc_h" align="right"><b>73.20</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00515000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">69.50</td><td class="yfnc_h" align="right">71.80</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=515.000000"><strong>515.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00515000">AAPL140530C00515000</a></td><td class="yfnc_h" align="right"><b>74.24</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00515000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">69.50</td><td class="yfnc_h" align="right">71.50</td><td class="yfnc_h" align="right">63</td><td class="yfnc_h" align="right">10</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=520.000000"><strong>520.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00520000">AAPL140517C00520000</a></td><td class="yfnc_h" align="right"><b>62.30</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00520000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">5.19</b></span></td><td class="yfnc_h" align="right">64.45</td><td class="yfnc_h" align="right">66.00</td><td class="yfnc_h" align="right">5</td><td class="yfnc_h" align="right">116</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=520.000000"><strong>520.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517C00520000">AAPL7140517C00520000</a></td><td class="yfnc_h" align="right"><b>72.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517c00520000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">63.45</td><td class="yfnc_h" align="right">67.00</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">27</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=520.000000"><strong>520.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00520000">AAPL140530C00520000</a></td><td class="yfnc_h" align="right"><b>72.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00520000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">64.65</td><td class="yfnc_h" align="right">66.30</td><td class="yfnc_h" align="right">351</td><td class="yfnc_h" align="right">10</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=522.500000"><strong>522.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00522500">AAPL140523C00522500</a></td><td class="yfnc_h" align="right"><b>60.20</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00522500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">5.95</b></span></td><td class="yfnc_h" align="right">62.05</td><td class="yfnc_h" align="right">64.30</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">2</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=525.000000"><strong>525.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00525000">AAPL140517C00525000</a></td><td class="yfnc_h" align="right"><b>59.87</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00525000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.68</b></span></td><td class="yfnc_h" align="right">59.70</td><td class="yfnc_h" align="right">61.00</td><td class="yfnc_h" align="right">15</td><td class="yfnc_h" align="right">380</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=525.000000"><strong>525.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517C00525000">AAPL7140517C00525000</a></td><td class="yfnc_h" align="right"><b>60.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517c00525000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">7.35</b></span></td><td class="yfnc_h" align="right">58.45</td><td class="yfnc_h" align="right">61.85</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">27</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=525.000000"><strong>525.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00525000">AAPL140523C00525000</a></td><td class="yfnc_h" align="right"><b>57.70</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00525000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">8.60</b></span></td><td class="yfnc_h" align="right">59.55</td><td class="yfnc_h" align="right">61.15</td><td class="yfnc_h" align="right">11</td><td class="yfnc_h" align="right">17</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=525.000000"><strong>525.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140523C00525000">AAPL7140523C00525000</a></td><td class="yfnc_h" align="right"><b>60.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140523c00525000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">46.00</b></span></td><td class="yfnc_h" align="right">58.45</td><td class="yfnc_h" align="right">61.40</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">2</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=525.000000"><strong>525.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00525000">AAPL140530C00525000</a></td><td class="yfnc_h" align="right"><b>57.02</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00525000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">8.64</b></span></td><td class="yfnc_h" align="right">59.65</td><td class="yfnc_h" align="right">61.10</td><td class="yfnc_h" align="right">33</td><td class="yfnc_h" align="right">43</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=525.000000"><strong>525.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140530C00525000">AAPL7140530C00525000</a></td><td class="yfnc_h" align="right"><b>56.64</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140530c00525000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">11.64</b></span></td><td class="yfnc_h" align="right">58.60</td><td class="yfnc_h" align="right">62.90</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=530.000000"><strong>530.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00530000">AAPL140517C00530000</a></td><td class="yfnc_h" align="right"><b>54.86</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00530000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.44</b></span></td><td class="yfnc_h" align="right">55.15</td><td class="yfnc_h" align="right">55.90</td><td class="yfnc_h" align="right">21</td><td class="yfnc_h" align="right">326</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=530.000000"><strong>530.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517C00530000">AAPL7140517C00530000</a></td><td class="yfnc_h" align="right"><b>55.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517c00530000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">5.00</b></span></td><td class="yfnc_h" align="right">53.40</td><td class="yfnc_h" align="right">56.45</td><td class="yfnc_h" align="right">5</td><td class="yfnc_h" align="right">22</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=530.000000"><strong>530.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00530000">AAPL140523C00530000</a></td><td class="yfnc_h" align="right"><b>57.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00530000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">54.50</td><td class="yfnc_h" align="right">56.35</td><td class="yfnc_h" align="right">4</td><td class="yfnc_h" align="right">81</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=530.000000"><strong>530.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140523C00530000">AAPL7140523C00530000</a></td><td class="yfnc_h" align="right"><b>63.18</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140523c00530000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">53.55</td><td class="yfnc_h" align="right">57.40</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">3</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=530.000000"><strong>530.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00530000">AAPL140530C00530000</a></td><td class="yfnc_h" align="right"><b>52.05</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00530000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">9.95</b></span></td><td class="yfnc_h" align="right">54.65</td><td class="yfnc_h" align="right">56.90</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">14</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=532.500000"><strong>532.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00532500">AAPL140523C00532500</a></td><td class="yfnc_h" align="right"><b>57.40</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00532500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">52.00</td><td class="yfnc_h" align="right">54.15</td><td class="yfnc_h" align="right">165</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=532.500000"><strong>532.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00532500">AAPL140530C00532500</a></td><td class="yfnc_h" align="right"><b>57.86</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00532500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">52.25</td><td class="yfnc_h" align="right">54.50</td><td class="yfnc_h" align="right">66</td><td class="yfnc_h" align="right">10</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=535.000000"><strong>535.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00535000">AAPL140517C00535000</a></td><td class="yfnc_h" align="right"><b>50.35</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00535000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.75</b></span></td><td class="yfnc_h" align="right">50.10</td><td class="yfnc_h" align="right">51.05</td><td class="yfnc_h" align="right">228</td><td class="yfnc_h" align="right">769</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=535.000000"><strong>535.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517C00535000">AAPL7140517C00535000</a></td><td class="yfnc_h" align="right"><b>57.36</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517c00535000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">48.50</td><td class="yfnc_h" align="right">51.25</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">17</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=535.000000"><strong>535.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00535000">AAPL140523C00535000</a></td><td class="yfnc_h" align="right"><b>57.75</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00535000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">49.60</td><td class="yfnc_h" align="right">51.40</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">3</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=535.000000"><strong>535.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00535000">AAPL140530C00535000</a></td><td class="yfnc_h" align="right"><b>47.52</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00535000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">9.23</b></span></td><td class="yfnc_h" align="right">49.75</td><td class="yfnc_h" align="right">51.90</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">58</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=540.000000"><strong>540.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00540000">AAPL140517C00540000</a></td><td class="yfnc_h" align="right"><b>41.80</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00540000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">5.89</b></span></td><td class="yfnc_h" align="right">44.45</td><td class="yfnc_h" align="right">46.00</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">199</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=540.000000"><strong>540.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517C00540000">AAPL7140517C00540000</a></td><td class="yfnc_h" align="right"><b>43.37</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517c00540000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">6.83</b></span></td><td class="yfnc_h" align="right">43.50</td><td class="yfnc_h" align="right">46.35</td><td class="yfnc_h" align="right">5</td><td class="yfnc_h" align="right">15</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=540.000000"><strong>540.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00540000">AAPL140523C00540000</a></td><td class="yfnc_h" align="right"><b>42.29</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00540000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">10.36</b></span></td><td class="yfnc_h" align="right">44.60</td><td class="yfnc_h" align="right">46.30</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">33</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=540.000000"><strong>540.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00540000">AAPL140530C00540000</a></td><td class="yfnc_h" align="right"><b>42.80</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00540000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">10.20</b></span></td><td class="yfnc_h" align="right">44.75</td><td class="yfnc_h" align="right">46.95</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">13</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=542.500000"><strong>542.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00542500">AAPL140523C00542500</a></td><td class="yfnc_h" align="right"><b>48.55</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00542500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">42.15</td><td class="yfnc_h" align="right">43.90</td><td class="yfnc_h" align="right">156</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=542.500000"><strong>542.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00542500">AAPL140530C00542500</a></td><td class="yfnc_h" align="right"><b>50.80</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00542500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">42.45</td><td class="yfnc_h" align="right">44.35</td><td class="yfnc_h" align="right">7</td><td class="yfnc_h" align="right">7</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=545.000000"><strong>545.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00545000">AAPL140517C00545000</a></td><td class="yfnc_h" align="right"><b>36.72</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00545000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">5.68</b></span></td><td class="yfnc_h" align="right">40.25</td><td class="yfnc_h" align="right">41.05</td><td class="yfnc_h" align="right">177</td><td class="yfnc_h" align="right">901</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=545.000000"><strong>545.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517C00545000">AAPL7140517C00545000</a></td><td class="yfnc_h" align="right"><b>42.90</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517c00545000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">38.50</td><td class="yfnc_h" align="right">41.40</td><td class="yfnc_h" align="right">144</td><td class="yfnc_h" align="right">150</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=545.000000"><strong>545.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00545000">AAPL140530C00545000</a></td><td class="yfnc_h" align="right"><b>45.85</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00545000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">40.00</td><td class="yfnc_h" align="right">41.90</td><td class="yfnc_h" align="right">125</td><td class="yfnc_h" align="right">5</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=550.000000"><strong>550.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00550000">AAPL140517C00550000</a></td><td class="yfnc_h" align="right"><b>35.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00550000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.00</b></span></td><td class="yfnc_h" align="right">35.65</td><td class="yfnc_h" align="right">36.00</td><td class="yfnc_h" align="right">131</td><td class="yfnc_h" align="right">701</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=550.000000"><strong>550.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517C00550000">AAPL7140517C00550000</a></td><td class="yfnc_h" align="right"><b>30.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517c00550000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">11.50</b></span></td><td class="yfnc_h" align="right">33.55</td><td class="yfnc_h" align="right">36.35</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">5</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=550.000000"><strong>550.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00550000">AAPL140523C00550000</a></td><td class="yfnc_h" align="right"><b>34.45</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00550000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">7.60</b></span></td><td class="yfnc_h" align="right">34.80</td><td class="yfnc_h" align="right">36.30</td><td class="yfnc_h" align="right">19</td><td class="yfnc_h" align="right">20</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=550.000000"><strong>550.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00550000">AAPL140530C00550000</a></td><td class="yfnc_h" align="right"><b>32.83</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00550000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">7.82</b></span></td><td class="yfnc_h" align="right">35.50</td><td class="yfnc_h" align="right">36.80</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">42</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=552.500000"><strong>552.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00552500">AAPL140523C00552500</a></td><td class="yfnc_h" align="right"><b>38.95</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00552500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">32.40</td><td class="yfnc_h" align="right">34.20</td><td class="yfnc_h" align="right">214</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=552.500000"><strong>552.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00552500">AAPL140530C00552500</a></td><td class="yfnc_h" align="right"><b>37.64</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00552500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">32.95</td><td class="yfnc_h" align="right">34.80</td><td class="yfnc_h" align="right">69</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=555.000000"><strong>555.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00555000">AAPL140517C00555000</a></td><td class="yfnc_h" align="right"><b>30.67</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00555000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.66</b></span></td><td class="yfnc_h" align="right">30.45</td><td class="yfnc_h" align="right">31.05</td><td class="yfnc_h" align="right">44</td><td class="yfnc_h" align="right">132</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=555.000000"><strong>555.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517C00555000">AAPL7140517C00555000</a></td><td class="yfnc_h" align="right"><b>36.65</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517c00555000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">28.50</td><td class="yfnc_h" align="right">32.55</td><td class="yfnc_h" align="right">9</td><td class="yfnc_h" align="right">2</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=555.000000"><strong>555.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00555000">AAPL140523C00555000</a></td><td class="yfnc_h" align="right"><b>32.80</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00555000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">29.95</td><td class="yfnc_h" align="right">31.65</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">3</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=555.000000"><strong>555.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00555000">AAPL140530C00555000</a></td><td class="yfnc_h" align="right"><b>38.30</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00555000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">30.65</td><td class="yfnc_h" align="right">32.25</td><td class="yfnc_h" align="right">10</td><td class="yfnc_h" align="right">11</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=557.500000"><strong>557.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00557500">AAPL140530C00557500</a></td><td class="yfnc_h" align="right"><b>26.52</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00557500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">9.48</b></span></td><td class="yfnc_h" align="right">28.40</td><td class="yfnc_h" align="right">29.85</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">10</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00560000">AAPL140517C00560000</a></td><td class="yfnc_h" align="right"><b>26.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00560000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.30</b></span></td><td class="yfnc_h" align="right">25.65</td><td class="yfnc_h" align="right">26.15</td><td class="yfnc_h" align="right">142</td><td class="yfnc_h" align="right">439</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517C00560000">AAPL7140517C00560000</a></td><td class="yfnc_h" align="right"><b>25.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517c00560000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">6.67</b></span></td><td class="yfnc_h" align="right">23.60</td><td class="yfnc_h" align="right">27.65</td><td class="yfnc_h" align="right">4</td><td class="yfnc_h" align="right">26</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00560000">AAPL140523C00560000</a></td><td class="yfnc_h" align="right"><b>23.11</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00560000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">4.89</b></span></td><td class="yfnc_h" align="right">25.35</td><td class="yfnc_h" align="right">26.85</td><td class="yfnc_h" align="right">10</td><td class="yfnc_h" align="right">127</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140523C00560000">AAPL7140523C00560000</a></td><td class="yfnc_h" align="right"><b>42.95</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140523c00560000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">24.30</td><td class="yfnc_h" align="right">28.20</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">2</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00560000">AAPL140530C00560000</a></td><td class="yfnc_h" align="right"><b>24.12</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00560000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">9.63</b></span></td><td class="yfnc_h" align="right">26.20</td><td class="yfnc_h" align="right">27.65</td><td class="yfnc_h" align="right">8</td><td class="yfnc_h" align="right">102</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=562.500000"><strong>562.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00562500">AAPL140517C00562500</a></td><td class="yfnc_h" align="right"><b>19.95</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00562500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">3.35</b></span></td><td class="yfnc_h" align="right">23.10</td><td class="yfnc_h" align="right">23.80</td><td class="yfnc_h" align="right">11</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=562.500000"><strong>562.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00562500">AAPL140523C00562500</a></td><td class="yfnc_h" align="right"><b>24.45</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00562500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.75</b></span></td><td class="yfnc_h" align="right">23.20</td><td class="yfnc_h" align="right">24.55</td><td class="yfnc_h" align="right">29</td><td class="yfnc_h" align="right">6</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=562.500000"><strong>562.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00562500">AAPL140530C00562500</a></td><td class="yfnc_h" align="right"><b>31.29</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00562500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">24.10</td><td class="yfnc_h" align="right">25.50</td><td class="yfnc_h" align="right">4</td><td class="yfnc_h" align="right">3</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00565000">AAPL140517C00565000</a></td><td class="yfnc_h" align="right"><b>21.10</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00565000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.40</b></span></td><td class="yfnc_h" align="right">20.75</td><td class="yfnc_h" align="right">21.35</td><td class="yfnc_h" align="right">64</td><td class="yfnc_h" align="right">247</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517C00565000">AAPL7140517C00565000</a></td><td class="yfnc_h" align="right"><b>17.01</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517c00565000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">9.02</b></span></td><td class="yfnc_h" align="right">18.75</td><td class="yfnc_h" align="right">22.80</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">10</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00565000">AAPL140523C00565000</a></td><td class="yfnc_h" align="right"><b>20.60</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00565000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">3.40</b></span></td><td class="yfnc_h" align="right">21.45</td><td class="yfnc_h" align="right">22.35</td><td class="yfnc_h" align="right">11</td><td class="yfnc_h" align="right">145</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140523C00565000">AAPL7140523C00565000</a></td><td class="yfnc_h" align="right"><b>29.30</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140523c00565000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">19.80</td><td class="yfnc_h" align="right">22.85</td><td class="yfnc_h" align="right">11</td><td class="yfnc_h" align="right">5</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00565000">AAPL140530C00565000</a></td><td class="yfnc_h" align="right"><b>23.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00565000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.60</b></span></td><td class="yfnc_h" align="right">22.85</td><td class="yfnc_h" align="right">23.40</td><td class="yfnc_h" align="right">15</td><td class="yfnc_h" align="right">119</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140530C00565000">AAPL7140530C00565000</a></td><td class="yfnc_h" align="right"><b>33.80</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140530c00565000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">21.20</td><td class="yfnc_h" align="right">23.85</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">3</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=567.500000"><strong>567.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00567500">AAPL140517C00567500</a></td><td class="yfnc_h" align="right"><b>16.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00567500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">33.50</b></span></td><td class="yfnc_h" align="right">18.30</td><td class="yfnc_h" align="right">18.95</td><td class="yfnc_h" align="right">10</td><td class="yfnc_h" align="right">2</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=567.500000"><strong>567.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00567500">AAPL140523C00567500</a></td><td class="yfnc_h" align="right"><b>20.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00567500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">4.85</b></span></td><td class="yfnc_h" align="right">19.50</td><td class="yfnc_h" align="right">20.20</td><td class="yfnc_h" align="right">8</td><td class="yfnc_h" align="right">4</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00570000">AAPL140517C00570000</a></td><td class="yfnc_h" align="right"><b>16.60</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00570000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.64</b></span></td><td class="yfnc_h" align="right">16.10</td><td class="yfnc_h" align="right">16.65</td><td class="yfnc_h" align="right">475</td><td class="yfnc_h" align="right">581</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517C00570000">AAPL7140517C00570000</a></td><td class="yfnc_h" align="right"><b>12.80</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517c00570000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">7.38</b></span></td><td class="yfnc_h" align="right">14.45</td><td class="yfnc_h" align="right">17.05</td><td class="yfnc_h" align="right">9</td><td class="yfnc_h" align="right">84</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00570000">AAPL140523C00570000</a></td><td class="yfnc_h" align="right"><b>15.21</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00570000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">4.64</b></span></td><td class="yfnc_h" align="right">17.50</td><td class="yfnc_h" align="right">18.10</td><td class="yfnc_h" align="right">11</td><td class="yfnc_h" align="right">146</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140523C00570000">AAPL7140523C00570000</a></td><td class="yfnc_h" align="right"><b>16.60</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140523c00570000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">4.03</b></span></td><td class="yfnc_h" align="right">16.00</td><td class="yfnc_h" align="right">18.70</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">2</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00570000">AAPL140530C00570000</a></td><td class="yfnc_h" align="right"><b>18.40</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00570000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.20</b></span></td><td class="yfnc_h" align="right">18.90</td><td class="yfnc_h" align="right">19.35</td><td class="yfnc_h" align="right">11</td><td class="yfnc_h" align="right">295</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140530C00570000">AAPL7140530C00570000</a></td><td class="yfnc_h" align="right"><b>18.90</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140530c00570000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.50</b></span></td><td class="yfnc_h" align="right">16.80</td><td class="yfnc_h" align="right">20.05</td><td class="yfnc_h" align="right">6</td><td class="yfnc_h" align="right">63</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=572.500000"><strong>572.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00572500">AAPL140517C00572500</a></td><td class="yfnc_h" align="right"><b>14.15</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00572500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">7.15</b></span></td><td class="yfnc_h" align="right">13.90</td><td class="yfnc_h" align="right">14.40</td><td class="yfnc_h" align="right">222</td><td class="yfnc_h" align="right">40</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=572.500000"><strong>572.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00572500">AAPL140523C00572500</a></td><td class="yfnc_h" align="right"><b>16.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00572500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.10</b></span></td><td class="yfnc_h" align="right">15.55</td><td class="yfnc_h" align="right">16.10</td><td class="yfnc_h" align="right">79</td><td class="yfnc_h" align="right">7</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=572.500000"><strong>572.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00572500">AAPL140530C00572500</a></td><td class="yfnc_h" align="right"><b>17.30</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00572500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.25</b></span></td><td class="yfnc_h" align="right">16.85</td><td class="yfnc_h" align="right">17.50</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">44</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=572.500000"><strong>572.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140530C00572500">AAPL7140530C00572500</a></td><td class="yfnc_h" align="right"><b>8.20</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140530c00572500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">15.35</td><td class="yfnc_h" align="right">17.85</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">3</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00575000">AAPL140517C00575000</a></td><td class="yfnc_h" align="right"><b>12.15</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00575000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.08</b></span></td><td class="yfnc_h" align="right">12.00</td><td class="yfnc_h" align="right">12.30</td><td class="yfnc_h" align="right">705</td><td class="yfnc_h" align="right">678</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517C00575000">AAPL7140517C00575000</a></td><td class="yfnc_h" align="right"><b>13.90</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517c00575000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">9.95</td><td class="yfnc_h" align="right">12.55</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">13</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00575000">AAPL140523C00575000</a></td><td class="yfnc_h" align="right"><b>14.10</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00575000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.30</b></span></td><td class="yfnc_h" align="right">13.85</td><td class="yfnc_h" align="right">14.25</td><td class="yfnc_h" align="right">101</td><td class="yfnc_h" align="right">277</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140523C00575000">AAPL7140523C00575000</a></td><td class="yfnc_h" align="right"><b>14.10</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140523c00575000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">3.12</b></span></td><td class="yfnc_h" align="right">11.75</td><td class="yfnc_h" align="right">14.55</td><td class="yfnc_h" align="right">6</td><td class="yfnc_h" align="right">17</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00575000">AAPL140530C00575000</a></td><td class="yfnc_h" align="right"><b>15.60</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00575000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.90</b></span></td><td class="yfnc_h" align="right">15.30</td><td class="yfnc_h" align="right">15.70</td><td class="yfnc_h" align="right">84</td><td class="yfnc_h" align="right">449</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140530C00575000">AAPL7140530C00575000</a></td><td class="yfnc_h" align="right"><b>14.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140530c00575000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">4.58</b></span></td><td class="yfnc_h" align="right">13.60</td><td class="yfnc_h" align="right">15.95</td><td class="yfnc_h" align="right">4</td><td class="yfnc_h" align="right">179</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=577.500000"><strong>577.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00577500">AAPL140517C00577500</a></td><td class="yfnc_h" align="right"><b>10.25</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00577500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">21.85</b></span></td><td class="yfnc_h" align="right">9.95</td><td class="yfnc_h" align="right">10.35</td><td class="yfnc_h" align="right">1,154</td><td class="yfnc_h" align="right">46</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=577.500000"><strong>577.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00577500">AAPL140523C00577500</a></td><td class="yfnc_h" align="right"><b>10.99</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00577500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.76</b></span></td><td class="yfnc_h" align="right">12.10</td><td class="yfnc_h" align="right">12.45</td><td class="yfnc_h" align="right">125</td><td class="yfnc_h" align="right">130</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=577.500000"><strong>577.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140523C00577500">AAPL7140523C00577500</a></td><td class="yfnc_h" align="right"><b>15.07</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140523c00577500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">10.45</td><td class="yfnc_h" align="right">13.40</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">15</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00580000">AAPL140517C00580000</a></td><td class="yfnc_h" align="right"><b>8.40</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00580000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.05</b></span></td><td class="yfnc_h" align="right">8.25</td><td class="yfnc_h" align="right">8.45</td><td class="yfnc_h" align="right">5,097</td><td class="yfnc_h" align="right">2,008</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517C00580000">AAPL7140517C00580000</a></td><td class="yfnc_h" align="right"><b>8.45</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517c00580000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">5.80</b></span></td><td class="yfnc_h" align="right">7.70</td><td class="yfnc_h" align="right">8.80</td><td class="yfnc_h" align="right">50</td><td class="yfnc_h" align="right">597</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00580000">AAPL140523C00580000</a></td><td class="yfnc_h" align="right"><b>10.60</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00580000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.45</b></span></td><td class="yfnc_h" align="right">10.50</td><td class="yfnc_h" align="right">10.80</td><td class="yfnc_h" align="right">395</td><td class="yfnc_h" align="right">418</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140523C00580000">AAPL7140523C00580000</a></td><td class="yfnc_h" align="right"><b>10.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140523c00580000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">10.90</b></span></td><td class="yfnc_h" align="right">8.90</td><td class="yfnc_h" align="right">11.65</td><td class="yfnc_h" align="right">21</td><td class="yfnc_h" align="right">8</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00580000">AAPL140530C00580000</a></td><td class="yfnc_h" align="right"><b>12.21</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00580000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.59</b></span></td><td class="yfnc_h" align="right">12.15</td><td class="yfnc_h" align="right">12.45</td><td class="yfnc_h" align="right">224</td><td class="yfnc_h" align="right">544</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140530C00580000">AAPL7140530C00580000</a></td><td class="yfnc_h" align="right"><b>9.96</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140530c00580000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">5.99</b></span></td><td class="yfnc_h" align="right">10.50</td><td class="yfnc_h" align="right">12.70</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">188</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=582.500000"><strong>582.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00582500">AAPL140517C00582500</a></td><td class="yfnc_h" align="right"><b>6.90</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00582500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.40</b></span></td><td class="yfnc_h" align="right">6.70</td><td class="yfnc_h" align="right">6.85</td><td class="yfnc_h" align="right">3,528</td><td class="yfnc_h" align="right">98</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=582.500000"><strong>582.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140523C00582500">AAPL7140523C00582500</a></td><td class="yfnc_h" align="right"><b>5.60</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140523c00582500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">5.60</b></span></td><td class="yfnc_h" align="right">N/A</td><td class="yfnc_h" align="right">N/A</td><td class="yfnc_h" align="right">0</td><td class="yfnc_h" align="right">82</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=582.500000"><strong>582.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140530C00582500">AAPL7140530C00582500</a></td><td class="yfnc_h" align="right"><b>41.32</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140530c00582500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">41.32</b></span></td><td class="yfnc_h" align="right">N/A</td><td class="yfnc_h" align="right">N/A</td><td class="yfnc_h" align="right">0</td><td class="yfnc_h" align="right">14</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517C00585000">AAPL140517C00585000</a></td><td class="yfnc_h" align="right"><b>5.25</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517c00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.84</b></span></td><td class="yfnc_h" align="right">5.25</td><td class="yfnc_h" align="right">5.45</td><td class="yfnc_h" align="right">11,785</td><td class="yfnc_h" align="right">4,386</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517C00585000">AAPL7140517C00585000</a></td><td class="yfnc_h" align="right"><b>5.30</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517c00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.82</b></span></td><td class="yfnc_h" align="right">4.70</td><td class="yfnc_h" align="right">5.65</td><td class="yfnc_h" align="right">39</td><td class="yfnc_h" align="right">208</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523C00585000">AAPL140523C00585000</a></td><td class="yfnc_h" align="right"><b>7.85</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523c00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.40</b></span></td><td class="yfnc_h" align="right">7.65</td><td class="yfnc_h" align="right">7.95</td><td class="yfnc_h" align="right">854</td><td class="yfnc_h" align="right">484</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140523C00585000">AAPL7140523C00585000</a></td><td class="yfnc_h" align="right"><b>6.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140523c00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">4.43</b></span></td><td class="yfnc_h" align="right">5.65</td><td class="yfnc_h" align="right">9.00</td><td class="yfnc_h" align="right">11</td><td class="yfnc_h" align="right">535</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530C00585000">AAPL140530C00585000</a></td><td class="yfnc_h" align="right"><b>9.60</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530c00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.30</b></span></td><td class="yfnc_h" align="right">9.40</td><td class="yfnc_h" align="right">9.70</td><td class="yfnc_h" align="right">348</td><td class="yfnc_h" align="right">234</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140530C00585000">AAPL7140530C00585000</a></td><td class="yfnc_h" align="right"><b>8.75</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140530c00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.25</b></span></td><td class="yfnc_h" align="right">7.50</td><td class="yfnc_h" align="right">9.85</td><td class="yfnc_h" align="right">4</td><td class="yfnc_h" align="right">26</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=587.500000"><strong>587.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00587500">AAPL140517C00587500</a></td><td class="yfnc_tabledata1" align="right"><b>4.25</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00587500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.53</b></span></td><td class="yfnc_tabledata1" align="right">4.05</td><td class="yfnc_tabledata1" align="right">4.20</td><td class="yfnc_tabledata1" align="right">2,245</td><td class="yfnc_tabledata1" align="right">305</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=587.500000"><strong>587.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517C00587500">AAPL7140517C00587500</a></td><td class="yfnc_tabledata1" align="right"><b>3.35</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517c00587500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">3.35</b></span></td><td class="yfnc_tabledata1" align="right">3.50</td><td class="yfnc_tabledata1" align="right">4.40</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">10</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=587.500000"><strong>587.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523C00587500">AAPL7140523C00587500</a></td><td class="yfnc_tabledata1" align="right"><b>0.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523c00587500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.05</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">159</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00590000">AAPL140517C00590000</a></td><td class="yfnc_tabledata1" align="right"><b>3.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00590000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.35</b></span></td><td class="yfnc_tabledata1" align="right">3.10</td><td class="yfnc_tabledata1" align="right">3.20</td><td class="yfnc_tabledata1" align="right">8,579</td><td class="yfnc_tabledata1" align="right">6,343</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517C00590000">AAPL7140517C00590000</a></td><td class="yfnc_tabledata1" align="right"><b>3.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517c00590000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.10</b></span></td><td class="yfnc_tabledata1" align="right">2.00</td><td class="yfnc_tabledata1" align="right">3.25</td><td class="yfnc_tabledata1" align="right">86</td><td class="yfnc_tabledata1" align="right">380</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00590000">AAPL140523C00590000</a></td><td class="yfnc_tabledata1" align="right"><b>5.50</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00590000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.24</b></span></td><td class="yfnc_tabledata1" align="right">5.40</td><td class="yfnc_tabledata1" align="right">5.55</td><td class="yfnc_tabledata1" align="right">786</td><td class="yfnc_tabledata1" align="right">809</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523C00590000">AAPL7140523C00590000</a></td><td class="yfnc_tabledata1" align="right"><b>4.50</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523c00590000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.05</b></span></td><td class="yfnc_tabledata1" align="right">3.90</td><td class="yfnc_tabledata1" align="right">5.90</td><td class="yfnc_tabledata1" align="right">14</td><td class="yfnc_tabledata1" align="right">76</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530C00590000">AAPL140530C00590000</a></td><td class="yfnc_tabledata1" align="right"><b>7.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530c00590000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.40</b></span></td><td class="yfnc_tabledata1" align="right">7.15</td><td class="yfnc_tabledata1" align="right">7.30</td><td class="yfnc_tabledata1" align="right">196</td><td class="yfnc_tabledata1" align="right">649</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530C00590000">AAPL7140530C00590000</a></td><td class="yfnc_tabledata1" align="right"><b>7.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530c00590000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.80</b></span></td><td class="yfnc_tabledata1" align="right">5.30</td><td class="yfnc_tabledata1" align="right">8.10</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">73</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=592.500000"><strong>592.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00592500">AAPL140517C00592500</a></td><td class="yfnc_tabledata1" align="right"><b>2.35</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00592500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.10</b></span></td><td class="yfnc_tabledata1" align="right">2.30</td><td class="yfnc_tabledata1" align="right">2.40</td><td class="yfnc_tabledata1" align="right">2,326</td><td class="yfnc_tabledata1" align="right">493</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=592.500000"><strong>592.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517C00592500">AAPL7140517C00592500</a></td><td class="yfnc_tabledata1" align="right"><b>2.14</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517c00592500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">2.14</b></span></td><td class="yfnc_tabledata1" align="right">1.70</td><td class="yfnc_tabledata1" align="right">2.57</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">26</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00595000">AAPL140517C00595000</a></td><td class="yfnc_tabledata1" align="right"><b>1.75</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00595000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.93</b></span></td><td class="yfnc_tabledata1" align="right">1.68</td><td class="yfnc_tabledata1" align="right">1.75</td><td class="yfnc_tabledata1" align="right">4,579</td><td class="yfnc_tabledata1" align="right">4,449</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517C00595000">AAPL7140517C00595000</a></td><td class="yfnc_tabledata1" align="right"><b>1.65</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517c00595000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.85</b></span></td><td class="yfnc_tabledata1" align="right">1.54</td><td class="yfnc_tabledata1" align="right">1.86</td><td class="yfnc_tabledata1" align="right">7</td><td class="yfnc_tabledata1" align="right">160</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00595000">AAPL140523C00595000</a></td><td class="yfnc_tabledata1" align="right"><b>3.75</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00595000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.95</b></span></td><td class="yfnc_tabledata1" align="right">3.70</td><td class="yfnc_tabledata1" align="right">3.75</td><td class="yfnc_tabledata1" align="right">652</td><td class="yfnc_tabledata1" align="right">747</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523C00595000">AAPL7140523C00595000</a></td><td class="yfnc_tabledata1" align="right"><b>3.50</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523c00595000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">4.60</b></span></td><td class="yfnc_tabledata1" align="right">3.55</td><td class="yfnc_tabledata1" align="right">3.90</td><td class="yfnc_tabledata1" align="right">6</td><td class="yfnc_tabledata1" align="right">104</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530C00595000">AAPL140530C00595000</a></td><td class="yfnc_tabledata1" align="right"><b>5.40</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530c00595000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.02</b></span></td><td class="yfnc_tabledata1" align="right">5.20</td><td class="yfnc_tabledata1" align="right">5.45</td><td class="yfnc_tabledata1" align="right">377</td><td class="yfnc_tabledata1" align="right">867</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530C00595000">AAPL7140530C00595000</a></td><td class="yfnc_tabledata1" align="right"><b>4.40</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530c00595000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">4.10</b></span></td><td class="yfnc_tabledata1" align="right">5.10</td><td class="yfnc_tabledata1" align="right">5.45</td><td class="yfnc_tabledata1" align="right">13</td><td class="yfnc_tabledata1" align="right">24</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=597.500000"><strong>597.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00597500">AAPL140517C00597500</a></td><td class="yfnc_tabledata1" align="right"><b>1.23</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00597500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.86</b></span></td><td class="yfnc_tabledata1" align="right">1.16</td><td class="yfnc_tabledata1" align="right">1.25</td><td class="yfnc_tabledata1" align="right">1,237</td><td class="yfnc_tabledata1" align="right">392</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=597.500000"><strong>597.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517C00597500">AAPL7140517C00597500</a></td><td class="yfnc_tabledata1" align="right"><b>0.94</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517c00597500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.41</b></span></td><td class="yfnc_tabledata1" align="right">0.59</td><td class="yfnc_tabledata1" align="right">1.39</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00600000">AAPL140517C00600000</a></td><td class="yfnc_tabledata1" align="right"><b>0.89</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00600000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.66</b></span></td><td class="yfnc_tabledata1" align="right">0.88</td><td class="yfnc_tabledata1" align="right">0.89</td><td class="yfnc_tabledata1" align="right">8,024</td><td class="yfnc_tabledata1" align="right">13,791</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517C00600000">AAPL7140517C00600000</a></td><td class="yfnc_tabledata1" align="right"><b>0.95</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517c00600000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.55</b></span></td><td class="yfnc_tabledata1" align="right">0.78</td><td class="yfnc_tabledata1" align="right">0.95</td><td class="yfnc_tabledata1" align="right">33</td><td class="yfnc_tabledata1" align="right">1,692</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00600000">AAPL140523C00600000</a></td><td class="yfnc_tabledata1" align="right"><b>2.45</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00600000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.83</b></span></td><td class="yfnc_tabledata1" align="right">2.35</td><td class="yfnc_tabledata1" align="right">2.54</td><td class="yfnc_tabledata1" align="right">1,997</td><td class="yfnc_tabledata1" align="right">1,364</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523C00600000">AAPL7140523C00600000</a></td><td class="yfnc_tabledata1" align="right"><b>2.43</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523c00600000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.60</b></span></td><td class="yfnc_tabledata1" align="right">2.32</td><td class="yfnc_tabledata1" align="right">2.61</td><td class="yfnc_tabledata1" align="right">21</td><td class="yfnc_tabledata1" align="right">225</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530C00600000">AAPL140530C00600000</a></td><td class="yfnc_tabledata1" align="right"><b>3.80</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530c00600000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.95</b></span></td><td class="yfnc_tabledata1" align="right">3.65</td><td class="yfnc_tabledata1" align="right">3.90</td><td class="yfnc_tabledata1" align="right">1,026</td><td class="yfnc_tabledata1" align="right">5,990</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530C00600000">AAPL7140530C00600000</a></td><td class="yfnc_tabledata1" align="right"><b>3.75</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530c00600000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.30</b></span></td><td class="yfnc_tabledata1" align="right">3.75</td><td class="yfnc_tabledata1" align="right">3.95</td><td class="yfnc_tabledata1" align="right">253</td><td class="yfnc_tabledata1" align="right">882</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=602.500000"><strong>602.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00602500">AAPL140517C00602500</a></td><td class="yfnc_tabledata1" align="right"><b>0.61</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00602500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.54</b></span></td><td class="yfnc_tabledata1" align="right">0.61</td><td class="yfnc_tabledata1" align="right">0.66</td><td class="yfnc_tabledata1" align="right">972</td><td class="yfnc_tabledata1" align="right">286</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=602.500000"><strong>602.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517C00602500">AAPL7140517C00602500</a></td><td class="yfnc_tabledata1" align="right"><b>2.09</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517c00602500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.31</td><td class="yfnc_tabledata1" align="right">0.79</td><td class="yfnc_tabledata1" align="right">11</td><td class="yfnc_tabledata1" align="right">11</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=605.000000"><strong>605.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00605000">AAPL140517C00605000</a></td><td class="yfnc_tabledata1" align="right"><b>0.44</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00605000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.41</b></span></td><td class="yfnc_tabledata1" align="right">0.43</td><td class="yfnc_tabledata1" align="right">0.44</td><td class="yfnc_tabledata1" align="right">2,476</td><td class="yfnc_tabledata1" align="right">6,776</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=605.000000"><strong>605.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517C00605000">AAPL7140517C00605000</a></td><td class="yfnc_tabledata1" align="right"><b>0.47</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517c00605000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.33</b></span></td><td class="yfnc_tabledata1" align="right">0.39</td><td class="yfnc_tabledata1" align="right">0.51</td><td class="yfnc_tabledata1" align="right">31</td><td class="yfnc_tabledata1" align="right">351</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=605.000000"><strong>605.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00605000">AAPL140523C00605000</a></td><td class="yfnc_tabledata1" align="right"><b>1.53</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00605000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.68</b></span></td><td class="yfnc_tabledata1" align="right">1.50</td><td class="yfnc_tabledata1" align="right">1.64</td><td class="yfnc_tabledata1" align="right">626</td><td class="yfnc_tabledata1" align="right">582</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=605.000000"><strong>605.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530C00605000">AAPL140530C00605000</a></td><td class="yfnc_tabledata1" align="right"><b>2.69</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530c00605000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.71</b></span></td><td class="yfnc_tabledata1" align="right">2.58</td><td class="yfnc_tabledata1" align="right">2.69</td><td class="yfnc_tabledata1" align="right">155</td><td class="yfnc_tabledata1" align="right">872</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=607.500000"><strong>607.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00607500">AAPL140517C00607500</a></td><td class="yfnc_tabledata1" align="right"><b>0.33</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00607500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.30</b></span></td><td class="yfnc_tabledata1" align="right">0.31</td><td class="yfnc_tabledata1" align="right">0.34</td><td class="yfnc_tabledata1" align="right">432</td><td class="yfnc_tabledata1" align="right">261</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=610.000000"><strong>610.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00610000">AAPL140517C00610000</a></td><td class="yfnc_tabledata1" align="right"><b>0.28</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00610000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.18</b></span></td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">0.28</td><td class="yfnc_tabledata1" align="right">1,796</td><td class="yfnc_tabledata1" align="right">4,968</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=610.000000"><strong>610.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517C00610000">AAPL7140517C00610000</a></td><td class="yfnc_tabledata1" align="right"><b>0.23</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517c00610000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.79</b></span></td><td class="yfnc_tabledata1" align="right">0.21</td><td class="yfnc_tabledata1" align="right">0.32</td><td class="yfnc_tabledata1" align="right">46</td><td class="yfnc_tabledata1" align="right">272</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=610.000000"><strong>610.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00610000">AAPL140523C00610000</a></td><td class="yfnc_tabledata1" align="right"><b>0.97</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00610000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.46</b></span></td><td class="yfnc_tabledata1" align="right">0.97</td><td class="yfnc_tabledata1" align="right">1.06</td><td class="yfnc_tabledata1" align="right">335</td><td class="yfnc_tabledata1" align="right">897</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=610.000000"><strong>610.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530C00610000">AAPL140530C00610000</a></td><td class="yfnc_tabledata1" align="right"><b>1.85</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530c00610000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.55</b></span></td><td class="yfnc_tabledata1" align="right">1.80</td><td class="yfnc_tabledata1" align="right">1.85</td><td class="yfnc_tabledata1" align="right">208</td><td class="yfnc_tabledata1" align="right">728</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=612.500000"><strong>612.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00612500">AAPL140517C00612500</a></td><td class="yfnc_tabledata1" align="right"><b>0.19</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00612500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.19</b></span></td><td class="yfnc_tabledata1" align="right">0.19</td><td class="yfnc_tabledata1" align="right">0.24</td><td class="yfnc_tabledata1" align="right">128</td><td class="yfnc_tabledata1" align="right">60</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=615.000000"><strong>615.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00615000">AAPL140517C00615000</a></td><td class="yfnc_tabledata1" align="right"><b>0.19</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00615000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.08</b></span></td><td class="yfnc_tabledata1" align="right">0.18</td><td class="yfnc_tabledata1" align="right">0.19</td><td class="yfnc_tabledata1" align="right">1,125</td><td class="yfnc_tabledata1" align="right">3,790</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=615.000000"><strong>615.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517C00615000">AAPL7140517C00615000</a></td><td class="yfnc_tabledata1" align="right"><b>0.73</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517c00615000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.13</td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">34</td><td class="yfnc_tabledata1" align="right">328</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=615.000000"><strong>615.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00615000">AAPL140523C00615000</a></td><td class="yfnc_tabledata1" align="right"><b>0.69</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00615000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.26</b></span></td><td class="yfnc_tabledata1" align="right">0.63</td><td class="yfnc_tabledata1" align="right">0.70</td><td class="yfnc_tabledata1" align="right">123</td><td class="yfnc_tabledata1" align="right">576</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=615.000000"><strong>615.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530C00615000">AAPL140530C00615000</a></td><td class="yfnc_tabledata1" align="right"><b>1.28</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530c00615000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.43</b></span></td><td class="yfnc_tabledata1" align="right">1.23</td><td class="yfnc_tabledata1" align="right">1.34</td><td class="yfnc_tabledata1" align="right">127</td><td class="yfnc_tabledata1" align="right">264</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=617.500000"><strong>617.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00617500">AAPL140517C00617500</a></td><td class="yfnc_tabledata1" align="right"><b>0.14</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00617500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.07</b></span></td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">0.16</td><td class="yfnc_tabledata1" align="right">44</td><td class="yfnc_tabledata1" align="right">148</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=620.000000"><strong>620.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00620000">AAPL140517C00620000</a></td><td class="yfnc_tabledata1" align="right"><b>0.14</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00620000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.06</b></span></td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">0.14</td><td class="yfnc_tabledata1" align="right">696</td><td class="yfnc_tabledata1" align="right">3,306</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=620.000000"><strong>620.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517C00620000">AAPL7140517C00620000</a></td><td class="yfnc_tabledata1" align="right"><b>0.45</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517c00620000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.08</td><td class="yfnc_tabledata1" align="right">0.20</td><td class="yfnc_tabledata1" align="right">29</td><td class="yfnc_tabledata1" align="right">70</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=620.000000"><strong>620.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00620000">AAPL140523C00620000</a></td><td class="yfnc_tabledata1" align="right"><b>0.45</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00620000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.22</b></span></td><td class="yfnc_tabledata1" align="right">0.42</td><td class="yfnc_tabledata1" align="right">0.47</td><td class="yfnc_tabledata1" align="right">133</td><td class="yfnc_tabledata1" align="right">476</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=620.000000"><strong>620.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530C00620000">AAPL140530C00620000</a></td><td class="yfnc_tabledata1" align="right"><b>0.90</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530c00620000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.29</b></span></td><td class="yfnc_tabledata1" align="right">0.85</td><td class="yfnc_tabledata1" align="right">0.95</td><td class="yfnc_tabledata1" align="right">213</td><td class="yfnc_tabledata1" align="right">910</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=622.500000"><strong>622.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00622500">AAPL140517C00622500</a></td><td class="yfnc_tabledata1" align="right"><b>0.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00622500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.07</b></span></td><td class="yfnc_tabledata1" align="right">0.08</td><td class="yfnc_tabledata1" align="right">0.13</td><td class="yfnc_tabledata1" align="right">83</td><td class="yfnc_tabledata1" align="right">174</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=625.000000"><strong>625.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00625000">AAPL140517C00625000</a></td><td class="yfnc_tabledata1" align="right"><b>0.09</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00625000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.06</b></span></td><td class="yfnc_tabledata1" align="right">0.08</td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">465</td><td class="yfnc_tabledata1" align="right">3,311</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=625.000000"><strong>625.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517C00625000">AAPL7140517C00625000</a></td><td class="yfnc_tabledata1" align="right"><b>0.80</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517c00625000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">0.16</td><td class="yfnc_tabledata1" align="right">21</td><td class="yfnc_tabledata1" align="right">112</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=625.000000"><strong>625.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00625000">AAPL140523C00625000</a></td><td class="yfnc_tabledata1" align="right"><b>0.30</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00625000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.17</b></span></td><td class="yfnc_tabledata1" align="right">0.30</td><td class="yfnc_tabledata1" align="right">0.35</td><td class="yfnc_tabledata1" align="right">139</td><td class="yfnc_tabledata1" align="right">284</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=625.000000"><strong>625.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530C00625000">AAPL140530C00625000</a></td><td class="yfnc_tabledata1" align="right"><b>0.57</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530c00625000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.43</b></span></td><td class="yfnc_tabledata1" align="right">0.59</td><td class="yfnc_tabledata1" align="right">0.69</td><td class="yfnc_tabledata1" align="right">15</td><td class="yfnc_tabledata1" align="right">443</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=627.500000"><strong>627.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00627500">AAPL140517C00627500</a></td><td class="yfnc_tabledata1" align="right"><b>0.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00627500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.03</b></span></td><td class="yfnc_tabledata1" align="right">0.06</td><td class="yfnc_tabledata1" align="right">0.11</td><td class="yfnc_tabledata1" align="right">47</td><td class="yfnc_tabledata1" align="right">9</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=630.000000"><strong>630.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00630000">AAPL140517C00630000</a></td><td class="yfnc_tabledata1" align="right"><b>0.07</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00630000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.05</b></span></td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">0.10</td><td class="yfnc_tabledata1" align="right">581</td><td class="yfnc_tabledata1" align="right">3,159</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=630.000000"><strong>630.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517C00630000">AAPL7140517C00630000</a></td><td class="yfnc_tabledata1" align="right"><b>1.40</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517c00630000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">0.14</td><td class="yfnc_tabledata1" align="right">31</td><td class="yfnc_tabledata1" align="right">77</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=630.000000"><strong>630.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00630000">AAPL140523C00630000</a></td><td class="yfnc_tabledata1" align="right"><b>0.23</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00630000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.17</b></span></td><td class="yfnc_tabledata1" align="right">0.23</td><td class="yfnc_tabledata1" align="right">0.28</td><td class="yfnc_tabledata1" align="right">74</td><td class="yfnc_tabledata1" align="right">281</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=630.000000"><strong>630.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530C00630000">AAPL140530C00630000</a></td><td class="yfnc_tabledata1" align="right"><b>0.40</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530c00630000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.25</b></span></td><td class="yfnc_tabledata1" align="right">0.42</td><td class="yfnc_tabledata1" align="right">0.51</td><td class="yfnc_tabledata1" align="right">36</td><td class="yfnc_tabledata1" align="right">206</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=635.000000"><strong>635.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00635000">AAPL140517C00635000</a></td><td class="yfnc_tabledata1" align="right"><b>0.07</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00635000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.04</b></span></td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">0.06</td><td class="yfnc_tabledata1" align="right">69</td><td class="yfnc_tabledata1" align="right">1,251</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=635.000000"><strong>635.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517C00635000">AAPL7140517C00635000</a></td><td class="yfnc_tabledata1" align="right"><b>0.37</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517c00635000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">84</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=635.000000"><strong>635.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00635000">AAPL140523C00635000</a></td><td class="yfnc_tabledata1" align="right"><b>0.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00635000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.10</b></span></td><td class="yfnc_tabledata1" align="right">0.17</td><td class="yfnc_tabledata1" align="right">0.23</td><td class="yfnc_tabledata1" align="right">210</td><td class="yfnc_tabledata1" align="right">201</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=635.000000"><strong>635.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530C00635000">AAPL140530C00635000</a></td><td class="yfnc_tabledata1" align="right"><b>0.34</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530c00635000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.12</b></span></td><td class="yfnc_tabledata1" align="right">0.32</td><td class="yfnc_tabledata1" align="right">0.39</td><td class="yfnc_tabledata1" align="right">17</td><td class="yfnc_tabledata1" align="right">377</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=640.000000"><strong>640.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00640000">AAPL140517C00640000</a></td><td class="yfnc_tabledata1" align="right"><b>0.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00640000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.04</b></span></td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">454</td><td class="yfnc_tabledata1" align="right">2,284</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=640.000000"><strong>640.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517C00640000">AAPL7140517C00640000</a></td><td class="yfnc_tabledata1" align="right"><b>0.15</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517c00640000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">14</td><td class="yfnc_tabledata1" align="right">55</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=640.000000"><strong>640.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00640000">AAPL140523C00640000</a></td><td class="yfnc_tabledata1" align="right"><b>0.17</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00640000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.05</b></span></td><td class="yfnc_tabledata1" align="right">0.14</td><td class="yfnc_tabledata1" align="right">0.19</td><td class="yfnc_tabledata1" align="right">62</td><td class="yfnc_tabledata1" align="right">197</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=640.000000"><strong>640.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530C00640000">AAPL140530C00640000</a></td><td class="yfnc_tabledata1" align="right"><b>0.29</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530c00640000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.18</b></span></td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">0.31</td><td class="yfnc_tabledata1" align="right">19</td><td class="yfnc_tabledata1" align="right">214</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=645.000000"><strong>645.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00645000">AAPL140517C00645000</a></td><td class="yfnc_tabledata1" align="right"><b>0.04</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00645000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.06</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">155</td><td class="yfnc_tabledata1" align="right">633</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=645.000000"><strong>645.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517C00645000">AAPL7140517C00645000</a></td><td class="yfnc_tabledata1" align="right"><b>0.90</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517c00645000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.18</td><td class="yfnc_tabledata1" align="right">44</td><td class="yfnc_tabledata1" align="right">90</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=645.000000"><strong>645.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00645000">AAPL140523C00645000</a></td><td class="yfnc_tabledata1" align="right"><b>0.11</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00645000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.07</b></span></td><td class="yfnc_tabledata1" align="right">0.10</td><td class="yfnc_tabledata1" align="right">0.16</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">193</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=645.000000"><strong>645.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530C00645000">AAPL140530C00645000</a></td><td class="yfnc_tabledata1" align="right"><b>0.25</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530c00645000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.20</b></span></td><td class="yfnc_tabledata1" align="right">0.20</td><td class="yfnc_tabledata1" align="right">0.30</td><td class="yfnc_tabledata1" align="right">25</td><td class="yfnc_tabledata1" align="right">178</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=650.000000"><strong>650.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00650000">AAPL140517C00650000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00650000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.06</b></span></td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">631</td><td class="yfnc_tabledata1" align="right">5,904</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=650.000000"><strong>650.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517C00650000">AAPL7140517C00650000</a></td><td class="yfnc_tabledata1" align="right"><b>0.46</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517c00650000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.28</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">72</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=650.000000"><strong>650.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00650000">AAPL140523C00650000</a></td><td class="yfnc_tabledata1" align="right"><b>0.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00650000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.05</b></span></td><td class="yfnc_tabledata1" align="right">0.08</td><td class="yfnc_tabledata1" align="right">0.15</td><td class="yfnc_tabledata1" align="right">44</td><td class="yfnc_tabledata1" align="right">243</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=650.000000"><strong>650.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530C00650000">AAPL140530C00650000</a></td><td class="yfnc_tabledata1" align="right"><b>0.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530c00650000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">0.20</td><td class="yfnc_tabledata1" align="right">9</td><td class="yfnc_tabledata1" align="right">225</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=655.000000"><strong>655.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00655000">AAPL140517C00655000</a></td><td class="yfnc_tabledata1" align="right"><b>0.03</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00655000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">27</td><td class="yfnc_tabledata1" align="right">491</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=655.000000"><strong>655.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517C00655000">AAPL7140517C00655000</a></td><td class="yfnc_tabledata1" align="right"><b>0.70</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517c00655000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.22</td><td class="yfnc_tabledata1" align="right">9</td><td class="yfnc_tabledata1" align="right">65</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=655.000000"><strong>655.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00655000">AAPL140523C00655000</a></td><td class="yfnc_tabledata1" align="right"><b>0.08</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00655000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.06</b></span></td><td class="yfnc_tabledata1" align="right">0.06</td><td class="yfnc_tabledata1" align="right">0.14</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">71</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=660.000000"><strong>660.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00660000">AAPL140517C00660000</a></td><td class="yfnc_tabledata1" align="right"><b>0.03</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00660000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.04</b></span></td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">21</td><td class="yfnc_tabledata1" align="right">582</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=660.000000"><strong>660.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00660000">AAPL140523C00660000</a></td><td class="yfnc_tabledata1" align="right"><b>0.09</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00660000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">62</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=665.000000"><strong>665.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00665000">AAPL140517C00665000</a></td><td class="yfnc_tabledata1" align="right"><b>0.06</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00665000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.06</td><td class="yfnc_tabledata1" align="right">8</td><td class="yfnc_tabledata1" align="right">316</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=665.000000"><strong>665.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00665000">AAPL140523C00665000</a></td><td class="yfnc_tabledata1" align="right"><b>0.07</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00665000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.10</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">55</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=670.000000"><strong>670.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00670000">AAPL140517C00670000</a></td><td class="yfnc_tabledata1" align="right"><b>0.03</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00670000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.07</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">841</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=670.000000"><strong>670.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00670000">AAPL140523C00670000</a></td><td class="yfnc_tabledata1" align="right"><b>0.08</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00670000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">9</td><td class="yfnc_tabledata1" align="right">123</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=675.000000"><strong>675.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00675000">AAPL140517C00675000</a></td><td class="yfnc_tabledata1" align="right"><b>0.04</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00675000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">113</td><td class="yfnc_tabledata1" align="right">483</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=675.000000"><strong>675.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00675000">AAPL140523C00675000</a></td><td class="yfnc_tabledata1" align="right"><b>0.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00675000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">0.08</td><td class="yfnc_tabledata1" align="right">13</td><td class="yfnc_tabledata1" align="right">44</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=680.000000"><strong>680.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00680000">AAPL140517C00680000</a></td><td class="yfnc_tabledata1" align="right"><b>0.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00680000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">95</td><td class="yfnc_tabledata1" align="right">2,580</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=680.000000"><strong>680.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00680000">AAPL140523C00680000</a></td><td class="yfnc_tabledata1" align="right"><b>0.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00680000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.13</td><td class="yfnc_tabledata1" align="right">50</td><td class="yfnc_tabledata1" align="right">50</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=685.000000"><strong>685.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00685000">AAPL140517C00685000</a></td><td class="yfnc_tabledata1" align="right"><b>0.04</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00685000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.11</td><td class="yfnc_tabledata1" align="right">38</td><td class="yfnc_tabledata1" align="right">236</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=685.000000"><strong>685.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00685000">AAPL140523C00685000</a></td><td class="yfnc_tabledata1" align="right"><b>0.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00685000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.07</td><td class="yfnc_tabledata1" align="right">18</td><td class="yfnc_tabledata1" align="right">17</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=690.000000"><strong>690.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00690000">AAPL140517C00690000</a></td><td class="yfnc_tabledata1" align="right"><b>0.04</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00690000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">109</td><td class="yfnc_tabledata1" align="right">430</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=695.000000"><strong>695.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00695000">AAPL140517C00695000</a></td><td class="yfnc_tabledata1" align="right"><b>0.03</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00695000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">53</td><td class="yfnc_tabledata1" align="right">188</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=695.000000"><strong>695.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00695000">AAPL140523C00695000</a></td><td class="yfnc_tabledata1" align="right"><b>0.11</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00695000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.08</td><td class="yfnc_tabledata1" align="right">32</td><td class="yfnc_tabledata1" align="right">66</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=700.000000"><strong>700.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00700000">AAPL140517C00700000</a></td><td class="yfnc_tabledata1" align="right"><b>0.01</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00700000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">63</td><td class="yfnc_tabledata1" align="right">1,329</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=700.000000"><strong>700.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00700000">AAPL140523C00700000</a></td><td class="yfnc_tabledata1" align="right"><b>0.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00700000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.08</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">10</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=705.000000"><strong>705.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00705000">AAPL140517C00705000</a></td><td class="yfnc_tabledata1" align="right"><b>0.01</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00705000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">57</td><td class="yfnc_tabledata1" align="right">457</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=710.000000"><strong>710.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00710000">AAPL140517C00710000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00710000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">494</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=710.000000"><strong>710.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523C00710000">AAPL140523C00710000</a></td><td class="yfnc_tabledata1" align="right"><b>0.03</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523c00710000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">282</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=715.000000"><strong>715.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00715000">AAPL140517C00715000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00715000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">36</td><td class="yfnc_tabledata1" align="right">293</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=720.000000"><strong>720.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00720000">AAPL140517C00720000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00720000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">14</td><td class="yfnc_tabledata1" align="right">331</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=725.000000"><strong>725.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00725000">AAPL140517C00725000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00725000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">12</td><td class="yfnc_tabledata1" align="right">599</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=730.000000"><strong>730.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00730000">AAPL140517C00730000</a></td><td class="yfnc_tabledata1" align="right"><b>0.01</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00730000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">6</td><td class="yfnc_tabledata1" align="right">146</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=735.000000"><strong>735.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00735000">AAPL140517C00735000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00735000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">22</td><td class="yfnc_tabledata1" align="right">116</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=740.000000"><strong>740.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00740000">AAPL140517C00740000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00740000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">21</td><td class="yfnc_tabledata1" align="right">51</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=745.000000"><strong>745.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00745000">AAPL140517C00745000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00745000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">13</td><td class="yfnc_tabledata1" align="right">13</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=750.000000"><strong>750.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00750000">AAPL140517C00750000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00750000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">213</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=755.000000"><strong>755.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00755000">AAPL140517C00755000</a></td><td class="yfnc_tabledata1" align="right"><b>0.09</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00755000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">58</td><td class="yfnc_tabledata1" align="right">79</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=760.000000"><strong>760.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00760000">AAPL140517C00760000</a></td><td class="yfnc_tabledata1" align="right"><b>0.24</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00760000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">0</td><td class="yfnc_tabledata1" align="right">39</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=770.000000"><strong>770.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00770000">AAPL140517C00770000</a></td><td class="yfnc_tabledata1" align="right"><b>0.24</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00770000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">0</td><td class="yfnc_tabledata1" align="right">99</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=775.000000"><strong>775.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00775000">AAPL140517C00775000</a></td><td class="yfnc_tabledata1" align="right"><b>0.40</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00775000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">0</td><td class="yfnc_tabledata1" align="right">5</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=795.000000"><strong>795.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00795000">AAPL140517C00795000</a></td><td class="yfnc_tabledata1" align="right"><b>0.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00795000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">0</td><td class="yfnc_tabledata1" align="right">55</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=800.000000"><strong>800.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00800000">AAPL140517C00800000</a></td><td class="yfnc_tabledata1" align="right"><b>0.04</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00800000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">47</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=805.000000"><strong>805.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517C00805000">AAPL140517C00805000</a></td><td class="yfnc_tabledata1" align="right"><b>0.15</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517c00805000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">0</td><td class="yfnc_tabledata1" align="right">10</td></tr></table></td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td height="10"></td></tr></table><table class="yfnc_mod_table_title1" width="100%" cellpadding="2" cellspacing="0" border="0"><tr valign="top"><td><small><b><strong class="yfi-module-title">Put Options</strong></b></small></td><td align="right">Expire at close Friday, May 30, 2014</td></tr></table><table class="yfnc_datamodoutline1" width="100%" cellpadding="0" cellspacing="0" border="0"><tr valign="top"><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><th scope="col" class="yfnc_tablehead1" width="12%" align="left">Strike</th><th scope="col" class="yfnc_tablehead1" width="12%">Symbol</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Last</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Chg</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Bid</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Ask</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Vol</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Open Int</th></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=280.000000"><strong>280.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00280000">AAPL140517P00280000</a></td><td class="yfnc_tabledata1" align="right"><b>0.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00280000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">6</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=290.000000"><strong>290.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00290000">AAPL140517P00290000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00290000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.11</td><td class="yfnc_tabledata1" align="right">11</td><td class="yfnc_tabledata1" align="right">11</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=295.000000"><strong>295.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00295000">AAPL140517P00295000</a></td><td class="yfnc_tabledata1" align="right"><b>0.01</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00295000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.08</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">8</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=300.000000"><strong>300.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00300000">AAPL140517P00300000</a></td><td class="yfnc_tabledata1" align="right"><b>0.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00300000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">23</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=305.000000"><strong>305.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00305000">AAPL140517P00305000</a></td><td class="yfnc_tabledata1" align="right"><b>0.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00305000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.10</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">20</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=310.000000"><strong>310.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00310000">AAPL140517P00310000</a></td><td class="yfnc_tabledata1" align="right"><b>0.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00310000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.11</td><td class="yfnc_tabledata1" align="right">0</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=315.000000"><strong>315.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00315000">AAPL140517P00315000</a></td><td class="yfnc_tabledata1" align="right"><b>0.12</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00315000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.11</td><td class="yfnc_tabledata1" align="right">0</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=320.000000"><strong>320.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00320000">AAPL140517P00320000</a></td><td class="yfnc_tabledata1" align="right"><b>0.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00320000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.08</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">7</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=325.000000"><strong>325.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00325000">AAPL140517P00325000</a></td><td class="yfnc_tabledata1" align="right"><b>0.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00325000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">185</td><td class="yfnc_tabledata1" align="right">342</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=330.000000"><strong>330.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00330000">AAPL140517P00330000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00330000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">5</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=335.000000"><strong>335.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00335000">AAPL140517P00335000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00335000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">6</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=340.000000"><strong>340.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00340000">AAPL140517P00340000</a></td><td class="yfnc_tabledata1" align="right"><b>0.04</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00340000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">6</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=345.000000"><strong>345.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00345000">AAPL140517P00345000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00345000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">5</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=350.000000"><strong>350.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00350000">AAPL140517P00350000</a></td><td class="yfnc_tabledata1" align="right"><b>0.01</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00350000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">60</td><td class="yfnc_tabledata1" align="right">636</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=355.000000"><strong>355.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00355000">AAPL140517P00355000</a></td><td class="yfnc_tabledata1" align="right"><b>0.01</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00355000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">63</td><td class="yfnc_tabledata1" align="right">92</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=360.000000"><strong>360.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00360000">AAPL140517P00360000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00360000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.10</td><td class="yfnc_tabledata1" align="right">8</td><td class="yfnc_tabledata1" align="right">167</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=365.000000"><strong>365.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00365000">AAPL140517P00365000</a></td><td class="yfnc_tabledata1" align="right"><b>0.01</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00365000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.10</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">28</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=370.000000"><strong>370.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00370000">AAPL140517P00370000</a></td><td class="yfnc_tabledata1" align="right"><b>0.04</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00370000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">27</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=375.000000"><strong>375.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00375000">AAPL140517P00375000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00375000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">15</td><td class="yfnc_tabledata1" align="right">36</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=380.000000"><strong>380.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00380000">AAPL140517P00380000</a></td><td class="yfnc_tabledata1" align="right"><b>0.04</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00380000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">6</td><td class="yfnc_tabledata1" align="right">303</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=385.000000"><strong>385.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00385000">AAPL140517P00385000</a></td><td class="yfnc_tabledata1" align="right"><b>0.09</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00385000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">331</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=390.000000"><strong>390.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00390000">AAPL140517P00390000</a></td><td class="yfnc_tabledata1" align="right"><b>0.01</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00390000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">33</td><td class="yfnc_tabledata1" align="right">239</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=395.000000"><strong>395.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00395000">AAPL140517P00395000</a></td><td class="yfnc_tabledata1" align="right"><b>0.07</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00395000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">270</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=400.000000"><strong>400.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00400000">AAPL140517P00400000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00400000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">431</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=405.000000"><strong>405.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00405000">AAPL140517P00405000</a></td><td class="yfnc_tabledata1" align="right"><b>0.04</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00405000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">8</td><td class="yfnc_tabledata1" align="right">284</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=410.000000"><strong>410.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00410000">AAPL140517P00410000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00410000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">400</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=415.000000"><strong>415.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00415000">AAPL140517P00415000</a></td><td class="yfnc_tabledata1" align="right"><b>0.03</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00415000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">22</td><td class="yfnc_tabledata1" align="right">401</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=420.000000"><strong>420.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00420000">AAPL140517P00420000</a></td><td class="yfnc_tabledata1" align="right"><b>0.04</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00420000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">489</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=425.000000"><strong>425.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00425000">AAPL140517P00425000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00425000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">863</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=430.000000"><strong>430.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00430000">AAPL140517P00430000</a></td><td class="yfnc_tabledata1" align="right"><b>0.01</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00430000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">367</td><td class="yfnc_tabledata1" align="right">3,892</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=435.000000"><strong>435.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00435000">AAPL140517P00435000</a></td><td class="yfnc_tabledata1" align="right"><b>0.01</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00435000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">956</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=435.000000"><strong>435.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00435000">AAPL7140517P00435000</a></td><td class="yfnc_tabledata1" align="right"><b>0.90</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00435000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">1.71</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=440.000000"><strong>440.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00440000">AAPL140517P00440000</a></td><td class="yfnc_tabledata1" align="right"><b>0.01</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00440000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.10</td><td class="yfnc_tabledata1" align="right">8</td><td class="yfnc_tabledata1" align="right">803</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=440.000000"><strong>440.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00440000">AAPL7140517P00440000</a></td><td class="yfnc_tabledata1" align="right"><b>0.69</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00440000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">1.71</td><td class="yfnc_tabledata1" align="right">13</td><td class="yfnc_tabledata1" align="right">13</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=445.000000"><strong>445.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00445000">AAPL140517P00445000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00445000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">1,616</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=450.000000"><strong>450.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00450000">AAPL140517P00450000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00450000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">3,981</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=450.000000"><strong>450.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00450000">AAPL7140517P00450000</a></td><td class="yfnc_tabledata1" align="right"><b>0.64</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00450000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">1.71</td><td class="yfnc_tabledata1" align="right">11</td><td class="yfnc_tabledata1" align="right">16</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=455.000000"><strong>455.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00455000">AAPL140517P00455000</a></td><td class="yfnc_tabledata1" align="right"><b>0.04</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00455000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">8</td><td class="yfnc_tabledata1" align="right">487</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=455.000000"><strong>455.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00455000">AAPL7140517P00455000</a></td><td class="yfnc_tabledata1" align="right"><b>1.47</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00455000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">1.71</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">56</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=460.000000"><strong>460.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00460000">AAPL140517P00460000</a></td><td class="yfnc_tabledata1" align="right"><b>0.01</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00460000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">60</td><td class="yfnc_tabledata1" align="right">2,133</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=460.000000"><strong>460.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00460000">AAPL7140517P00460000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00460000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.54</td><td class="yfnc_tabledata1" align="right">21</td><td class="yfnc_tabledata1" align="right">38</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=465.000000"><strong>465.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00465000">AAPL140517P00465000</a></td><td class="yfnc_tabledata1" align="right"><b>0.01</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00465000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1,617</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=465.000000"><strong>465.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00465000">AAPL7140517P00465000</a></td><td class="yfnc_tabledata1" align="right"><b>0.52</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00465000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.50</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">72</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=470.000000"><strong>470.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00470000">AAPL140517P00470000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00470000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">8,005</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=470.000000"><strong>470.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00470000">AAPL7140517P00470000</a></td><td class="yfnc_tabledata1" align="right"><b>0.73</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00470000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.43</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">61</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=470.000000"><strong>470.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00470000">AAPL140523P00470000</a></td><td class="yfnc_tabledata1" align="right"><b>0.16</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00470000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.15</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">5</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=475.000000"><strong>475.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00475000">AAPL140517P00475000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00475000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">3,076</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=475.000000"><strong>475.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00475000">AAPL7140517P00475000</a></td><td class="yfnc_tabledata1" align="right"><b>0.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00475000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.34</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">142</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=480.000000"><strong>480.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00480000">AAPL140517P00480000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00480000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">79</td><td class="yfnc_tabledata1" align="right">3,648</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=480.000000"><strong>480.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00480000">AAPL7140517P00480000</a></td><td class="yfnc_tabledata1" align="right"><b>0.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00480000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">0.28</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">147</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=485.000000"><strong>485.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00485000">AAPL140517P00485000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00485000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.03</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">180</td><td class="yfnc_tabledata1" align="right">2,581</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=485.000000"><strong>485.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00485000">AAPL7140517P00485000</a></td><td class="yfnc_tabledata1" align="right"><b>0.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00485000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.23</td><td class="yfnc_tabledata1" align="right">14</td><td class="yfnc_tabledata1" align="right">178</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=485.000000"><strong>485.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00485000">AAPL140523P00485000</a></td><td class="yfnc_tabledata1" align="right"><b>0.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00485000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.07</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">3</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=490.000000"><strong>490.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00490000">AAPL140517P00490000</a></td><td class="yfnc_tabledata1" align="right"><b>0.03</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00490000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">34</td><td class="yfnc_tabledata1" align="right">4,959</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=490.000000"><strong>490.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00490000">AAPL7140517P00490000</a></td><td class="yfnc_tabledata1" align="right"><b>0.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00490000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.23</td><td class="yfnc_tabledata1" align="right">26</td><td class="yfnc_tabledata1" align="right">511</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=490.000000"><strong>490.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00490000">AAPL140523P00490000</a></td><td class="yfnc_tabledata1" align="right"><b>0.12</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00490000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">75</td><td class="yfnc_tabledata1" align="right">94</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=490.000000"><strong>490.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00490000">AAPL140530P00490000</a></td><td class="yfnc_tabledata1" align="right"><b>0.11</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00490000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">0.21</td><td class="yfnc_tabledata1" align="right">20</td><td class="yfnc_tabledata1" align="right">140</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=490.000000"><strong>490.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00490000">AAPL7140530P00490000</a></td><td class="yfnc_tabledata1" align="right"><b>0.25</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00490000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">63</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=492.500000"><strong>492.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00492500">AAPL140530P00492500</a></td><td class="yfnc_tabledata1" align="right"><b>0.35</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00492500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.22</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">45</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=492.500000"><strong>492.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00492500">AAPL7140530P00492500</a></td><td class="yfnc_tabledata1" align="right"><b>3.95</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00492500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.42</td><td class="yfnc_tabledata1" align="right">172</td><td class="yfnc_tabledata1" align="right">175</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=495.000000"><strong>495.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00495000">AAPL140517P00495000</a></td><td class="yfnc_tabledata1" align="right"><b>0.03</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00495000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">23</td><td class="yfnc_tabledata1" align="right">4,303</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=495.000000"><strong>495.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00495000">AAPL7140517P00495000</a></td><td class="yfnc_tabledata1" align="right"><b>0.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00495000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.08</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">267</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=495.000000"><strong>495.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00495000">AAPL140523P00495000</a></td><td class="yfnc_tabledata1" align="right"><b>0.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00495000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.07</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">220</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=495.000000"><strong>495.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00495000">AAPL7140523P00495000</a></td><td class="yfnc_tabledata1" align="right"><b>4.60</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00495000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.13</td><td class="yfnc_tabledata1" align="right">427</td><td class="yfnc_tabledata1" align="right">433</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=495.000000"><strong>495.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00495000">AAPL140530P00495000</a></td><td class="yfnc_tabledata1" align="right"><b>0.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00495000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.22</td><td class="yfnc_tabledata1" align="right">7</td><td class="yfnc_tabledata1" align="right">119</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=495.000000"><strong>495.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00495000">AAPL7140530P00495000</a></td><td class="yfnc_tabledata1" align="right"><b>4.55</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00495000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.43</td><td class="yfnc_tabledata1" align="right">154</td><td class="yfnc_tabledata1" align="right">154</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=497.500000"><strong>497.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00497500">AAPL140530P00497500</a></td><td class="yfnc_tabledata1" align="right"><b>0.43</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00497500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.22</td><td class="yfnc_tabledata1" align="right">8</td><td class="yfnc_tabledata1" align="right">8</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=497.500000"><strong>497.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00497500">AAPL7140530P00497500</a></td><td class="yfnc_tabledata1" align="right"><b>4.65</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00497500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.44</td><td class="yfnc_tabledata1" align="right">11</td><td class="yfnc_tabledata1" align="right">145</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=500.000000"><strong>500.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00500000">AAPL140517P00500000</a></td><td class="yfnc_tabledata1" align="right"><b>0.03</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00500000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">187</td><td class="yfnc_tabledata1" align="right">10,044</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=500.000000"><strong>500.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00500000">AAPL7140517P00500000</a></td><td class="yfnc_tabledata1" align="right"><b>0.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00500000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.04</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">400</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=500.000000"><strong>500.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00500000">AAPL140523P00500000</a></td><td class="yfnc_tabledata1" align="right"><b>0.07</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00500000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">0.13</td><td class="yfnc_tabledata1" align="right">12</td><td class="yfnc_tabledata1" align="right">356</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=500.000000"><strong>500.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00500000">AAPL7140523P00500000</a></td><td class="yfnc_tabledata1" align="right"><b>0.31</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00500000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.13</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">106</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=500.000000"><strong>500.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00500000">AAPL140530P00500000</a></td><td class="yfnc_tabledata1" align="right"><b>0.15</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00500000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.05</b></span></td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">0.19</td><td class="yfnc_tabledata1" align="right">11</td><td class="yfnc_tabledata1" align="right">89</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=500.000000"><strong>500.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00500000">AAPL7140530P00500000</a></td><td class="yfnc_tabledata1" align="right"><b>0.08</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00500000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.45</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">279</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=502.500000"><strong>502.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00502500">AAPL140523P00502500</a></td><td class="yfnc_tabledata1" align="right"><b>0.07</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00502500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.13</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">217</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=502.500000"><strong>502.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00502500">AAPL140530P00502500</a></td><td class="yfnc_tabledata1" align="right"><b>0.24</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00502500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.23</td><td class="yfnc_tabledata1" align="right">25</td><td class="yfnc_tabledata1" align="right">49</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=502.500000"><strong>502.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00502500">AAPL7140530P00502500</a></td><td class="yfnc_tabledata1" align="right"><b>5.90</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00502500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.46</td><td class="yfnc_tabledata1" align="right">114</td><td class="yfnc_tabledata1" align="right">270</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=505.000000"><strong>505.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00505000">AAPL140517P00505000</a></td><td class="yfnc_tabledata1" align="right"><b>0.04</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00505000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">38</td><td class="yfnc_tabledata1" align="right">3,196</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=505.000000"><strong>505.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00505000">AAPL7140517P00505000</a></td><td class="yfnc_tabledata1" align="right"><b>0.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00505000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">217</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=505.000000"><strong>505.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00505000">AAPL140523P00505000</a></td><td class="yfnc_tabledata1" align="right"><b>0.07</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00505000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">46</td><td class="yfnc_tabledata1" align="right">659</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=505.000000"><strong>505.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00505000">AAPL7140523P00505000</a></td><td class="yfnc_tabledata1" align="right"><b>0.16</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00505000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.36</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">549</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=505.000000"><strong>505.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00505000">AAPL140530P00505000</a></td><td class="yfnc_tabledata1" align="right"><b>0.16</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00505000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.04</b></span></td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">0.23</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">31</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=505.000000"><strong>505.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00505000">AAPL7140530P00505000</a></td><td class="yfnc_tabledata1" align="right"><b>0.54</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00505000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.46</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">305</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=507.500000"><strong>507.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00507500">AAPL140523P00507500</a></td><td class="yfnc_tabledata1" align="right"><b>0.07</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00507500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">0.14</td><td class="yfnc_tabledata1" align="right">19</td><td class="yfnc_tabledata1" align="right">152</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=507.500000"><strong>507.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00507500">AAPL7140523P00507500</a></td><td class="yfnc_tabledata1" align="right"><b>6.70</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00507500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.15</td><td class="yfnc_tabledata1" align="right">109</td><td class="yfnc_tabledata1" align="right">527</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=507.500000"><strong>507.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00507500">AAPL140530P00507500</a></td><td class="yfnc_tabledata1" align="right"><b>0.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00507500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">0.22</td><td class="yfnc_tabledata1" align="right">165</td><td class="yfnc_tabledata1" align="right">194</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=507.500000"><strong>507.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00507500">AAPL7140530P00507500</a></td><td class="yfnc_tabledata1" align="right"><b>8.50</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00507500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.48</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">500</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=510.000000"><strong>510.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00510000">AAPL140517P00510000</a></td><td class="yfnc_tabledata1" align="right"><b>0.04</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00510000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">92</td><td class="yfnc_tabledata1" align="right">10,771</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=510.000000"><strong>510.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00510000">AAPL7140517P00510000</a></td><td class="yfnc_tabledata1" align="right"><b>0.08</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00510000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.03</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.10</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">1,109</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=510.000000"><strong>510.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00510000">AAPL140523P00510000</a></td><td class="yfnc_tabledata1" align="right"><b>0.08</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00510000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">0.08</td><td class="yfnc_tabledata1" align="right">96</td><td class="yfnc_tabledata1" align="right">512</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=510.000000"><strong>510.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00510000">AAPL7140523P00510000</a></td><td class="yfnc_tabledata1" align="right"><b>0.17</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00510000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.38</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">76</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=510.000000"><strong>510.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00510000">AAPL140530P00510000</a></td><td class="yfnc_tabledata1" align="right"><b>0.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00510000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">0.19</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">123</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=510.000000"><strong>510.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00510000">AAPL7140530P00510000</a></td><td class="yfnc_tabledata1" align="right"><b>0.62</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00510000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.21</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">253</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=512.500000"><strong>512.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00512500">AAPL140523P00512500</a></td><td class="yfnc_tabledata1" align="right"><b>0.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00512500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.04</b></span></td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">0.15</td><td class="yfnc_tabledata1" align="right">28</td><td class="yfnc_tabledata1" align="right">116</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=512.500000"><strong>512.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00512500">AAPL140530P00512500</a></td><td class="yfnc_tabledata1" align="right"><b>0.08</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00512500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.04</b></span></td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">0.20</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">107</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=512.500000"><strong>512.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00512500">AAPL7140530P00512500</a></td><td class="yfnc_tabledata1" align="right"><b>9.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00512500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.23</td><td class="yfnc_tabledata1" align="right">54</td><td class="yfnc_tabledata1" align="right">54</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=515.000000"><strong>515.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00515000">AAPL140517P00515000</a></td><td class="yfnc_tabledata1" align="right"><b>0.04</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00515000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.03</b></span></td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">338</td><td class="yfnc_tabledata1" align="right">3,916</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=515.000000"><strong>515.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00515000">AAPL7140517P00515000</a></td><td class="yfnc_tabledata1" align="right"><b>0.09</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00515000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.06</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.11</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">470</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=515.000000"><strong>515.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00515000">AAPL140523P00515000</a></td><td class="yfnc_tabledata1" align="right"><b>0.11</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00515000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.04</b></span></td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">0.14</td><td class="yfnc_tabledata1" align="right">80</td><td class="yfnc_tabledata1" align="right">441</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=515.000000"><strong>515.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00515000">AAPL7140523P00515000</a></td><td class="yfnc_tabledata1" align="right"><b>0.86</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00515000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.39</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">19</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=515.000000"><strong>515.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00515000">AAPL140530P00515000</a></td><td class="yfnc_tabledata1" align="right"><b>0.16</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00515000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">0.22</td><td class="yfnc_tabledata1" align="right">207</td><td class="yfnc_tabledata1" align="right">298</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=515.000000"><strong>515.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00515000">AAPL7140530P00515000</a></td><td class="yfnc_tabledata1" align="right"><b>12.00</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00515000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.23</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">4</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=517.500000"><strong>517.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00517500">AAPL140523P00517500</a></td><td class="yfnc_tabledata1" align="right"><b>0.13</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00517500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">0.15</td><td class="yfnc_tabledata1" align="right">14</td><td class="yfnc_tabledata1" align="right">106</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=517.500000"><strong>517.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00517500">AAPL7140523P00517500</a></td><td class="yfnc_tabledata1" align="right"><b>0.70</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00517500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.40</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">30</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=517.500000"><strong>517.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00517500">AAPL140530P00517500</a></td><td class="yfnc_tabledata1" align="right"><b>0.19</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00517500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">0.18</td><td class="yfnc_tabledata1" align="right">232</td><td class="yfnc_tabledata1" align="right">244</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=517.500000"><strong>517.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00517500">AAPL7140530P00517500</a></td><td class="yfnc_tabledata1" align="right"><b>1.18</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00517500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">5</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=520.000000"><strong>520.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00520000">AAPL140517P00520000</a></td><td class="yfnc_tabledata1" align="right"><b>0.06</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00520000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">0.06</td><td class="yfnc_tabledata1" align="right">202</td><td class="yfnc_tabledata1" align="right">9,047</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=520.000000"><strong>520.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00520000">AAPL7140517P00520000</a></td><td class="yfnc_tabledata1" align="right"><b>0.09</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00520000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">357</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=520.000000"><strong>520.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00520000">AAPL140523P00520000</a></td><td class="yfnc_tabledata1" align="right"><b>0.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00520000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">0.06</td><td class="yfnc_tabledata1" align="right">0.13</td><td class="yfnc_tabledata1" align="right">62</td><td class="yfnc_tabledata1" align="right">387</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=520.000000"><strong>520.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00520000">AAPL7140523P00520000</a></td><td class="yfnc_tabledata1" align="right"><b>0.25</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00520000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.19</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">114</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=520.000000"><strong>520.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00520000">AAPL140530P00520000</a></td><td class="yfnc_tabledata1" align="right"><b>0.16</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00520000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.03</b></span></td><td class="yfnc_tabledata1" align="right">0.07</td><td class="yfnc_tabledata1" align="right">0.22</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">330</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=520.000000"><strong>520.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00520000">AAPL7140530P00520000</a></td><td class="yfnc_tabledata1" align="right"><b>13.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00520000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.27</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">6</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=522.500000"><strong>522.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00522500">AAPL140523P00522500</a></td><td class="yfnc_tabledata1" align="right"><b>0.16</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00522500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.04</b></span></td><td class="yfnc_tabledata1" align="right">0.07</td><td class="yfnc_tabledata1" align="right">0.17</td><td class="yfnc_tabledata1" align="right">6</td><td class="yfnc_tabledata1" align="right">86</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=522.500000"><strong>522.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00522500">AAPL7140523P00522500</a></td><td class="yfnc_tabledata1" align="right"><b>0.83</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00522500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.20</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">12</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=522.500000"><strong>522.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00522500">AAPL140530P00522500</a></td><td class="yfnc_tabledata1" align="right"><b>0.17</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00522500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.04</b></span></td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">0.20</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">279</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=522.500000"><strong>522.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00522500">AAPL7140530P00522500</a></td><td class="yfnc_tabledata1" align="right"><b>19.90</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00522500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.29</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=525.000000"><strong>525.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00525000">AAPL140517P00525000</a></td><td class="yfnc_tabledata1" align="right"><b>0.08</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00525000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">0.06</td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">450</td><td class="yfnc_tabledata1" align="right">3,526</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=525.000000"><strong>525.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00525000">AAPL7140517P00525000</a></td><td class="yfnc_tabledata1" align="right"><b>0.13</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00525000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.05</b></span></td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">0.13</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">471</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=525.000000"><strong>525.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00525000">AAPL140523P00525000</a></td><td class="yfnc_tabledata1" align="right"><b>0.16</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00525000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">0.08</td><td class="yfnc_tabledata1" align="right">0.19</td><td class="yfnc_tabledata1" align="right">52</td><td class="yfnc_tabledata1" align="right">670</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=525.000000"><strong>525.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00525000">AAPL7140523P00525000</a></td><td class="yfnc_tabledata1" align="right"><b>16.00</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00525000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.21</td><td class="yfnc_tabledata1" align="right">73</td><td class="yfnc_tabledata1" align="right">86</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=525.000000"><strong>525.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00525000">AAPL140530P00525000</a></td><td class="yfnc_tabledata1" align="right"><b>0.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00525000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">0.11</td><td class="yfnc_tabledata1" align="right">0.23</td><td class="yfnc_tabledata1" align="right">69</td><td class="yfnc_tabledata1" align="right">348</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=525.000000"><strong>525.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00525000">AAPL7140530P00525000</a></td><td class="yfnc_tabledata1" align="right"><b>1.25</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00525000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.30</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">4</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=527.500000"><strong>527.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00527500">AAPL140523P00527500</a></td><td class="yfnc_tabledata1" align="right"><b>0.16</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00527500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">0.16</td><td class="yfnc_tabledata1" align="right">6</td><td class="yfnc_tabledata1" align="right">318</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=527.500000"><strong>527.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00527500">AAPL7140523P00527500</a></td><td class="yfnc_tabledata1" align="right"><b>1.50</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00527500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.23</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">4</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=527.500000"><strong>527.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00527500">AAPL140530P00527500</a></td><td class="yfnc_tabledata1" align="right"><b>0.28</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00527500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.14</td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">15</td><td class="yfnc_tabledata1" align="right">18</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=527.500000"><strong>527.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00527500">AAPL7140530P00527500</a></td><td class="yfnc_tabledata1" align="right"><b>1.46</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00527500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.11</td><td class="yfnc_tabledata1" align="right">0.31</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=530.000000"><strong>530.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00530000">AAPL140517P00530000</a></td><td class="yfnc_tabledata1" align="right"><b>0.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00530000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">0.10</td><td class="yfnc_tabledata1" align="right">530</td><td class="yfnc_tabledata1" align="right">13,138</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=530.000000"><strong>530.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00530000">AAPL7140517P00530000</a></td><td class="yfnc_tabledata1" align="right"><b>0.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00530000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.06</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.14</td><td class="yfnc_tabledata1" align="right">16</td><td class="yfnc_tabledata1" align="right">436</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=530.000000"><strong>530.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00530000">AAPL140523P00530000</a></td><td class="yfnc_tabledata1" align="right"><b>0.18</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00530000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">0.13</td><td class="yfnc_tabledata1" align="right">0.23</td><td class="yfnc_tabledata1" align="right">121</td><td class="yfnc_tabledata1" align="right">589</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=530.000000"><strong>530.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00530000">AAPL7140523P00530000</a></td><td class="yfnc_tabledata1" align="right"><b>0.19</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00530000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.26</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.24</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">38</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=530.000000"><strong>530.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00530000">AAPL140530P00530000</a></td><td class="yfnc_tabledata1" align="right"><b>0.26</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00530000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.03</b></span></td><td class="yfnc_tabledata1" align="right">0.20</td><td class="yfnc_tabledata1" align="right">0.27</td><td class="yfnc_tabledata1" align="right">28</td><td class="yfnc_tabledata1" align="right">4,407</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=530.000000"><strong>530.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00530000">AAPL7140530P00530000</a></td><td class="yfnc_tabledata1" align="right"><b>2.43</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00530000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.10</td><td class="yfnc_tabledata1" align="right">0.35</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">4</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=532.500000"><strong>532.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00532500">AAPL140523P00532500</a></td><td class="yfnc_tabledata1" align="right"><b>0.22</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00532500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.05</b></span></td><td class="yfnc_tabledata1" align="right">0.15</td><td class="yfnc_tabledata1" align="right">0.22</td><td class="yfnc_tabledata1" align="right">656</td><td class="yfnc_tabledata1" align="right">252</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=532.500000"><strong>532.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00532500">AAPL7140523P00532500</a></td><td class="yfnc_tabledata1" align="right"><b>17.60</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00532500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">0.29</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">2</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=532.500000"><strong>532.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00532500">AAPL140530P00532500</a></td><td class="yfnc_tabledata1" align="right"><b>0.33</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00532500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">0.36</td><td class="yfnc_tabledata1" align="right">32</td><td class="yfnc_tabledata1" align="right">33</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=535.000000"><strong>535.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00535000">AAPL140517P00535000</a></td><td class="yfnc_tabledata1" align="right"><b>0.09</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00535000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.04</b></span></td><td class="yfnc_tabledata1" align="right">0.08</td><td class="yfnc_tabledata1" align="right">0.15</td><td class="yfnc_tabledata1" align="right">425</td><td class="yfnc_tabledata1" align="right">3,948</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=535.000000"><strong>535.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00535000">AAPL7140517P00535000</a></td><td class="yfnc_tabledata1" align="right"><b>0.12</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00535000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.03</b></span></td><td class="yfnc_tabledata1" align="right">0.10</td><td class="yfnc_tabledata1" align="right">0.19</td><td class="yfnc_tabledata1" align="right">127</td><td class="yfnc_tabledata1" align="right">656</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=535.000000"><strong>535.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00535000">AAPL140523P00535000</a></td><td class="yfnc_tabledata1" align="right"><b>0.23</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00535000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">0.17</td><td class="yfnc_tabledata1" align="right">0.26</td><td class="yfnc_tabledata1" align="right">86</td><td class="yfnc_tabledata1" align="right">358</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=535.000000"><strong>535.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00535000">AAPL7140523P00535000</a></td><td class="yfnc_tabledata1" align="right"><b>0.31</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00535000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">0.32</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">40</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=535.000000"><strong>535.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00535000">AAPL140530P00535000</a></td><td class="yfnc_tabledata1" align="right"><b>0.30</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00535000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.26</td><td class="yfnc_tabledata1" align="right">0.37</td><td class="yfnc_tabledata1" align="right">26</td><td class="yfnc_tabledata1" align="right">221</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=535.000000"><strong>535.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00535000">AAPL7140530P00535000</a></td><td class="yfnc_tabledata1" align="right"><b>1.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00535000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.15</td><td class="yfnc_tabledata1" align="right">0.52</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">3</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=537.500000"><strong>537.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00537500">AAPL140523P00537500</a></td><td class="yfnc_tabledata1" align="right"><b>0.28</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00537500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.11</b></span></td><td class="yfnc_tabledata1" align="right">0.20</td><td class="yfnc_tabledata1" align="right">0.29</td><td class="yfnc_tabledata1" align="right">56</td><td class="yfnc_tabledata1" align="right">148</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=537.500000"><strong>537.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00537500">AAPL7140523P00537500</a></td><td class="yfnc_tabledata1" align="right"><b>1.96</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00537500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.07</td><td class="yfnc_tabledata1" align="right">0.31</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">16</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=537.500000"><strong>537.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00537500">AAPL140530P00537500</a></td><td class="yfnc_tabledata1" align="right"><b>0.47</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00537500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.35</td><td class="yfnc_tabledata1" align="right">0.44</td><td class="yfnc_tabledata1" align="right">27</td><td class="yfnc_tabledata1" align="right">74</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=540.000000"><strong>540.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00540000">AAPL140517P00540000</a></td><td class="yfnc_tabledata1" align="right"><b>0.11</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00540000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">0.10</td><td class="yfnc_tabledata1" align="right">0.14</td><td class="yfnc_tabledata1" align="right">391</td><td class="yfnc_tabledata1" align="right">6,476</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=540.000000"><strong>540.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00540000">AAPL7140517P00540000</a></td><td class="yfnc_tabledata1" align="right"><b>0.15</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00540000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.05</b></span></td><td class="yfnc_tabledata1" align="right">0.06</td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">415</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=540.000000"><strong>540.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00540000">AAPL140523P00540000</a></td><td class="yfnc_tabledata1" align="right"><b>0.32</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00540000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.04</b></span></td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">0.31</td><td class="yfnc_tabledata1" align="right">19</td><td class="yfnc_tabledata1" align="right">321</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=540.000000"><strong>540.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00540000">AAPL7140523P00540000</a></td><td class="yfnc_tabledata1" align="right"><b>0.70</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00540000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.10</td><td class="yfnc_tabledata1" align="right">0.33</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">18</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=540.000000"><strong>540.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00540000">AAPL140530P00540000</a></td><td class="yfnc_tabledata1" align="right"><b>0.57</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00540000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.22</b></span></td><td class="yfnc_tabledata1" align="right">0.41</td><td class="yfnc_tabledata1" align="right">0.51</td><td class="yfnc_tabledata1" align="right">41</td><td class="yfnc_tabledata1" align="right">426</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=540.000000"><strong>540.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00540000">AAPL7140530P00540000</a></td><td class="yfnc_tabledata1" align="right"><b>1.60</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00540000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.39</td><td class="yfnc_tabledata1" align="right">0.54</td><td class="yfnc_tabledata1" align="right">132</td><td class="yfnc_tabledata1" align="right">134</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=542.500000"><strong>542.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00542500">AAPL140523P00542500</a></td><td class="yfnc_tabledata1" align="right"><b>0.36</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00542500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.07</b></span></td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">0.35</td><td class="yfnc_tabledata1" align="right">64</td><td class="yfnc_tabledata1" align="right">78</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=542.500000"><strong>542.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00542500">AAPL7140523P00542500</a></td><td class="yfnc_tabledata1" align="right"><b>3.67</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00542500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.13</td><td class="yfnc_tabledata1" align="right">0.36</td><td class="yfnc_tabledata1" align="right">174</td><td class="yfnc_tabledata1" align="right">176</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=542.500000"><strong>542.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00542500">AAPL140530P00542500</a></td><td class="yfnc_tabledata1" align="right"><b>0.66</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00542500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.48</td><td class="yfnc_tabledata1" align="right">0.57</td><td class="yfnc_tabledata1" align="right">102</td><td class="yfnc_tabledata1" align="right">124</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=542.500000"><strong>542.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00542500">AAPL7140530P00542500</a></td><td class="yfnc_tabledata1" align="right"><b>5.95</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00542500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.47</td><td class="yfnc_tabledata1" align="right">0.59</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=545.000000"><strong>545.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00545000">AAPL140517P00545000</a></td><td class="yfnc_tabledata1" align="right"><b>0.13</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00545000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.04</b></span></td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">0.17</td><td class="yfnc_tabledata1" align="right">259</td><td class="yfnc_tabledata1" align="right">4,469</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=545.000000"><strong>545.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00545000">AAPL7140517P00545000</a></td><td class="yfnc_tabledata1" align="right"><b>0.14</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00545000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">0.08</td><td class="yfnc_tabledata1" align="right">0.26</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">275</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=545.000000"><strong>545.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00545000">AAPL140523P00545000</a></td><td class="yfnc_tabledata1" align="right"><b>0.35</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00545000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">0.29</td><td class="yfnc_tabledata1" align="right">0.39</td><td class="yfnc_tabledata1" align="right">73</td><td class="yfnc_tabledata1" align="right">105</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=545.000000"><strong>545.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00545000">AAPL7140523P00545000</a></td><td class="yfnc_tabledata1" align="right"><b>1.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00545000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.11</td><td class="yfnc_tabledata1" align="right">0.41</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">81</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=545.000000"><strong>545.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00545000">AAPL140530P00545000</a></td><td class="yfnc_tabledata1" align="right"><b>0.65</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00545000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.09</b></span></td><td class="yfnc_tabledata1" align="right">0.57</td><td class="yfnc_tabledata1" align="right">0.65</td><td class="yfnc_tabledata1" align="right">63</td><td class="yfnc_tabledata1" align="right">324</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=545.000000"><strong>545.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00545000">AAPL7140530P00545000</a></td><td class="yfnc_tabledata1" align="right"><b>1.48</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00545000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.55</td><td class="yfnc_tabledata1" align="right">0.67</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">68</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=547.500000"><strong>547.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00547500">AAPL140523P00547500</a></td><td class="yfnc_tabledata1" align="right"><b>0.53</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00547500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.27</b></span></td><td class="yfnc_tabledata1" align="right">0.33</td><td class="yfnc_tabledata1" align="right">0.43</td><td class="yfnc_tabledata1" align="right">51</td><td class="yfnc_tabledata1" align="right">78</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=547.500000"><strong>547.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00547500">AAPL7140523P00547500</a></td><td class="yfnc_tabledata1" align="right"><b>1.82</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00547500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.32</td><td class="yfnc_tabledata1" align="right">0.45</td><td class="yfnc_tabledata1" align="right">22</td><td class="yfnc_tabledata1" align="right">161</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=547.500000"><strong>547.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00547500">AAPL140530P00547500</a></td><td class="yfnc_tabledata1" align="right"><b>0.53</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00547500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.67</td><td class="yfnc_tabledata1" align="right">0.74</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">71</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=550.000000"><strong>550.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00550000">AAPL140517P00550000</a></td><td class="yfnc_tabledata1" align="right"><b>0.16</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00550000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.03</b></span></td><td class="yfnc_tabledata1" align="right">0.15</td><td class="yfnc_tabledata1" align="right">0.16</td><td class="yfnc_tabledata1" align="right">1,132</td><td class="yfnc_tabledata1" align="right">5,742</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=550.000000"><strong>550.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00550000">AAPL7140517P00550000</a></td><td class="yfnc_tabledata1" align="right"><b>0.16</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00550000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.39</b></span></td><td class="yfnc_tabledata1" align="right">0.10</td><td class="yfnc_tabledata1" align="right">0.21</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">619</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=550.000000"><strong>550.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00550000">AAPL140523P00550000</a></td><td class="yfnc_tabledata1" align="right"><b>0.45</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00550000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.07</b></span></td><td class="yfnc_tabledata1" align="right">0.40</td><td class="yfnc_tabledata1" align="right">0.45</td><td class="yfnc_tabledata1" align="right">91</td><td class="yfnc_tabledata1" align="right">241</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=550.000000"><strong>550.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00550000">AAPL7140523P00550000</a></td><td class="yfnc_tabledata1" align="right"><b>0.41</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00550000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.40</td><td class="yfnc_tabledata1" align="right">0.51</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">22</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=550.000000"><strong>550.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00550000">AAPL140530P00550000</a></td><td class="yfnc_tabledata1" align="right"><b>0.84</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00550000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.21</b></span></td><td class="yfnc_tabledata1" align="right">0.78</td><td class="yfnc_tabledata1" align="right">0.87</td><td class="yfnc_tabledata1" align="right">42</td><td class="yfnc_tabledata1" align="right">311</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=550.000000"><strong>550.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00550000">AAPL7140530P00550000</a></td><td class="yfnc_tabledata1" align="right"><b>1.14</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00550000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.49</b></span></td><td class="yfnc_tabledata1" align="right">0.74</td><td class="yfnc_tabledata1" align="right">0.90</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">5</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=552.500000"><strong>552.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00552500">AAPL140523P00552500</a></td><td class="yfnc_tabledata1" align="right"><b>0.72</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00552500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.36</b></span></td><td class="yfnc_tabledata1" align="right">0.48</td><td class="yfnc_tabledata1" align="right">0.58</td><td class="yfnc_tabledata1" align="right">22</td><td class="yfnc_tabledata1" align="right">68</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=552.500000"><strong>552.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00552500">AAPL140530P00552500</a></td><td class="yfnc_tabledata1" align="right"><b>1.14</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00552500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.29</b></span></td><td class="yfnc_tabledata1" align="right">0.93</td><td class="yfnc_tabledata1" align="right">1.04</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">58</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=555.000000"><strong>555.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00555000">AAPL140517P00555000</a></td><td class="yfnc_tabledata1" align="right"><b>0.19</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00555000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.04</b></span></td><td class="yfnc_tabledata1" align="right">0.17</td><td class="yfnc_tabledata1" align="right">0.20</td><td class="yfnc_tabledata1" align="right">618</td><td class="yfnc_tabledata1" align="right">3,546</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=555.000000"><strong>555.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00555000">AAPL7140517P00555000</a></td><td class="yfnc_tabledata1" align="right"><b>0.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00555000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.29</b></span></td><td class="yfnc_tabledata1" align="right">0.14</td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">413</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=555.000000"><strong>555.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00555000">AAPL140523P00555000</a></td><td class="yfnc_tabledata1" align="right"><b>0.65</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00555000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">0.59</td><td class="yfnc_tabledata1" align="right">0.66</td><td class="yfnc_tabledata1" align="right">125</td><td class="yfnc_tabledata1" align="right">232</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=555.000000"><strong>555.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00555000">AAPL140530P00555000</a></td><td class="yfnc_tabledata1" align="right"><b>1.27</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00555000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.44</b></span></td><td class="yfnc_tabledata1" align="right">1.11</td><td class="yfnc_tabledata1" align="right">1.22</td><td class="yfnc_tabledata1" align="right">52</td><td class="yfnc_tabledata1" align="right">204</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=555.000000"><strong>555.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00555000">AAPL7140530P00555000</a></td><td class="yfnc_tabledata1" align="right"><b>4.25</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00555000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">1.00</td><td class="yfnc_tabledata1" align="right">1.23</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=557.500000"><strong>557.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00557500">AAPL140517P00557500</a></td><td class="yfnc_tabledata1" align="right"><b>0.22</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00557500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.03</b></span></td><td class="yfnc_tabledata1" align="right">0.20</td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">365</td><td class="yfnc_tabledata1" align="right">52</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=557.500000"><strong>557.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00557500">AAPL140523P00557500</a></td><td class="yfnc_tabledata1" align="right"><b>1.15</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00557500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.29</b></span></td><td class="yfnc_tabledata1" align="right">0.72</td><td class="yfnc_tabledata1" align="right">0.81</td><td class="yfnc_tabledata1" align="right">61</td><td class="yfnc_tabledata1" align="right">225</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=557.500000"><strong>557.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00557500">AAPL7140523P00557500</a></td><td class="yfnc_tabledata1" align="right"><b>4.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00557500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.66</td><td class="yfnc_tabledata1" align="right">0.86</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=557.500000"><strong>557.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00557500">AAPL140530P00557500</a></td><td class="yfnc_tabledata1" align="right"><b>1.35</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00557500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.26</b></span></td><td class="yfnc_tabledata1" align="right">1.32</td><td class="yfnc_tabledata1" align="right">1.45</td><td class="yfnc_tabledata1" align="right">20</td><td class="yfnc_tabledata1" align="right">71</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=557.500000"><strong>557.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00557500">AAPL7140530P00557500</a></td><td class="yfnc_tabledata1" align="right"><b>1.93</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00557500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.92</b></span></td><td class="yfnc_tabledata1" align="right">1.29</td><td class="yfnc_tabledata1" align="right">1.45</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">2</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00560000">AAPL140517P00560000</a></td><td class="yfnc_tabledata1" align="right"><b>0.28</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00560000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">0.29</td><td class="yfnc_tabledata1" align="right">2,306</td><td class="yfnc_tabledata1" align="right">4,494</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00560000">AAPL7140517P00560000</a></td><td class="yfnc_tabledata1" align="right"><b>0.45</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00560000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.18</b></span></td><td class="yfnc_tabledata1" align="right">0.19</td><td class="yfnc_tabledata1" align="right">0.36</td><td class="yfnc_tabledata1" align="right">9</td><td class="yfnc_tabledata1" align="right">424</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00560000">AAPL140523P00560000</a></td><td class="yfnc_tabledata1" align="right"><b>1.06</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00560000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.12</b></span></td><td class="yfnc_tabledata1" align="right">0.88</td><td class="yfnc_tabledata1" align="right">0.97</td><td class="yfnc_tabledata1" align="right">324</td><td class="yfnc_tabledata1" align="right">580</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00560000">AAPL7140523P00560000</a></td><td class="yfnc_tabledata1" align="right"><b>1.50</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00560000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.45</b></span></td><td class="yfnc_tabledata1" align="right">0.84</td><td class="yfnc_tabledata1" align="right">1.10</td><td class="yfnc_tabledata1" align="right">8</td><td class="yfnc_tabledata1" align="right">8</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00560000">AAPL140530P00560000</a></td><td class="yfnc_tabledata1" align="right"><b>1.84</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00560000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.24</b></span></td><td class="yfnc_tabledata1" align="right">1.58</td><td class="yfnc_tabledata1" align="right">1.73</td><td class="yfnc_tabledata1" align="right">230</td><td class="yfnc_tabledata1" align="right">599</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00560000">AAPL7140530P00560000</a></td><td class="yfnc_tabledata1" align="right"><b>2.45</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00560000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.10</b></span></td><td class="yfnc_tabledata1" align="right">1.56</td><td class="yfnc_tabledata1" align="right">1.73</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">33</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=562.500000"><strong>562.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00562500">AAPL140517P00562500</a></td><td class="yfnc_tabledata1" align="right"><b>0.32</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00562500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.05</b></span></td><td class="yfnc_tabledata1" align="right">0.29</td><td class="yfnc_tabledata1" align="right">0.36</td><td class="yfnc_tabledata1" align="right">1,450</td><td class="yfnc_tabledata1" align="right">160</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=562.500000"><strong>562.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00562500">AAPL140523P00562500</a></td><td class="yfnc_tabledata1" align="right"><b>1.16</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00562500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">1.11</td><td class="yfnc_tabledata1" align="right">1.19</td><td class="yfnc_tabledata1" align="right">200</td><td class="yfnc_tabledata1" align="right">201</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=562.500000"><strong>562.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00562500">AAPL7140523P00562500</a></td><td class="yfnc_tabledata1" align="right"><b>3.50</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00562500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">1.02</td><td class="yfnc_tabledata1" align="right">1.26</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">115</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=562.500000"><strong>562.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00562500">AAPL140530P00562500</a></td><td class="yfnc_tabledata1" align="right"><b>2.67</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00562500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.71</b></span></td><td class="yfnc_tabledata1" align="right">1.91</td><td class="yfnc_tabledata1" align="right">2.05</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">112</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=562.500000"><strong>562.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00562500">AAPL7140530P00562500</a></td><td class="yfnc_tabledata1" align="right"><b>2.77</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00562500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">1.86</td><td class="yfnc_tabledata1" align="right">2.17</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">69</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00565000">AAPL140517P00565000</a></td><td class="yfnc_tabledata1" align="right"><b>0.45</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00565000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">0.39</td><td class="yfnc_tabledata1" align="right">0.46</td><td class="yfnc_tabledata1" align="right">2,738</td><td class="yfnc_tabledata1" align="right">4,705</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00565000">AAPL7140517P00565000</a></td><td class="yfnc_tabledata1" align="right"><b>0.50</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00565000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.35</td><td class="yfnc_tabledata1" align="right">0.52</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">493</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00565000">AAPL140523P00565000</a></td><td class="yfnc_tabledata1" align="right"><b>1.42</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00565000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">1.38</td><td class="yfnc_tabledata1" align="right">1.48</td><td class="yfnc_tabledata1" align="right">449</td><td class="yfnc_tabledata1" align="right">660</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00565000">AAPL7140523P00565000</a></td><td class="yfnc_tabledata1" align="right"><b>1.30</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00565000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">1.29</td><td class="yfnc_tabledata1" align="right">1.60</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">13</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00565000">AAPL140530P00565000</a></td><td class="yfnc_tabledata1" align="right"><b>2.41</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00565000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">2.29</td><td class="yfnc_tabledata1" align="right">2.44</td><td class="yfnc_tabledata1" align="right">308</td><td class="yfnc_tabledata1" align="right">1,159</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00565000">AAPL7140530P00565000</a></td><td class="yfnc_tabledata1" align="right"><b>1.80</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00565000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">2.18</td><td class="yfnc_tabledata1" align="right">2.48</td><td class="yfnc_tabledata1" align="right">6</td><td class="yfnc_tabledata1" align="right">63</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=567.500000"><strong>567.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00567500">AAPL140517P00567500</a></td><td class="yfnc_tabledata1" align="right"><b>0.55</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00567500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.07</b></span></td><td class="yfnc_tabledata1" align="right">0.53</td><td class="yfnc_tabledata1" align="right">0.55</td><td class="yfnc_tabledata1" align="right">1,213</td><td class="yfnc_tabledata1" align="right">260</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=567.500000"><strong>567.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00567500">AAPL140523P00567500</a></td><td class="yfnc_tabledata1" align="right"><b>1.99</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00567500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.22</b></span></td><td class="yfnc_tabledata1" align="right">1.71</td><td class="yfnc_tabledata1" align="right">1.83</td><td class="yfnc_tabledata1" align="right">111</td><td class="yfnc_tabledata1" align="right">194</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=567.500000"><strong>567.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00567500">AAPL7140523P00567500</a></td><td class="yfnc_tabledata1" align="right"><b>2.90</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00567500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">1.65</td><td class="yfnc_tabledata1" align="right">1.95</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">14</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=567.500000"><strong>567.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00567500">AAPL140530P00567500</a></td><td class="yfnc_tabledata1" align="right"><b>3.30</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00567500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.30</b></span></td><td class="yfnc_tabledata1" align="right">2.77</td><td class="yfnc_tabledata1" align="right">2.92</td><td class="yfnc_tabledata1" align="right">16</td><td class="yfnc_tabledata1" align="right">241</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=567.500000"><strong>567.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00567500">AAPL7140530P00567500</a></td><td class="yfnc_tabledata1" align="right"><b>3.90</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00567500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.55</b></span></td><td class="yfnc_tabledata1" align="right">2.67</td><td class="yfnc_tabledata1" align="right">3.05</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">8</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00570000">AAPL140517P00570000</a></td><td class="yfnc_tabledata1" align="right"><b>0.74</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00570000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">0.73</td><td class="yfnc_tabledata1" align="right">0.74</td><td class="yfnc_tabledata1" align="right">4,847</td><td class="yfnc_tabledata1" align="right">4,582</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00570000">AAPL7140517P00570000</a></td><td class="yfnc_tabledata1" align="right"><b>1.65</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00570000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.75</b></span></td><td class="yfnc_tabledata1" align="right">0.69</td><td class="yfnc_tabledata1" align="right">0.87</td><td class="yfnc_tabledata1" align="right">26</td><td class="yfnc_tabledata1" align="right">228</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00570000">AAPL140523P00570000</a></td><td class="yfnc_tabledata1" align="right"><b>2.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00570000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.06</b></span></td><td class="yfnc_tabledata1" align="right">2.14</td><td class="yfnc_tabledata1" align="right">2.27</td><td class="yfnc_tabledata1" align="right">619</td><td class="yfnc_tabledata1" align="right">788</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00570000">AAPL7140523P00570000</a></td><td class="yfnc_tabledata1" align="right"><b>3.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00570000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.15</b></span></td><td class="yfnc_tabledata1" align="right">2.07</td><td class="yfnc_tabledata1" align="right">2.32</td><td class="yfnc_tabledata1" align="right">6</td><td class="yfnc_tabledata1" align="right">15</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00570000">AAPL140530P00570000</a></td><td class="yfnc_tabledata1" align="right"><b>3.40</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00570000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.14</b></span></td><td class="yfnc_tabledata1" align="right">3.25</td><td class="yfnc_tabledata1" align="right">3.50</td><td class="yfnc_tabledata1" align="right">260</td><td class="yfnc_tabledata1" align="right">999</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00570000">AAPL7140530P00570000</a></td><td class="yfnc_tabledata1" align="right"><b>4.79</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00570000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">2.17</b></span></td><td class="yfnc_tabledata1" align="right">3.20</td><td class="yfnc_tabledata1" align="right">3.50</td><td class="yfnc_tabledata1" align="right">11</td><td class="yfnc_tabledata1" align="right">57</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=572.500000"><strong>572.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00572500">AAPL140517P00572500</a></td><td class="yfnc_tabledata1" align="right"><b>1.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00572500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.07</b></span></td><td class="yfnc_tabledata1" align="right">1.00</td><td class="yfnc_tabledata1" align="right">1.05</td><td class="yfnc_tabledata1" align="right">1,653</td><td class="yfnc_tabledata1" align="right">434</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=572.500000"><strong>572.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00572500">AAPL140523P00572500</a></td><td class="yfnc_tabledata1" align="right"><b>2.95</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00572500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.30</b></span></td><td class="yfnc_tabledata1" align="right">2.62</td><td class="yfnc_tabledata1" align="right">2.79</td><td class="yfnc_tabledata1" align="right">405</td><td class="yfnc_tabledata1" align="right">224</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=572.500000"><strong>572.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00572500">AAPL7140523P00572500</a></td><td class="yfnc_tabledata1" align="right"><b>4.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00572500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.05</b></span></td><td class="yfnc_tabledata1" align="right">2.55</td><td class="yfnc_tabledata1" align="right">2.92</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">78</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=572.500000"><strong>572.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00572500">AAPL140530P00572500</a></td><td class="yfnc_tabledata1" align="right"><b>5.25</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00572500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">2.45</b></span></td><td class="yfnc_tabledata1" align="right">3.90</td><td class="yfnc_tabledata1" align="right">4.15</td><td class="yfnc_tabledata1" align="right">275</td><td class="yfnc_tabledata1" align="right">376</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=572.500000"><strong>572.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00572500">AAPL7140530P00572500</a></td><td class="yfnc_tabledata1" align="right"><b>2.81</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00572500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">3.80</td><td class="yfnc_tabledata1" align="right">4.15</td><td class="yfnc_tabledata1" align="right">11</td><td class="yfnc_tabledata1" align="right">103</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00575000">AAPL140517P00575000</a></td><td class="yfnc_tabledata1" align="right"><b>1.47</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00575000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.07</b></span></td><td class="yfnc_tabledata1" align="right">1.45</td><td class="yfnc_tabledata1" align="right">1.51</td><td class="yfnc_tabledata1" align="right">5,455</td><td class="yfnc_tabledata1" align="right">5,975</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00575000">AAPL7140517P00575000</a></td><td class="yfnc_tabledata1" align="right"><b>2.78</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00575000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.63</b></span></td><td class="yfnc_tabledata1" align="right">1.32</td><td class="yfnc_tabledata1" align="right">1.64</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">284</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00575000">AAPL140523P00575000</a></td><td class="yfnc_tabledata1" align="right"><b>3.45</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00575000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.21</b></span></td><td class="yfnc_tabledata1" align="right">3.25</td><td class="yfnc_tabledata1" align="right">3.45</td><td class="yfnc_tabledata1" align="right">417</td><td class="yfnc_tabledata1" align="right">604</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00575000">AAPL7140523P00575000</a></td><td class="yfnc_tabledata1" align="right"><b>2.52</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00575000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">3.15</td><td class="yfnc_tabledata1" align="right">3.60</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">5</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00575000">AAPL140530P00575000</a></td><td class="yfnc_tabledata1" align="right"><b>4.75</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00575000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.25</b></span></td><td class="yfnc_tabledata1" align="right">4.65</td><td class="yfnc_tabledata1" align="right">4.90</td><td class="yfnc_tabledata1" align="right">582</td><td class="yfnc_tabledata1" align="right">1,420</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00575000">AAPL7140530P00575000</a></td><td class="yfnc_tabledata1" align="right"><b>6.50</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00575000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.95</b></span></td><td class="yfnc_tabledata1" align="right">4.55</td><td class="yfnc_tabledata1" align="right">4.90</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">111</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=577.500000"><strong>577.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00577500">AAPL140517P00577500</a></td><td class="yfnc_tabledata1" align="right"><b>1.98</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00577500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.05</b></span></td><td class="yfnc_tabledata1" align="right">1.95</td><td class="yfnc_tabledata1" align="right">2.05</td><td class="yfnc_tabledata1" align="right">2,748</td><td class="yfnc_tabledata1" align="right">232</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=577.500000"><strong>577.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00577500">AAPL140523P00577500</a></td><td class="yfnc_tabledata1" align="right"><b>4.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00577500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.10</b></span></td><td class="yfnc_tabledata1" align="right">4.00</td><td class="yfnc_tabledata1" align="right">4.20</td><td class="yfnc_tabledata1" align="right">197</td><td class="yfnc_tabledata1" align="right">200</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=577.500000"><strong>577.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00577500">AAPL7140523P00577500</a></td><td class="yfnc_tabledata1" align="right"><b>6.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00577500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">3.05</b></span></td><td class="yfnc_tabledata1" align="right">3.90</td><td class="yfnc_tabledata1" align="right">4.35</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">276</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00580000">AAPL140517P00580000</a></td><td class="yfnc_tabledata1" align="right"><b>2.72</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00580000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.14</b></span></td><td class="yfnc_tabledata1" align="right">2.70</td><td class="yfnc_tabledata1" align="right">2.75</td><td class="yfnc_tabledata1" align="right">7,127</td><td class="yfnc_tabledata1" align="right">4,696</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00580000">AAPL7140517P00580000</a></td><td class="yfnc_tabledata1" align="right"><b>2.78</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00580000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.18</b></span></td><td class="yfnc_tabledata1" align="right">2.54</td><td class="yfnc_tabledata1" align="right">2.99</td><td class="yfnc_tabledata1" align="right">211</td><td class="yfnc_tabledata1" align="right">302</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00580000">AAPL140523P00580000</a></td><td class="yfnc_tabledata1" align="right"><b>4.95</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00580000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.20</b></span></td><td class="yfnc_tabledata1" align="right">4.90</td><td class="yfnc_tabledata1" align="right">5.10</td><td class="yfnc_tabledata1" align="right">466</td><td class="yfnc_tabledata1" align="right">525</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00580000">AAPL7140523P00580000</a></td><td class="yfnc_tabledata1" align="right"><b>5.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00580000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.40</b></span></td><td class="yfnc_tabledata1" align="right">4.75</td><td class="yfnc_tabledata1" align="right">5.20</td><td class="yfnc_tabledata1" align="right">45</td><td class="yfnc_tabledata1" align="right">28</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00580000">AAPL140530P00580000</a></td><td class="yfnc_tabledata1" align="right"><b>6.72</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00580000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.46</b></span></td><td class="yfnc_tabledata1" align="right">6.45</td><td class="yfnc_tabledata1" align="right">6.70</td><td class="yfnc_tabledata1" align="right">191</td><td class="yfnc_tabledata1" align="right">560</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00580000">AAPL7140530P00580000</a></td><td class="yfnc_tabledata1" align="right"><b>6.68</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00580000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.88</b></span></td><td class="yfnc_tabledata1" align="right">6.10</td><td class="yfnc_tabledata1" align="right">7.50</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">100</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=582.500000"><strong>582.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00582500">AAPL140517P00582500</a></td><td class="yfnc_tabledata1" align="right"><b>3.60</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00582500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.07</b></span></td><td class="yfnc_tabledata1" align="right">3.55</td><td class="yfnc_tabledata1" align="right">3.75</td><td class="yfnc_tabledata1" align="right">3,184</td><td class="yfnc_tabledata1" align="right">607</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140517P00585000">AAPL140517P00585000</a></td><td class="yfnc_tabledata1" align="right"><b>4.80</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140517p00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.42</b></span></td><td class="yfnc_tabledata1" align="right">4.65</td><td class="yfnc_tabledata1" align="right">4.85</td><td class="yfnc_tabledata1" align="right">5,403</td><td class="yfnc_tabledata1" align="right">3,487</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140517P00585000">AAPL7140517P00585000</a></td><td class="yfnc_tabledata1" align="right"><b>4.86</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140517p00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.56</b></span></td><td class="yfnc_tabledata1" align="right">4.45</td><td class="yfnc_tabledata1" align="right">5.00</td><td class="yfnc_tabledata1" align="right">38</td><td class="yfnc_tabledata1" align="right">493</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140523P00585000">AAPL140523P00585000</a></td><td class="yfnc_tabledata1" align="right"><b>7.14</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140523p00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.44</b></span></td><td class="yfnc_tabledata1" align="right">7.05</td><td class="yfnc_tabledata1" align="right">7.20</td><td class="yfnc_tabledata1" align="right">598</td><td class="yfnc_tabledata1" align="right">1,335</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140523P00585000">AAPL7140523P00585000</a></td><td class="yfnc_tabledata1" align="right"><b>7.80</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140523p00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.75</b></span></td><td class="yfnc_tabledata1" align="right">6.85</td><td class="yfnc_tabledata1" align="right">9.50</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">30</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140530P00585000">AAPL140530P00585000</a></td><td class="yfnc_tabledata1" align="right"><b>8.75</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140530p00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.41</b></span></td><td class="yfnc_tabledata1" align="right">8.65</td><td class="yfnc_tabledata1" align="right">8.95</td><td class="yfnc_tabledata1" align="right">76</td><td class="yfnc_tabledata1" align="right">294</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140530P00585000">AAPL7140530P00585000</a></td><td class="yfnc_tabledata1" align="right"><b>9.89</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140530p00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.39</b></span></td><td class="yfnc_tabledata1" align="right">8.45</td><td class="yfnc_tabledata1" align="right">10.50</td><td class="yfnc_tabledata1" align="right">39</td><td class="yfnc_tabledata1" align="right">46</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=587.500000"><strong>587.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00587500">AAPL140517P00587500</a></td><td class="yfnc_h" align="right"><b>6.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00587500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.50</b></span></td><td class="yfnc_h" align="right">5.90</td><td class="yfnc_h" align="right">6.10</td><td class="yfnc_h" align="right">1,375</td><td class="yfnc_h" align="right">367</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=587.500000"><strong>587.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517P00587500">AAPL7140517P00587500</a></td><td class="yfnc_h" align="right"><b>8.67</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517p00587500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">2.67</b></span></td><td class="yfnc_h" align="right">5.75</td><td class="yfnc_h" align="right">6.30</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">6</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=587.500000"><strong>587.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523P00587500">AAPL140523P00587500</a></td><td class="yfnc_h" align="right"><b>0.15</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523p00587500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.15</b></span></td><td class="yfnc_h" align="right">N/A</td><td class="yfnc_h" align="right">N/A</td><td class="yfnc_h" align="right">0</td><td class="yfnc_h" align="right">119</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=587.500000"><strong>587.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140523P00587500">AAPL7140523P00587500</a></td><td class="yfnc_h" align="right"><b>0.01</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140523p00587500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.01</b></span></td><td class="yfnc_h" align="right">N/A</td><td class="yfnc_h" align="right">N/A</td><td class="yfnc_h" align="right">0</td><td class="yfnc_h" align="right">265</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=587.500000"><strong>587.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530P00587500">AAPL140530P00587500</a></td><td class="yfnc_h" align="right"><b>1.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530p00587500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.00</b></span></td><td class="yfnc_h" align="right">N/A</td><td class="yfnc_h" align="right">N/A</td><td class="yfnc_h" align="right">0</td><td class="yfnc_h" align="right">20</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=587.500000"><strong>587.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140530P00587500">AAPL7140530P00587500</a></td><td class="yfnc_h" align="right"><b>0.03</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140530p00587500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.03</b></span></td><td class="yfnc_h" align="right">N/A</td><td class="yfnc_h" align="right">N/A</td><td class="yfnc_h" align="right">86</td><td class="yfnc_h" align="right">513</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00590000">AAPL140517P00590000</a></td><td class="yfnc_h" align="right"><b>7.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00590000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.84</b></span></td><td class="yfnc_h" align="right">7.40</td><td class="yfnc_h" align="right">7.65</td><td class="yfnc_h" align="right">2,914</td><td class="yfnc_h" align="right">4,498</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517P00590000">AAPL7140517P00590000</a></td><td class="yfnc_h" align="right"><b>7.80</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517p00590000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.30</b></span></td><td class="yfnc_h" align="right">7.05</td><td class="yfnc_h" align="right">7.80</td><td class="yfnc_h" align="right">20</td><td class="yfnc_h" align="right">274</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523P00590000">AAPL140523P00590000</a></td><td class="yfnc_h" align="right"><b>9.74</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523p00590000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.84</b></span></td><td class="yfnc_h" align="right">9.75</td><td class="yfnc_h" align="right">10.00</td><td class="yfnc_h" align="right">310</td><td class="yfnc_h" align="right">601</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140523P00590000">AAPL7140523P00590000</a></td><td class="yfnc_h" align="right"><b>12.52</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140523p00590000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">5.67</b></span></td><td class="yfnc_h" align="right">9.55</td><td class="yfnc_h" align="right">11.60</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">19</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530P00590000">AAPL140530P00590000</a></td><td class="yfnc_h" align="right"><b>11.90</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530p00590000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.45</b></span></td><td class="yfnc_h" align="right">11.30</td><td class="yfnc_h" align="right">11.70</td><td class="yfnc_h" align="right">37</td><td class="yfnc_h" align="right">285</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140530P00590000">AAPL7140530P00590000</a></td><td class="yfnc_h" align="right"><b>13.92</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140530p00590000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">3.92</b></span></td><td class="yfnc_h" align="right">11.05</td><td class="yfnc_h" align="right">13.85</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">22</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=592.500000"><strong>592.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00592500">AAPL140517P00592500</a></td><td class="yfnc_h" align="right"><b>9.35</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00592500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.10</b></span></td><td class="yfnc_h" align="right">9.10</td><td class="yfnc_h" align="right">9.35</td><td class="yfnc_h" align="right">368</td><td class="yfnc_h" align="right">633</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00595000">AAPL140517P00595000</a></td><td class="yfnc_h" align="right"><b>11.05</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00595000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.30</b></span></td><td class="yfnc_h" align="right">10.95</td><td class="yfnc_h" align="right">11.30</td><td class="yfnc_h" align="right">400</td><td class="yfnc_h" align="right">1,569</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517P00595000">AAPL7140517P00595000</a></td><td class="yfnc_h" align="right"><b>11.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517p00595000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">10.70</td><td class="yfnc_h" align="right">13.00</td><td class="yfnc_h" align="right">24</td><td class="yfnc_h" align="right">140</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523P00595000">AAPL140523P00595000</a></td><td class="yfnc_h" align="right"><b>13.35</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523p00595000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.18</b></span></td><td class="yfnc_h" align="right">12.95</td><td class="yfnc_h" align="right">13.25</td><td class="yfnc_h" align="right">353</td><td class="yfnc_h" align="right">477</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140523P00595000">AAPL7140523P00595000</a></td><td class="yfnc_h" align="right"><b>16.37</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140523p00595000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">4.72</b></span></td><td class="yfnc_h" align="right">12.75</td><td class="yfnc_h" align="right">15.40</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">8</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530P00595000">AAPL140530P00595000</a></td><td class="yfnc_h" align="right"><b>15.10</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530p00595000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">2.65</b></span></td><td class="yfnc_h" align="right">14.45</td><td class="yfnc_h" align="right">14.75</td><td class="yfnc_h" align="right">19</td><td class="yfnc_h" align="right">228</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140530P00595000">AAPL7140530P00595000</a></td><td class="yfnc_h" align="right"><b>17.57</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140530p00595000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">6.07</b></span></td><td class="yfnc_h" align="right">14.10</td><td class="yfnc_h" align="right">16.95</td><td class="yfnc_h" align="right">5</td><td class="yfnc_h" align="right">19</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=597.500000"><strong>597.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00597500">AAPL140517P00597500</a></td><td class="yfnc_h" align="right"><b>13.05</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00597500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.45</b></span></td><td class="yfnc_h" align="right">12.85</td><td class="yfnc_h" align="right">13.35</td><td class="yfnc_h" align="right">85</td><td class="yfnc_h" align="right">149</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=597.500000"><strong>597.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517P00597500">AAPL7140517P00597500</a></td><td class="yfnc_h" align="right"><b>9.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517p00597500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">12.00</td><td class="yfnc_h" align="right">14.90</td><td class="yfnc_h" align="right">18</td><td class="yfnc_h" align="right">18</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00600000">AAPL140517P00600000</a></td><td class="yfnc_h" align="right"><b>15.15</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00600000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.55</b></span></td><td class="yfnc_h" align="right">15.00</td><td class="yfnc_h" align="right">15.50</td><td class="yfnc_h" align="right">282</td><td class="yfnc_h" align="right">2,184</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517P00600000">AAPL7140517P00600000</a></td><td class="yfnc_h" align="right"><b>18.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517p00600000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">8.30</b></span></td><td class="yfnc_h" align="right">14.80</td><td class="yfnc_h" align="right">16.80</td><td class="yfnc_h" align="right">7</td><td class="yfnc_h" align="right">142</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523P00600000">AAPL140523P00600000</a></td><td class="yfnc_h" align="right"><b>17.10</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523p00600000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.75</b></span></td><td class="yfnc_h" align="right">16.55</td><td class="yfnc_h" align="right">17.00</td><td class="yfnc_h" align="right">92</td><td class="yfnc_h" align="right">262</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140523P00600000">AAPL7140523P00600000</a></td><td class="yfnc_h" align="right"><b>15.75</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140523p00600000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">16.15</td><td class="yfnc_h" align="right">19.10</td><td class="yfnc_h" align="right">5</td><td class="yfnc_h" align="right">8</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530P00600000">AAPL140530P00600000</a></td><td class="yfnc_h" align="right"><b>18.20</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530p00600000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">3.56</b></span></td><td class="yfnc_h" align="right">17.80</td><td class="yfnc_h" align="right">18.30</td><td class="yfnc_h" align="right">36</td><td class="yfnc_h" align="right">133</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140530P00600000">AAPL7140530P00600000</a></td><td class="yfnc_h" align="right"><b>20.03</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140530p00600000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">5.75</b></span></td><td class="yfnc_h" align="right">17.60</td><td class="yfnc_h" align="right">20.40</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">29</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=602.500000"><strong>602.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00602500">AAPL140517P00602500</a></td><td class="yfnc_h" align="right"><b>17.67</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00602500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">16.17</b></span></td><td class="yfnc_h" align="right">17.25</td><td class="yfnc_h" align="right">17.75</td><td class="yfnc_h" align="right">12</td><td class="yfnc_h" align="right">63</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=605.000000"><strong>605.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00605000">AAPL140517P00605000</a></td><td class="yfnc_h" align="right"><b>19.80</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00605000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.70</b></span></td><td class="yfnc_h" align="right">19.60</td><td class="yfnc_h" align="right">20.10</td><td class="yfnc_h" align="right">251</td><td class="yfnc_h" align="right">970</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=605.000000"><strong>605.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517P00605000">AAPL7140517P00605000</a></td><td class="yfnc_h" align="right"><b>15.40</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517p00605000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">18.50</td><td class="yfnc_h" align="right">22.15</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">66</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=605.000000"><strong>605.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523P00605000">AAPL140523P00605000</a></td><td class="yfnc_h" align="right"><b>21.10</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523p00605000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.90</b></span></td><td class="yfnc_h" align="right">20.65</td><td class="yfnc_h" align="right">21.15</td><td class="yfnc_h" align="right">305</td><td class="yfnc_h" align="right">198</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=605.000000"><strong>605.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530P00605000">AAPL140530P00605000</a></td><td class="yfnc_h" align="right"><b>23.31</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530p00605000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.31</b></span></td><td class="yfnc_h" align="right">21.85</td><td class="yfnc_h" align="right">22.75</td><td class="yfnc_h" align="right">31</td><td class="yfnc_h" align="right">64</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=607.500000"><strong>607.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00607500">AAPL140517P00607500</a></td><td class="yfnc_h" align="right"><b>21.90</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00607500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2,240.10</b></span></td><td class="yfnc_h" align="right">21.90</td><td class="yfnc_h" align="right">22.55</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">8</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=610.000000"><strong>610.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00610000">AAPL140517P00610000</a></td><td class="yfnc_h" align="right"><b>24.55</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00610000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.00</b></span></td><td class="yfnc_h" align="right">24.40</td><td class="yfnc_h" align="right">24.95</td><td class="yfnc_h" align="right">28</td><td class="yfnc_h" align="right">417</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=610.000000"><strong>610.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517P00610000">AAPL7140517P00610000</a></td><td class="yfnc_h" align="right"><b>16.04</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517p00610000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">22.90</td><td class="yfnc_h" align="right">26.95</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=610.000000"><strong>610.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523P00610000">AAPL140523P00610000</a></td><td class="yfnc_h" align="right"><b>26.30</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523p00610000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.80</b></span></td><td class="yfnc_h" align="right">25.10</td><td class="yfnc_h" align="right">26.40</td><td class="yfnc_h" align="right">23</td><td class="yfnc_h" align="right">134</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=610.000000"><strong>610.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530P00610000">AAPL140530P00610000</a></td><td class="yfnc_h" align="right"><b>30.14</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530p00610000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">5.21</b></span></td><td class="yfnc_h" align="right">25.90</td><td class="yfnc_h" align="right">27.10</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">132</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=612.500000"><strong>612.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00612500">AAPL140517P00612500</a></td><td class="yfnc_h" align="right"><b>22.20</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00612500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2,357.80</b></span></td><td class="yfnc_h" align="right">26.75</td><td class="yfnc_h" align="right">28.25</td><td class="yfnc_h" align="right">10</td><td class="yfnc_h" align="right">10</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=615.000000"><strong>615.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00615000">AAPL140517P00615000</a></td><td class="yfnc_h" align="right"><b>29.73</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00615000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.17</b></span></td><td class="yfnc_h" align="right">29.15</td><td class="yfnc_h" align="right">30.05</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">156</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=615.000000"><strong>615.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523P00615000">AAPL140523P00615000</a></td><td class="yfnc_h" align="right"><b>25.70</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523p00615000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">29.75</td><td class="yfnc_h" align="right">31.05</td><td class="yfnc_h" align="right">20</td><td class="yfnc_h" align="right">46</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=615.000000"><strong>615.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530P00615000">AAPL140530P00615000</a></td><td class="yfnc_h" align="right"><b>22.10</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530p00615000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">30.30</td><td class="yfnc_h" align="right">31.65</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">12</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=620.000000"><strong>620.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00620000">AAPL140517P00620000</a></td><td class="yfnc_h" align="right"><b>34.97</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00620000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.22</b></span></td><td class="yfnc_h" align="right">33.95</td><td class="yfnc_h" align="right">35.65</td><td class="yfnc_h" align="right">4</td><td class="yfnc_h" align="right">275</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=620.000000"><strong>620.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523P00620000">AAPL140523P00620000</a></td><td class="yfnc_h" align="right"><b>29.95</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523p00620000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">34.20</td><td class="yfnc_h" align="right">35.95</td><td class="yfnc_h" align="right">4</td><td class="yfnc_h" align="right">72</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=620.000000"><strong>620.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530P00620000">AAPL140530P00620000</a></td><td class="yfnc_h" align="right"><b>28.35</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530p00620000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">34.50</td><td class="yfnc_h" align="right">36.25</td><td class="yfnc_h" align="right">5</td><td class="yfnc_h" align="right">22</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=625.000000"><strong>625.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00625000">AAPL140517P00625000</a></td><td class="yfnc_h" align="right"><b>37.25</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00625000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">38.60</td><td class="yfnc_h" align="right">40.75</td><td class="yfnc_h" align="right">6</td><td class="yfnc_h" align="right">130</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=625.000000"><strong>625.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517P00625000">AAPL7140517P00625000</a></td><td class="yfnc_h" align="right"><b>33.80</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517p00625000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">37.40</td><td class="yfnc_h" align="right">41.40</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">3</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=625.000000"><strong>625.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523P00625000">AAPL140523P00625000</a></td><td class="yfnc_h" align="right"><b>32.20</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523p00625000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">39.00</td><td class="yfnc_h" align="right">40.80</td><td class="yfnc_h" align="right">28</td><td class="yfnc_h" align="right">32</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=625.000000"><strong>625.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530P00625000">AAPL140530P00625000</a></td><td class="yfnc_h" align="right"><b>38.85</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530p00625000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">39.45</td><td class="yfnc_h" align="right">41.10</td><td class="yfnc_h" align="right">510</td><td class="yfnc_h" align="right">10</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=630.000000"><strong>630.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00630000">AAPL140517P00630000</a></td><td class="yfnc_h" align="right"><b>43.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00630000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">43.20</td><td class="yfnc_h" align="right">45.70</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">246</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=630.000000"><strong>630.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523P00630000">AAPL140523P00630000</a></td><td class="yfnc_h" align="right"><b>38.30</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523p00630000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">44.05</td><td class="yfnc_h" align="right">45.75</td><td class="yfnc_h" align="right">8</td><td class="yfnc_h" align="right">12</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=630.000000"><strong>630.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530P00630000">AAPL140530P00630000</a></td><td class="yfnc_h" align="right"><b>41.30</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530p00630000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">43.75</td><td class="yfnc_h" align="right">45.90</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">4</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=635.000000"><strong>635.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00635000">AAPL140517P00635000</a></td><td class="yfnc_h" align="right"><b>35.20</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00635000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">48.20</td><td class="yfnc_h" align="right">50.65</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">240</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=635.000000"><strong>635.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517P00635000">AAPL7140517P00635000</a></td><td class="yfnc_h" align="right"><b>55.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517p00635000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">47.30</td><td class="yfnc_h" align="right">51.75</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=635.000000"><strong>635.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523P00635000">AAPL140523P00635000</a></td><td class="yfnc_h" align="right"><b>44.20</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523p00635000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">48.45</td><td class="yfnc_h" align="right">50.75</td><td class="yfnc_h" align="right">6</td><td class="yfnc_h" align="right">6</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=635.000000"><strong>635.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530P00635000">AAPL140530P00635000</a></td><td class="yfnc_h" align="right"><b>46.10</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530p00635000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">48.80</td><td class="yfnc_h" align="right">50.80</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">13</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=640.000000"><strong>640.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00640000">AAPL140517P00640000</a></td><td class="yfnc_h" align="right"><b>50.90</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00640000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">53.15</td><td class="yfnc_h" align="right">55.65</td><td class="yfnc_h" align="right">40</td><td class="yfnc_h" align="right">35</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=640.000000"><strong>640.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517P00640000">AAPL7140517P00640000</a></td><td class="yfnc_h" align="right"><b>102.30</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517p00640000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">52.60</td><td class="yfnc_h" align="right">56.70</td><td class="yfnc_h" align="right">32</td><td class="yfnc_h" align="right">42</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=640.000000"><strong>640.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523P00640000">AAPL140523P00640000</a></td><td class="yfnc_h" align="right"><b>43.95</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523p00640000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">53.65</td><td class="yfnc_h" align="right">55.80</td><td class="yfnc_h" align="right">6</td><td class="yfnc_h" align="right">12</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=640.000000"><strong>640.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530P00640000">AAPL140530P00640000</a></td><td class="yfnc_h" align="right"><b>47.60</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530p00640000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">53.70</td><td class="yfnc_h" align="right">55.75</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">2</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=645.000000"><strong>645.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00645000">AAPL140517P00645000</a></td><td class="yfnc_h" align="right"><b>65.37</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00645000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">58.50</td><td class="yfnc_h" align="right">60.65</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">13</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=645.000000"><strong>645.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140523P00645000">AAPL140523P00645000</a></td><td class="yfnc_h" align="right"><b>45.78</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140523p00645000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">58.65</td><td class="yfnc_h" align="right">60.65</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=645.000000"><strong>645.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530P00645000">AAPL140530P00645000</a></td><td class="yfnc_h" align="right"><b>51.40</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530p00645000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">59.00</td><td class="yfnc_h" align="right">60.70</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">2</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=650.000000"><strong>650.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00650000">AAPL140517P00650000</a></td><td class="yfnc_h" align="right"><b>64.52</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00650000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">2.52</b></span></td><td class="yfnc_h" align="right">64.00</td><td class="yfnc_h" align="right">65.65</td><td class="yfnc_h" align="right">500</td><td class="yfnc_h" align="right">4,292</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=650.000000"><strong>650.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517P00650000">AAPL7140517P00650000</a></td><td class="yfnc_h" align="right"><b>62.90</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517p00650000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">62.35</td><td class="yfnc_h" align="right">66.70</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">2</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=650.000000"><strong>650.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140530P00650000">AAPL140530P00650000</a></td><td class="yfnc_h" align="right"><b>65.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140530p00650000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">63.70</td><td class="yfnc_h" align="right">65.75</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">2</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=655.000000"><strong>655.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00655000">AAPL140517P00655000</a></td><td class="yfnc_h" align="right"><b>68.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00655000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">68.15</td><td class="yfnc_h" align="right">70.65</td><td class="yfnc_h" align="right">24</td><td class="yfnc_h" align="right">45</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=655.000000"><strong>655.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140517P00655000">AAPL7140517P00655000</a></td><td class="yfnc_h" align="right"><b>65.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140517p00655000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">67.40</td><td class="yfnc_h" align="right">71.80</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">13</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=660.000000"><strong>660.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00660000">AAPL140517P00660000</a></td><td class="yfnc_h" align="right"><b>71.75</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00660000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">73.55</td><td class="yfnc_h" align="right">75.65</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">4</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=675.000000"><strong>675.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00675000">AAPL140517P00675000</a></td><td class="yfnc_h" align="right"><b>88.35</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00675000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">88.55</td><td class="yfnc_h" align="right">90.85</td><td class="yfnc_h" align="right">65</td><td class="yfnc_h" align="right">66</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=680.000000"><strong>680.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00680000">AAPL140517P00680000</a></td><td class="yfnc_h" align="right"><b>92.40</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00680000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">93.90</td><td class="yfnc_h" align="right">95.80</td><td class="yfnc_h" align="right">1,850</td><td class="yfnc_h" align="right">600</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=695.000000"><strong>695.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00695000">AAPL140517P00695000</a></td><td class="yfnc_h" align="right"><b>107.45</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00695000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">108.60</td><td class="yfnc_h" align="right">110.65</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">2</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=700.000000"><strong>700.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00700000">AAPL140517P00700000</a></td><td class="yfnc_h" align="right"><b>118.53</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00700000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">8.38</b></span></td><td class="yfnc_h" align="right">113.15</td><td class="yfnc_h" align="right">115.65</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">160</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=710.000000"><strong>710.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00710000">AAPL140517P00710000</a></td><td class="yfnc_h" align="right"><b>190.57</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00710000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">123.65</td><td class="yfnc_h" align="right">125.65</td><td class="yfnc_h" align="right">0</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=715.000000"><strong>715.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00715000">AAPL140517P00715000</a></td><td class="yfnc_h" align="right"><b>133.46</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00715000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">49.24</b></span></td><td class="yfnc_h" align="right">128.60</td><td class="yfnc_h" align="right">130.65</td><td class="yfnc_h" align="right">7</td><td class="yfnc_h" align="right">8</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=720.000000"><strong>720.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00720000">AAPL140517P00720000</a></td><td class="yfnc_h" align="right"><b>157.25</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00720000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">133.60</td><td class="yfnc_h" align="right">135.65</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">15</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=725.000000"><strong>725.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00725000">AAPL140517P00725000</a></td><td class="yfnc_h" align="right"><b>204.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00725000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">138.65</td><td class="yfnc_h" align="right">140.65</td><td class="yfnc_h" align="right">8</td><td class="yfnc_h" align="right">7</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=740.000000"><strong>740.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00740000">AAPL140517P00740000</a></td><td class="yfnc_h" align="right"><b>152.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00740000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">153.60</td><td class="yfnc_h" align="right">155.65</td><td class="yfnc_h" align="right">133</td><td class="yfnc_h" align="right">133</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=750.000000"><strong>750.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00750000">AAPL140517P00750000</a></td><td class="yfnc_h" align="right"><b>164.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00750000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">21.15</b></span></td><td class="yfnc_h" align="right">163.65</td><td class="yfnc_h" align="right">165.65</td><td class="yfnc_h" align="right">5</td><td class="yfnc_h" align="right">5</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=780.000000"><strong>780.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00780000">AAPL140517P00780000</a></td><td class="yfnc_h" align="right"><b>189.60</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00780000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">193.65</td><td class="yfnc_h" align="right">195.75</td><td class="yfnc_h" align="right">22</td><td class="yfnc_h" align="right">22</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=790.000000"><strong>790.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00790000">AAPL140517P00790000</a></td><td class="yfnc_h" align="right"><b>199.37</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00790000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">203.80</td><td class="yfnc_h" align="right">205.65</td><td class="yfnc_h" align="right">33</td><td class="yfnc_h" align="right">33</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=800.000000"><strong>800.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00800000">AAPL140517P00800000</a></td><td class="yfnc_h" align="right"><b>208.26</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00800000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">213.60</td><td class="yfnc_h" align="right">215.70</td><td class="yfnc_h" align="right">121</td><td class="yfnc_h" align="right">121</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=805.000000"><strong>805.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140517P00805000">AAPL140517P00805000</a></td><td class="yfnc_h" align="right"><b>217.30</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140517p00805000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">218.55</td><td class="yfnc_h" align="right">220.75</td><td class="yfnc_h" align="right">34</td><td class="yfnc_h" align="right">34</td></tr></table></td></tr></table><table border="0" cellpadding="2" cellspacing="0"><tr><td width="1%"><table border="0" cellpadding="1" cellspacing="0" width="10" class="yfnc_d"><tr><td><table border="0" cellpadding="1" cellspacing="0" width="100%"><tr><td class="yfnc_h"> </td></tr></table></td></tr></table></td><td><small>Highlighted options are in-the-money.</small></td></tr></table><p style="text-align:center"><a href="/q/os?s=AAPL&m=2014-05-30"><strong>Expand to Straddle View...</strong></a></p><p class="yfi_disclaimer">Currency in USD.</p></td><td width="15"></td><td width="1%" class="skycell"><!--ADS:LOCATION=SKY--><div style="min-height:620px; _height:620px; width:160px;margin:0pt auto;"><iframe src="https://ca.adserver.yahoo.com/a?f=1184585072&p=cafinance&l=SKY&c=h&at=content%3d'no_expandable'&site-country=us&rs=guid:lYcqyjIwNi6yRhsmUpTyoQOwMTA4LlNv9GP__xMA;spid:28951412;ypos:SKY;ypos:1399845989.434817" width=160 height=600 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no></iframe><!--http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3NWZwNTZqcChnaWQkbFljcXlqSXdOaTZ5UmhzbVVwVHlvUU93TVRBNExsTnY5R1BfX3hNQSxzdCQxMzk5ODQ1OTg5MzYyOTU2LHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkMzc4NTU0NjU1MSx2JDIuMCxhaWQkWHVVTWZHS0xjNkUtLGN0JDI1LHlieCRhdjhyZklraWRLU2FCa1hGLnVub3RRLGJpJDE5NzM0NTc1NTEsbW1lJDgzMDE3MzE3Njg0Njg3ODgzNjMsciQwLHlvbyQxLGFncCQyOTg4MjIxMDUxLGFwJFNLWSkp/0/*--><!--QYZ 1973457551,3785546551,98.139.115.226;;SKY;28951412;1;--><script language=javascript>
+if(window.xzq_d==null)window.xzq_d=new Object();
+window.xzq_d['XuUMfGKLc6E-']='(as$12r99la27,aid$XuUMfGKLc6E-,bi$1973457551,cr$3785546551,ct$25,at$H,eob$gd1_match_id=-1:ypos=SKY)';
+</script><noscript><img width=1 height=1 alt="" src="http://csc.beap.bc.yahoo.com/yi?bv=1.0.0&bs=(134q4e8mq(gid$lYcqyjIwNi6yRhsmUpTyoQOwMTA4LlNv9GP__xMA,st$1399845989362956,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3&al=(as$12r99la27,aid$XuUMfGKLc6E-,bi$1973457551,cr$3785546551,ct$25,at$H,eob$gd1_match_id=-1:ypos=SKY)"></noscript></div></td></tr></table> <div id="yfi_media_net" style="width:475px;height:200px;"></div><script id="mNCC" type="text/javascript">
+ medianet_width='475';
+ medianet_height= '200';
+ medianet_crid='625102783';
+ medianet_divid = 'yfi_media_net';
+ </script><script type="text/javascript">
+ ll_js.push({
+ 'file':'//mycdn.media.net/dmedianet.js?cid=8CUJ144F7'
+ });
+ </script></div> <div class="yfi_ad_s"></div></div><div class="footer_copyright"><div class="yfi_doc"><div id="footer" style="clear:both;width:100% !important;border:none;"><hr noshade size="1"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td class="footer_legal"><!--ADS:LOCATION=FOOT--><!-- APT Vendor: Yahoo, Format: Standard Graphical -->
+<font size=-2 face=arial><a href=http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3a21qZXRybihnaWQkbFljcXlqSXdOaTZ5UmhzbVVwVHlvUU93TVRBNExsTnY5R1BfX3hNQSxzdCQxMzk5ODQ1OTg5MzYyOTU2LHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkMzI3OTQxNjA1MSx2JDIuMCxhaWQkZUlNTmZHS0xjNkUtLGN0JDI1LHlieCRhdjhyZklraWRLU2FCa1hGLnVub3RRLGJpJDE2OTY2NDcwNTEsbW1lJDcxMjU1ODUwMzkyMjkyODQ2NDMsciQwLHJkJDEwb3Nnc2owdSx5b28kMSxhZ3AkMjQ2MzU0NzA1MSxhcCRGT09UQykp/0/*http://privacy.yahoo.com>Privacy</a> - <a href="http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3a2w0N25yYihnaWQkbFljcXlqSXdOaTZ5UmhzbVVwVHlvUU93TVRBNExsTnY5R1BfX3hNQSxzdCQxMzk5ODQ1OTg5MzYyOTU2LHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkMzI3OTQxNjA1MSx2JDIuMCxhaWQkZUlNTmZHS0xjNkUtLGN0JDI1LHlieCRhdjhyZklraWRLU2FCa1hGLnVub3RRLGJpJDE2OTY2NDcwNTEsbW1lJDcxMjU1ODUwMzkyMjkyODQ2NDMsciQxLHJkJDExMnNqN2FzZyx5b28kMSxhZ3AkMjQ2MzU0NzA1MSxhcCRGT09UQykp/0/*http://info.yahoo.com/relevantads/">About Our Ads</a> - <a href=http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3a2p0cWI1cihnaWQkbFljcXlqSXdOaTZ5UmhzbVVwVHlvUU93TVRBNExsTnY5R1BfX3hNQSxzdCQxMzk5ODQ1OTg5MzYyOTU2LHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkMzI3OTQxNjA1MSx2JDIuMCxhaWQkZUlNTmZHS0xjNkUtLGN0JDI1LHlieCRhdjhyZklraWRLU2FCa1hGLnVub3RRLGJpJDE2OTY2NDcwNTEsbW1lJDcxMjU1ODUwMzkyMjkyODQ2NDMsciQyLHJkJDExMThwcjR0OCx5b28kMSxhZ3AkMjQ2MzU0NzA1MSxhcCRGT09UQykp/0/*http://docs.yahoo.com/info/terms/>Terms</a> - <a href=http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3azNyOGNpMShnaWQkbFljcXlqSXdOaTZ5UmhzbVVwVHlvUU93TVRBNExsTnY5R1BfX3hNQSxzdCQxMzk5ODQ1OTg5MzYyOTU2LHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkMzI3OTQxNjA1MSx2JDIuMCxhaWQkZUlNTmZHS0xjNkUtLGN0JDI1LHlieCRhdjhyZklraWRLU2FCa1hGLnVub3RRLGJpJDE2OTY2NDcwNTEsbW1lJDcxMjU1ODUwMzkyMjkyODQ2NDMsciQzLHJkJDEybnU1aTVocCx5b28kMSxhZ3AkMjQ2MzU0NzA1MSxhcCRGT09UQykp/0/*http://feedback.help.yahoo.com/feedback.php?.src=FINANCE&.done=http://finance.yahoo.com>Send Feedback</a> - <font size=-1>Yahoo! - ABC News Network</font></font><!--QYZ 1696647051,3279416051,98.139.115.226;;FOOTC;28951412;1;--><script language=javascript>
+if(window.xzq_d==null)window.xzq_d=new Object();
+window.xzq_d['eIMNfGKLc6E-']='(as$12r40vh16,aid$eIMNfGKLc6E-,bi$1696647051,cr$3279416051,ct$25,at$H,eob$gd1_match_id=-1:ypos=PP.FOOT-FOOTC)';
+</script><noscript><img width=1 height=1 alt="" src="http://csc.beap.bc.yahoo.com/yi?bv=1.0.0&bs=(134q4e8mq(gid$lYcqyjIwNi6yRhsmUpTyoQOwMTA4LlNv9GP__xMA,st$1399845989362956,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3&al=(as$12r40vh16,aid$eIMNfGKLc6E-,bi$1696647051,cr$3279416051,ct$25,at$H,eob$gd1_match_id=-1:ypos=PP.FOOT-FOOTC)"></noscript><!-- SpaceID=28951412 loc=FSRVY noad --><!-- fac-gd2-noad --><!-- gd2-status-2 --><!--QYZ CMS_NONE_SELECTED,,98.139.115.226;;FSRVY;28951412;2;--><script language=javascript>
+if(window.xzq_d==null)window.xzq_d=new Object();
+window.xzq_d['DpoNfGKLc6E-']='(as$1253t4cmh,aid$DpoNfGKLc6E-,cr$-1,ct$25,at$H,eob$gd1_match_id=-1:ypos=FSRVY)';
+</script><noscript><img width=1 height=1 alt="" src="http://csc.beap.bc.yahoo.com/yi?bv=1.0.0&bs=(134q4e8mq(gid$lYcqyjIwNi6yRhsmUpTyoQOwMTA4LlNv9GP__xMA,st$1399845989362956,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3&al=(as$1253t4cmh,aid$DpoNfGKLc6E-,cr$-1,ct$25,at$H,eob$gd1_match_id=-1:ypos=FSRVY)"></noscript><!-- APT Vendor: Right Media, Format: Standard Graphical -->
+<!-- BEGIN STANDARD TAG - 1 x 1 - SIP #272 Y! C1 SIP - Mail Apt: SIP #272 Y! C1 SIP - Mail Apt - DO NOT MODIFY --> <IFRAME FRAMEBORDER=0 MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=NO WIDTH=1 HEIGHT=1 SRC="https://ads.yahoo.com/st?ad_type=iframe&ad_size=1x1§ion=2916325"></IFRAME>
+<!-- END TAG -->
+<!-- http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3NWk1NXIyaShnaWQkbFljcXlqSXdOaTZ5UmhzbVVwVHlvUU93TVRBNExsTnY5R1BfX3hNQSxzdCQxMzk5ODQ1OTg5MzYyOTU2LHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkMzk4MDY4OTA1MSx2JDIuMCxhaWQkcExBTmZHS0xjNkUtLGN0JDI1LHlieCRhdjhyZklraWRLU2FCa1hGLnVub3RRLGJpJDIwNzkxMzQwNTEsbW1lJDg3NTkyNzI0ODcwMjg0MTMwMzYsciQwLHlvbyQxLGFncCQzMTY2OTY1NTUxLGFwJFNJUCkp/0/* --><!--QYZ 2079134051,3980689051,98.139.115.226;;SIP;28951412;1;--><script language=javascript>
+if(window.xzq_d==null)window.xzq_d=new Object();
+window.xzq_d['pLANfGKLc6E-']='(as$12r49avj5,aid$pLANfGKLc6E-,bi$2079134051,cr$3980689051,ct$25,at$H,eob$gd1_match_id=-1:ypos=SIP)';
+</script><noscript><img width=1 height=1 alt="" src="http://csc.beap.bc.yahoo.com/yi?bv=1.0.0&bs=(134q4e8mq(gid$lYcqyjIwNi6yRhsmUpTyoQOwMTA4LlNv9GP__xMA,st$1399845989362956,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3&al=(as$12r49avj5,aid$pLANfGKLc6E-,bi$2079134051,cr$3980689051,ct$25,at$H,eob$gd1_match_id=-1:ypos=SIP)"></noscript><!-- SpaceID=28951412 loc=FOOT2 noad --><!-- fac-gd2-noad --><!-- gd2-status-2 --><!--QYZ CMS_NONE_AVAIL,,98.139.115.226;;FOOT2;28951412;2;--><script language=javascript>
+if(window.xzq_d==null)window.xzq_d=new Object();
+window.xzq_d['OscNfGKLc6E-']='(as$1253lc569,aid$OscNfGKLc6E-,cr$-1,ct$25,at$H,eob$gd1_match_id=-1:ypos=FOOT2)';
+</script><noscript><img width=1 height=1 alt="" src="http://csc.beap.bc.yahoo.com/yi?bv=1.0.0&bs=(134q4e8mq(gid$lYcqyjIwNi6yRhsmUpTyoQOwMTA4LlNv9GP__xMA,st$1399845989362956,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3&al=(as$1253lc569,aid$OscNfGKLc6E-,cr$-1,ct$25,at$H,eob$gd1_match_id=-1:ypos=FOOT2)"></noscript></td></tr><tr><td><div class="footer_legal"></div><div class="footer_disclaimer"><p>Quotes are <strong>real-time</strong> for NASDAQ, NYSE, and NYSE MKT. See also delay times for <a href="http://help.yahoo.com/l/us/yahoo/finance/quotes/fitadelay.html">other exchanges</a>. All information provided "as is" for informational purposes only, not intended for trading purposes or advice. Neither Yahoo! nor any of independent providers is liable for any informational errors, incompleteness, or delays, or for any actions taken in reliance on information contained herein. By accessing the Yahoo! site, you agree not to redistribute the information found therein.</p><p>Fundamental company data provided by <a href="http://www.capitaliq.com">Capital IQ</a>. Historical chart data and daily updates provided by <a href="http://www.csidata.com">Commodity Systems, Inc. (CSI)</a>. International historical chart data, daily updates, fund summary, fund performance, dividend data and Morningstar Index data provided by <a href="http://www.morningstar.com/">Morningstar, Inc.</a></p></div></td></tr></table></div></div></div><!-- SpaceID=28951412 loc=UMU noad --><!-- fac-gd2-noad --><!-- gd2-status-2 --><!--QYZ CMS_NONE_AVAIL,,98.139.115.226;;UMU;28951412;2;--><script language=javascript>
+if(window.xzq_d==null)window.xzq_d=new Object();
+window.xzq_d['4mwNfGKLc6E-']='(as$125kf7q5q,aid$4mwNfGKLc6E-,cr$-1,ct$25,at$H,eob$gd1_match_id=-1:ypos=UMU)';
+</script><noscript><img width=1 height=1 alt="" src="http://csc.beap.bc.yahoo.com/yi?bv=1.0.0&bs=(134q4e8mq(gid$lYcqyjIwNi6yRhsmUpTyoQOwMTA4LlNv9GP__xMA,st$1399845989362956,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3&al=(as$125kf7q5q,aid$4mwNfGKLc6E-,cr$-1,ct$25,at$H,eob$gd1_match_id=-1:ypos=UMU)"></noscript><script type="text/javascript">
+ ( function() {
+ var nav = document.getElementById("yfi_investing_nav");
+ if (nav) {
+ var content = document.getElementById("rightcol");
+ if ( content && nav.offsetHeight < content.offsetHeight) {
+ nav.style.height = content.offsetHeight + "px";
+ }
+ }
+ }());
+ </script><div id="spaceid" style="display:none;">28951412</div><script type="text/javascript">
+ if(typeof YAHOO == "undefined"){YAHOO={};}
+ if(typeof YAHOO.Finance == "undefined"){YAHOO.Finance={};}
+ if(typeof YAHOO.Finance.SymbolSuggestConfig == "undefined"){YAHOO.Finance.SymbolSuggestConfig=[];}
+
+ YAHOO.Finance.SymbolSuggestConfig.push({
+ dsServer:'http://d.yimg.com/aq/autoc',
+ dsRegion:'US',
+ dsLang:'en-US',
+ dsFooter:'<div class="moreresults"><a class="[[tickdquote]]" href="http://finance.yahoo.com/lookup?s=[[link]]">Show all results for [[tickdquote]]</a></div><div class="tip"><em>Tip:</em> Use comma (,) to separate multiple quotes. <a href="http://help.yahoo.com/l/us/yahoo/finance/quotes/quotelookup.html">Learn more...</a></div>',
+ acInputId:'pageTicker',
+ acInputFormId:'quote2',
+ acContainerId:'quote2Container',
+ acModId:'optionsget',
+ acInputFocus:'0'
+ });
+ </script></body><div id="spaceid" style="display:none;">28951412</div><script type="text/javascript">
+ if(typeof YAHOO == "undefined"){YAHOO={};}
+ if(typeof YAHOO.Finance == "undefined"){YAHOO.Finance={};}
+ if(typeof YAHOO.Finance.SymbolSuggestConfig == "undefined"){YAHOO.Finance.SymbolSuggestConfig=[];}
+
+ YAHOO.Finance.SymbolSuggestConfig.push({
+ dsServer:'http://d.yimg.com/aq/autoc',
+ dsRegion:'US',
+ dsLang:'en-US',
+ dsFooter:'<div class="moreresults"><a class="[[tickdquote]]" href="http://finance.yahoo.com/lookup?s=[[link]]">Show all results for [[tickdquote]]</a></div><div class="tip"><em>Tip:</em> Use comma (,) to separate multiple quotes. <a href="http://help.yahoo.com/l/us/yahoo/finance/quotes/quotelookup.html">Learn more...</a></div>',
+ acInputId:'txtQuotes',
+ acInputFormId:'quote',
+ acContainerId:'quoteContainer',
+ acModId:'mediaquotessearch',
+ acInputFocus:'0'
+ });
+ </script><script src="http://l.yimg.com/zz/combo?os/mit/td/stencil-0.1.150/stencil/stencil-min.js&os/mit/td/mjata-0.4.2/mjata-util/mjata-util-min.js&os/mit/td/stencil-0.1.150/stencil-source/stencil-source-min.js&os/mit/td/stencil-0.1.150/stencil-tooltip/stencil-tooltip-min.js"></script><script type="text/javascript" src="http://l1.yimg.com/bm/combo?fi/common/p/d/static/js/2.0.333292/2.0.0/mini/ylc_1.9.js&fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yfi_loader.js&fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yfi_symbol_suggest.js&fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yfi_init_symbol_suggest.js&fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yfi_nav_topnav_init.js&fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yfi_nav_topnav.js&fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yfi_nav_portfolio.js&fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yfi_fb2_expandables.js&fi/common/p/d/static/js/2.0.333292/yui_2.8.0/build/get/2.0.0/mini/get.js&fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yfi_lazy_load.js&fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yfs_concat.js&fi/common/p/d/static/js/2.0.333292/translations/2.0.0/mini/yfs_l10n_en-US.js&fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yfi_related_videos.js&fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yfi_follow_quote.js"></script><span id="yfs_params_vcr" style="display:none">{"yrb_token" : "YFT_MARKET_CLOSED", "tt" : "1399845989", "s" : "aapl", "k" : "a00,a50,b00,b60,c10,c63,c64,c85,c86,g00,g53,h00,h53,l10,l84,l85,l86,p20,p43,p44,t10,t53,t54,v00,v53", "o" : "aapl140517c00280000,aapl140517c00285000,aapl140517c00290000,aapl140517c00295000,aapl140517c00300000,aapl140517c00305000,aapl140517c00310000,aapl140517c00315000,aapl140517c00320000,aapl140517c00325000,aapl140517c00330000,aapl140517c00335000,aapl140517c00340000,aapl140517c00345000,aapl140517c00350000,aapl140517c00355000,aapl140517c00360000,aapl140517c00365000,aapl140517c00370000,aapl140517c00375000,aapl140517c00380000,aapl140517c00385000,aapl140517c00390000,aapl140517c00395000,aapl140517c00400000,aapl140517c00405000,aapl140517c00410000,aapl140517c00415000,aapl140517c00420000,aapl140517c00425000,aapl140517c00430000,aapl140517c00435000,aapl140517c00440000,aapl140517c00445000,aapl140517c00450000,aapl140517c00455000,aapl140517c00460000,aapl140517c00465000,aapl140517c00470000,aapl140517c00475000,aapl140517c00480000,aapl140517c00485000,aapl140517c00490000,aapl140517c00495000,aapl140517c00500000,aapl140517c00505000,aapl140517c00510000,aapl140517c00515000,aapl140517c00520000,aapl140517c00525000,aapl140517c00530000,aapl140517c00535000,aapl140517c00540000,aapl140517c00545000,aapl140517c00550000,aapl140517c00555000,aapl140517c00557500,aapl140517c00560000,aapl140517c00562500,aapl140517c00565000,aapl140517c00567500,aapl140517c00570000,aapl140517c00572500,aapl140517c00575000,aapl140517c00577500,aapl140517c00580000,aapl140517c00582500,aapl140517c00585000,aapl140517c00587500,aapl140517c00590000,aapl140517c00592500,aapl140517c00595000,aapl140517c00597500,aapl140517c00600000,aapl140517c00602500,aapl140517c00605000,aapl140517c00607500,aapl140517c00610000,aapl140517c00612500,aapl140517c00615000,aapl140517c00617500,aapl140517c00620000,aapl140517c00622500,aapl140517c00625000,aapl140517c00627500,aapl140517c00630000,aapl140517c00635000,aapl140517c00640000,aapl140517c00645000,aapl140517c00650000,aapl140517c00655000,aapl140517c00660000,aapl140517c00665000,aapl140517c00670000,aapl140517c00675000,aapl140517c00680000,aapl140517c00685000,aapl140517c00690000,aapl140517c00695000,aapl140517c00700000,aapl140517c00705000,aapl140517c00710000,aapl140517c00715000,aapl140517c00720000,aapl140517c00725000,aapl140517c00730000,aapl140517c00735000,aapl140517c00740000,aapl140517c00745000,aapl140517c00750000,aapl140517c00755000,aapl140517c00760000,aapl140517c00765000,aapl140517c00770000,aapl140517c00775000,aapl140517c00780000,aapl140517c00785000,aapl140517c00790000,aapl140517c00795000,aapl140517c00800000,aapl140517c00805000,aapl140517p00280000,aapl140517p00285000,aapl140517p00290000,aapl140517p00295000,aapl140517p00300000,aapl140517p00305000,aapl140517p00310000,aapl140517p00315000,aapl140517p00320000,aapl140517p00325000,aapl140517p00330000,aapl140517p00335000,aapl140517p00340000,aapl140517p00345000,aapl140517p00350000,aapl140517p00355000,aapl140517p00360000,aapl140517p00365000,aapl140517p00370000,aapl140517p00375000,aapl140517p00380000,aapl140517p00385000,aapl140517p00390000,aapl140517p00395000,aapl140517p00400000,aapl140517p00405000,aapl140517p00410000,aapl140517p00415000,aapl140517p00420000,aapl140517p00425000,aapl140517p00430000,aapl140517p00435000,aapl140517p00440000,aapl140517p00445000,aapl140517p00450000,aapl140517p00455000,aapl140517p00460000,aapl140517p00465000,aapl140517p00470000,aapl140517p00475000,aapl140517p00480000,aapl140517p00485000,aapl140517p00490000,aapl140517p00495000,aapl140517p00500000,aapl140517p00505000,aapl140517p00510000,aapl140517p00515000,aapl140517p00520000,aapl140517p00525000,aapl140517p00530000,aapl140517p00535000,aapl140517p00540000,aapl140517p00545000,aapl140517p00550000,aapl140517p00555000,aapl140517p00557500,aapl140517p00560000,aapl140517p00562500,aapl140517p00565000,aapl140517p00567500,aapl140517p00570000,aapl140517p00572500,aapl140517p00575000,aapl140517p00577500,aapl140517p00580000,aapl140517p00582500,aapl140517p00585000,aapl140517p00587500,aapl140517p00590000,aapl140517p00592500,aapl140517p00595000,aapl140517p00597500,aapl140517p00600000,aapl140517p00602500,aapl140517p00605000,aapl140517p00607500,aapl140517p00610000,aapl140517p00612500,aapl140517p00615000,aapl140517p00617500,aapl140517p00620000,aapl140517p00622500,aapl140517p00625000,aapl140517p00627500,aapl140517p00630000,aapl140517p00635000,aapl140517p00640000,aapl140517p00645000,aapl140517p00650000,aapl140517p00655000,aapl140517p00660000,aapl140517p00665000,aapl140517p00670000,aapl140517p00675000,aapl140517p00680000,aapl140517p00685000,aapl140517p00690000,aapl140517p00695000,aapl140517p00700000,aapl140517p00705000,aapl140517p00710000,aapl140517p00715000,aapl140517p00720000,aapl140517p00725000,aapl140517p00730000,aapl140517p00735000,aapl140517p00740000,aapl140517p00745000,aapl140517p00750000,aapl140517p00755000,aapl140517p00760000,aapl140517p00765000,aapl140517p00770000,aapl140517p00775000,aapl140517p00780000,aapl140517p00785000,aapl140517p00790000,aapl140517p00795000,aapl140517p00800000,aapl140517p00805000,aapl140523c00470000,aapl140523c00475000,aapl140523c00480000,aapl140523c00485000,aapl140523c00490000,aapl140523c00495000,aapl140523c00500000,aapl140523c00502500,aapl140523c00505000,aapl140523c00507500,aapl140523c00510000,aapl140523c00512500,aapl140523c00515000,aapl140523c00517500,aapl140523c00520000,aapl140523c00522500,aapl140523c00525000,aapl140523c00527500,aapl140523c00530000,aapl140523c00532500,aapl140523c00535000,aapl140523c00537500,aapl140523c00540000,aapl140523c00542500,aapl140523c00545000,aapl140523c00547500,aapl140523c00550000,aapl140523c00552500,aapl140523c00555000,aapl140523c00557500,aapl140523c00560000,aapl140523c00562500,aapl140523c00565000,aapl140523c00567500,aapl140523c00570000,aapl140523c00572500,aapl140523c00575000,aapl140523c00577500,aapl140523c00580000,aapl140523c00582500,aapl140523c00585000,aapl140523c00587500,aapl140523c00590000,aapl140523c00595000,aapl140523c00600000,aapl140523c00605000,aapl140523c00610000,aapl140523c00615000,aapl140523c00620000,aapl140523c00625000,aapl140523c00630000,aapl140523c00635000,aapl140523c00640000,aapl140523c00645000,aapl140523c00650000,aapl140523c00655000,aapl140523c00660000,aapl140523c00665000,aapl140523c00670000,aapl140523c00675000,aapl140523c00680000,aapl140523c00685000,aapl140523c00690000,aapl140523c00695000,aapl140523c00700000,aapl140523c00710000,aapl140523p00470000,aapl140523p00475000,aapl140523p00480000,aapl140523p00485000,aapl140523p00490000,aapl140523p00495000,aapl140523p00500000,aapl140523p00502500,aapl140523p00505000,aapl140523p00507500,aapl140523p00510000,aapl140523p00512500,aapl140523p00515000,aapl140523p00517500,aapl140523p00520000,aapl140523p00522500,aapl140523p00525000,aapl140523p00527500,aapl140523p00530000,aapl140523p00532500,aapl140523p00535000,aapl140523p00537500,aapl140523p00540000,aapl140523p00542500,aapl140523p00545000,aapl140523p00547500,aapl140523p00550000,aapl140523p00552500,aapl140523p00555000,aapl140523p00557500,aapl140523p00560000,aapl140523p00562500,aapl140523p00565000,aapl140523p00567500,aapl140523p00570000,aapl140523p00572500,aapl140523p00575000,aapl140523p00577500,aapl140523p00580000,aapl140523p00582500,aapl140523p00585000,aapl140523p00587500,aapl140523p00590000,aapl140523p00595000,aapl140523p00600000,aapl140523p00605000,aapl140523p00610000,aapl140523p00615000,aapl140523p00620000,aapl140523p00625000,aapl140523p00630000,aapl140523p00635000,aapl140523p00640000,aapl140523p00645000,aapl140523p00650000,aapl140523p00655000,aapl140523p00660000,aapl140523p00665000,aapl140523p00670000,aapl140523p00675000,aapl140523p00680000,aapl140523p00685000,aapl140523p00690000,aapl140523p00695000,aapl140523p00700000,aapl140523p00710000,aapl140530c00475000,aapl140530c00480000,aapl140530c00485000,aapl140530c00490000,aapl140530c00492500,aapl140530c00495000,aapl140530c00497500,aapl140530c00500000,aapl140530c00502500,aapl140530c00505000,aapl140530c00507500,aapl140530c00510000,aapl140530c00512500,aapl140530c00515000,aapl140530c00517500,aapl140530c00520000,aapl140530c00522500,aapl140530c00525000,aapl140530c00527500,aapl140530c00530000,aapl140530c00532500,aapl140530c00535000,aapl140530c00537500,aapl140530c00540000,aapl140530c00542500,aapl140530c00545000,aapl140530c00547500,aapl140530c00550000,aapl140530c00552500,aapl140530c00555000,aapl140530c00557500,aapl140530c00560000,aapl140530c00562500,aapl140530c00565000,aapl140530c00567500,aapl140530c00570000,aapl140530c00572500,aapl140530c00575000,aapl140530c00580000,aapl140530c00585000,aapl140530c00587500,aapl140530c00590000,aapl140530c00595000,aapl140530c00600000,aapl140530c00605000,aapl140530c00610000,aapl140530c00615000,aapl140530c00620000,aapl140530c00625000,aapl140530c00630000,aapl140530c00635000,aapl140530c00640000,aapl140530c00645000,aapl140530c00650000,aapl140530c00655000,aapl140530c00660000,aapl140530c00665000,aapl140530c00670000,aapl140530c00675000,aapl140530c00680000,aapl140530c00685000,aapl140530p00475000,aapl140530p00480000,aapl140530p00485000,aapl140530p00490000,aapl140530p00492500,aapl140530p00495000,aapl140530p00497500,aapl140530p00500000,aapl140530p00502500,aapl140530p00505000,aapl140530p00507500,aapl140530p00510000,aapl140530p00512500,aapl140530p00515000,aapl140530p00517500,aapl140530p00520000,aapl140530p00522500,aapl140530p00525000,aapl140530p00527500,aapl140530p00530000,aapl140530p00532500,aapl140530p00535000,aapl140530p00537500,aapl140530p00540000,aapl140530p00542500,aapl140530p00545000,aapl140530p00547500,aapl140530p00550000,aapl140530p00552500,aapl140530p00555000,aapl140530p00557500,aapl140530p00560000,aapl140530p00562500,aapl140530p00565000,aapl140530p00567500,aapl140530p00570000,aapl140530p00572500,aapl140530p00575000,aapl140530p00580000,aapl140530p00585000,aapl140530p00587500,aapl140530p00590000,aapl140530p00595000,aapl140530p00600000,aapl140530p00605000,aapl140530p00610000,aapl140530p00615000,aapl140530p00620000,aapl140530p00625000,aapl140530p00630000,aapl140530p00635000,aapl140530p00640000,aapl140530p00645000,aapl140530p00650000,aapl140530p00655000,aapl140530p00660000,aapl140530p00665000,aapl140530p00670000,aapl140530p00675000,aapl140530p00680000,aapl140530p00685000,aapl7140517c00430000,aapl7140517c00435000,aapl7140517c00440000,aapl7140517c00445000,aapl7140517c00450000,aapl7140517c00455000,aapl7140517c00460000,aapl7140517c00465000,aapl7140517c00470000,aapl7140517c00475000,aapl7140517c00480000,aapl7140517c00485000,aapl7140517c00490000,aapl7140517c00495000,aapl7140517c00500000,aapl7140517c00505000,aapl7140517c00510000,aapl7140517c00515000,aapl7140517c00520000,aapl7140517c00525000,aapl7140517c00530000,aapl7140517c00535000,aapl7140517c00540000,aapl7140517c00545000,aapl7140517c00550000,aapl7140517c00555000,aapl7140517c00557500,aapl7140517c00560000,aapl7140517c00562500,aapl7140517c00565000,aapl7140517c00567500,aapl7140517c00570000,aapl7140517c00572500,aapl7140517c00575000,aapl7140517c00577500,aapl7140517c00580000,aapl7140517c00582500,aapl7140517c00585000,aapl7140517c00587500,aapl7140517c00590000,aapl7140517c00592500,aapl7140517c00595000,aapl7140517c00597500,aapl7140517c00600000,aapl7140517c00602500,aapl7140517c00605000,aapl7140517c00607500,aapl7140517c00610000,aapl7140517c00612500,aapl7140517c00615000,aapl7140517c00617500,aapl7140517c00620000,aapl7140517c00622500,aapl7140517c00625000,aapl7140517c00627500,aapl7140517c00630000,aapl7140517c00635000,aapl7140517c00640000,aapl7140517c00645000,aapl7140517c00650000,aapl7140517c00655000,aapl7140517p00430000,aapl7140517p00435000,aapl7140517p00440000,aapl7140517p00445000,aapl7140517p00450000,aapl7140517p00455000,aapl7140517p00460000,aapl7140517p00465000,aapl7140517p00470000,aapl7140517p00475000,aapl7140517p00480000,aapl7140517p00485000,aapl7140517p00490000,aapl7140517p00495000,aapl7140517p00500000,aapl7140517p00505000,aapl7140517p00510000,aapl7140517p00515000,aapl7140517p00520000,aapl7140517p00525000,aapl7140517p00530000,aapl7140517p00535000,aapl7140517p00540000,aapl7140517p00545000,aapl7140517p00550000,aapl7140517p00555000,aapl7140517p00557500,aapl7140517p00560000,aapl7140517p00562500,aapl7140517p00565000,aapl7140517p00567500,aapl7140517p00570000,aapl7140517p00572500,aapl7140517p00575000,aapl7140517p00577500,aapl7140517p00580000,aapl7140517p00582500,aapl7140517p00585000,aapl7140517p00587500,aapl7140517p00590000,aapl7140517p00592500,aapl7140517p00595000,aapl7140517p00597500,aapl7140517p00600000,aapl7140517p00602500,aapl7140517p00605000,aapl7140517p00607500,aapl7140517p00610000,aapl7140517p00612500,aapl7140517p00615000,aapl7140517p00617500,aapl7140517p00620000,aapl7140517p00622500,aapl7140517p00625000,aapl7140517p00627500,aapl7140517p00630000,aapl7140517p00635000,aapl7140517p00640000,aapl7140517p00645000,aapl7140517p00650000,aapl7140517p00655000,aapl7140523c00495000,aapl7140523c00500000,aapl7140523c00502500,aapl7140523c00505000,aapl7140523c00507500,aapl7140523c00510000,aapl7140523c00512500,aapl7140523c00515000,aapl7140523c00517500,aapl7140523c00520000,aapl7140523c00522500,aapl7140523c00525000,aapl7140523c00527500,aapl7140523c00530000,aapl7140523c00532500,aapl7140523c00535000,aapl7140523c00537500,aapl7140523c00540000,aapl7140523c00542500,aapl7140523c00545000,aapl7140523c00547500,aapl7140523c00550000,aapl7140523c00552500,aapl7140523c00555000,aapl7140523c00557500,aapl7140523c00560000,aapl7140523c00562500,aapl7140523c00565000,aapl7140523c00567500,aapl7140523c00570000,aapl7140523c00572500,aapl7140523c00575000,aapl7140523c00577500,aapl7140523c00580000,aapl7140523c00582500,aapl7140523c00585000,aapl7140523c00587500,aapl7140523c00590000,aapl7140523c00595000,aapl7140523c00600000,aapl7140523p00495000,aapl7140523p00500000,aapl7140523p00502500,aapl7140523p00505000,aapl7140523p00507500,aapl7140523p00510000,aapl7140523p00512500,aapl7140523p00515000,aapl7140523p00517500,aapl7140523p00520000,aapl7140523p00522500,aapl7140523p00525000,aapl7140523p00527500,aapl7140523p00530000,aapl7140523p00532500,aapl7140523p00535000,aapl7140523p00537500,aapl7140523p00540000,aapl7140523p00542500,aapl7140523p00545000,aapl7140523p00547500,aapl7140523p00550000,aapl7140523p00552500,aapl7140523p00555000,aapl7140523p00557500,aapl7140523p00560000,aapl7140523p00562500,aapl7140523p00565000,aapl7140523p00567500,aapl7140523p00570000,aapl7140523p00572500,aapl7140523p00575000,aapl7140523p00577500,aapl7140523p00580000,aapl7140523p00582500,aapl7140523p00585000,aapl7140523p00587500,aapl7140523p00590000,aapl7140523p00595000,aapl7140523p00600000,aapl7140530c00490000,aapl7140530c00492500,aapl7140530c00495000,aapl7140530c00497500,aapl7140530c00500000,aapl7140530c00502500,aapl7140530c00505000,aapl7140530c00507500,aapl7140530c00510000,aapl7140530c00512500,aapl7140530c00515000,aapl7140530c00517500,aapl7140530c00520000,aapl7140530c00522500,aapl7140530c00525000,aapl7140530c00527500,aapl7140530c00530000,aapl7140530c00532500,aapl7140530c00535000,aapl7140530c00537500,aapl7140530c00540000,aapl7140530c00542500,aapl7140530c00545000,aapl7140530c00547500,aapl7140530c00550000,aapl7140530c00552500,aapl7140530c00555000,aapl7140530c00557500,aapl7140530c00560000,aapl7140530c00562500,aapl7140530c00565000,aapl7140530c00567500,aapl7140530c00570000,aapl7140530c00572500,aapl7140530c00575000,aapl7140530c00580000,aapl7140530c00582500,aapl7140530c00585000,aapl7140530c00587500,aapl7140530c00590000,aapl7140530c00595000,aapl7140530c00600000,aapl7140530p00490000,aapl7140530p00492500,aapl7140530p00495000,aapl7140530p00497500,aapl7140530p00500000,aapl7140530p00502500,aapl7140530p00505000,aapl7140530p00507500,aapl7140530p00510000,aapl7140530p00512500,aapl7140530p00515000,aapl7140530p00517500,aapl7140530p00520000,aapl7140530p00522500,aapl7140530p00525000,aapl7140530p00527500,aapl7140530p00530000,aapl7140530p00532500,aapl7140530p00535000,aapl7140530p00537500,aapl7140530p00540000,aapl7140530p00542500,aapl7140530p00545000,aapl7140530p00547500,aapl7140530p00550000,aapl7140530p00552500,aapl7140530p00555000,aapl7140530p00557500,aapl7140530p00560000,aapl7140530p00562500,aapl7140530p00565000,aapl7140530p00567500,aapl7140530p00570000,aapl7140530p00572500,aapl7140530p00575000,aapl7140530p00580000,aapl7140530p00582500,aapl7140530p00585000,aapl7140530p00587500,aapl7140530p00590000,aapl7140530p00595000,aapl7140530p00600000,^dji,^ixic", "j" : "a00,b00,c10,l10,p20,t10,v00", "version" : "1.0", "market" : {"NAME" : "U.S.", "ID" : "us_market", "TZ" : "EDT", "TZOFFSET" : "-14400", "open" : "", "close" : "", "flags" : {}} , "market_status_yrb" : "YFT_MARKET_CLOSED" , "portfolio" : { "fd" : { "txns" : [ ]},"dd" : "","pc" : "","pcs" : ""}, "STREAMER_SERVER" : "//streamerapi.finance.yahoo.com", "DOC_DOMAIN" : "finance.yahoo.com", "localize" : "0" , "throttleInterval" : "1000" , "arrowAsChangeSign" : "true" , "up_arrow_icon" : "http://l.yimg.com/a/i/us/fi/03rd/up_g.gif" , "down_arrow_icon" : "http://l.yimg.com/a/i/us/fi/03rd/down_r.gif" , "up_color" : "green" , "down_color" : "red" , "pass_market_id" : "0" , "mu" : "1" , "lang" : "en-US" , "region" : "US" }</span><span style="display:none" id="yfs_enable_chrome">1</span><input type="hidden" id=".yficrumb" name=".yficrumb" value=""><script type="text/javascript">
+ YAHOO.util.Event.addListener(window, "load", function(){YAHOO.Finance.Streaming.init();});
+ </script><script type="text/javascript">
+ ll_js.push({
+ 'file':'http://l.yimg.com/ss/rapid-3.11.js',
+ 'success_callback' : function(){
+ if(window.RAPID_ULT) {
+ var conf = {
+ compr_type:'deflate',
+ tracked_mods:window.RAPID_ULT.tracked_mods,
+ keys:window.RAPID_ULT.page_params,
+ spaceid:28951412,
+ client_only:0,
+ webworker_file:"\/__rapid-worker-1.1.js",
+ nofollow_class:'rapid-nf',
+ test_id:'512028',
+ ywa: {
+ project_id:1000911397279,
+ document_group:"",
+ document_name:'AAPL',
+ host:'y.analytics.yahoo.com'
+ }
+ };
+ YAHOO.i13n.YWA_CF_MAP = {"_p":20,"ad":58,"authfb":11,"bpos":24,"camp":54,"cat":25,"code":55,"cpos":21,"ct":23,"dcl":26,"dir":108,"domContentLoadedEventEnd":44,"elm":56,"elmt":57,"f":40,"ft":51,"grpt":109,"ilc":39,"itc":111,"loadEventEnd":45,"ltxt":17,"mpos":110,"mrkt":12,"pcp":67,"pct":48,"pd":46,"pkgt":22,"pos":20,"prov":114,"pst":68,"pstcat":47,"pt":13,"rescode":27,"responseEnd":43,"responseStart":41,"rspns":107,"sca":53,"sec":18,"site":42,"slk":19,"sort":28,"t1":121,"t2":122,"t3":123,"t4":124,"t5":125,"t6":126,"t7":127,"t8":128,"t9":129,"tar":113,"test":14,"v":52,"ver":49,"x":50};
+ YAHOO.i13n.YWA_ACTION_MAP = {"click":12,"drag":21,"drop":106,"error":99,"hover":17,"hswipe":19,"hvr":115,"key":13,"rchvw":100,"scrl":104,"scrolldown":16,"scrollup":15,"secview":18,"secvw":116,"svct":14,"swp":103};
+ YAHOO.i13n.YWA_OUTCOME_MAP = {"abuse":51,"close":34,"cmmt":128,"cnct":127,"comment":49,"connect":36,"cueauthview":43,"cueconnectview":46,"cuedcl":61,"cuehpset":50,"cueinfoview":45,"cueloadview":44,"cueswipeview":42,"cuetop":48,"dclent":101,"dclitm":102,"drop":22,"dtctloc":118,"end":31,"entitydeclaration":40,"exprt":122,"favorite":56,"fetch":30,"filter":35,"flagcat":131,"flagitm":129,"follow":52,"hpset":27,"imprt":123,"insert":28,"itemdeclaration":37,"lgn":125,"lgo":126,"login":33,"msgview":47,"navigate":25,"open":29,"pa":111,"pgnt":113,"pl":112,"prnt":124,"reauthfb":24,"reply":54,"retweet":55,"rmct":32,"rmloc":120,"rmsvct":117,"sbmt":114,"setlayout":38,"sh":107,"share":23,"slct":121,"slctfltr":133,"slctloc":119,"sort":39,"srch":134,"svct":109,"top":26,"undo":41,"unflagcat":132,"unflagitm":130,"unfollow":53,"unsvct":110};
+ window.ins = new YAHOO.i13n.Rapid(conf); //Making ins a global variable because it might be needed by other module js
+ }
+ }
+ });
+ </script><!--
+ Begin : Page level configs for rapid
+ Configuring modules for a page in one place because having a lot of inline scripts will not be good for performance
+ --><script type="text/javascript">
+ window.RAPID_ULT ={
+ tracked_mods:{
+ 'navigation':'Navigation',
+ 'searchQuotes':'Quote Bar',
+ 'marketindices' : 'Market Indices',
+ 'yfi_investing_nav' : 'Left nav',
+ 'yfi_rt_quote_summary' : 'Quote Summary Bar',
+ 'yfncsumtab' : 'Options table',
+ 'yfi_ft' : 'Footer'
+ },
+ page_params:{
+ 'pstcat' : 'Quotes',
+ 'pt' : 'Quote Leaf Pages',
+ 'pstth' : 'Quotes Options Page'
+ }
+ }
+ </script></html><!--c32.finance.gq1.yahoo.com-->
+<!-- xslt5.finance.gq1.yahoo.com uncompressed/chunked Sun May 11 22:06:29 UTC 2014 -->
+<script language=javascript>
+(function(){window.xzq_p=function(R){M=R};window.xzq_svr=function(R){J=R};function F(S){var T=document;if(T.xzq_i==null){T.xzq_i=new Array();T.xzq_i.c=0}var R=T.xzq_i;R[++R.c]=new Image();R[R.c].src=S}window.xzq_sr=function(){var S=window;var Y=S.xzq_d;if(Y==null){return }if(J==null){return }var T=J+M;if(T.length>P){C();return }var X="";var U=0;var W=Math.random();var V=(Y.hasOwnProperty!=null);var R;for(R in Y){if(typeof Y[R]=="string"){if(V&&!Y.hasOwnProperty(R)){continue}if(T.length+X.length+Y[R].length<=P){X+=Y[R]}else{if(T.length+Y[R].length>P){}else{U++;N(T,X,U,W);X=Y[R]}}}}if(U){U++}N(T,X,U,W);C()};function N(R,U,S,T){if(U.length>0){R+="&al="}F(R+U+"&s="+S+"&r="+T)}function C(){window.xzq_d=null;M=null;J=null}function K(R){xzq_sr()}function B(R){xzq_sr()}function L(U,V,W){if(W){var R=W.toString();var T=U;var Y=R.match(new RegExp("\\\\(([^\\\\)]*)\\\\)"));Y=(Y[1].length>0?Y[1]:"e");T=T.replace(new RegExp("\\\\([^\\\\)]*\\\\)","g"),"("+Y+")");if(R.indexOf(T)<0){var X=R.indexOf("{");if(X>0){R=R.substring(X,R.length)}else{return W}R=R.replace(new RegExp("([^a-zA-Z0-9$_])this([^a-zA-Z0-9$_])","g"),"$1xzq_this$2");var Z=T+";var rv = f( "+Y+",this);";var S="{var a0 = '"+Y+"';var ofb = '"+escape(R)+"' ;var f = new Function( a0, 'xzq_this', unescape(ofb));"+Z+"return rv;}";return new Function(Y,S)}else{return W}}return V}window.xzq_eh=function(){if(E||I){this.onload=L("xzq_onload(e)",K,this.onload,0);if(E&&typeof (this.onbeforeunload)!=O){this.onbeforeunload=L("xzq_dobeforeunload(e)",B,this.onbeforeunload,0)}}};window.xzq_s=function(){setTimeout("xzq_sr()",1)};var J=null;var M=null;var Q=navigator.appName;var H=navigator.appVersion;var G=navigator.userAgent;var A=parseInt(H);var D=Q.indexOf("Microsoft");var E=D!=-1&&A>=4;var I=(Q.indexOf("Netscape")!=-1||Q.indexOf("Opera")!=-1)&&A>=4;var O="undefined";var P=2000})();
+</script><script language=javascript>
+if(window.xzq_svr)xzq_svr('http://csc.beap.bc.yahoo.com/');
+if(window.xzq_p)xzq_p('yi?bv=1.0.0&bs=(134q4e8mq(gid$lYcqyjIwNi6yRhsmUpTyoQOwMTA4LlNv9GP__xMA,st$1399845989362956,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3');
+if(window.xzq_s)xzq_s();
+</script><noscript><img width=1 height=1 alt="" src="http://csc.beap.bc.yahoo.com/yi?bv=1.0.0&bs=(134q4e8mq(gid$lYcqyjIwNi6yRhsmUpTyoQOwMTA4LlNv9GP__xMA,st$1399845989362956,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3"></noscript><script>(function(c){var e="https://",a=c&&c.JSON,f="ypcdb",g=document,d=["yahoo.com","flickr.com","rivals.com","yahoo.net","yimg.com"],b;function i(l,o,n,m){var k,p;try{k=new Date();k.setTime(k.getTime()+m*1000);g.cookie=[l,"=",encodeURIComponent(o),"; domain=",n,"; path=/; max-age=",m,"; expires=",k.toUTCString()].join("")}catch(p){}}function h(l){var k,m;try{k=new Image();k.onerror=k.onload=function(){k.onerror=k.onload=null;k=null};k.src=l}catch(m){}}function j(u,A,n,y){var w=0,v,z,x,s,t,p,m,r,l,o,k,q;try{b=location}catch(r){b=null}try{if(a){k=a.parse(y)}else{q=new Function("return "+y);k=q()}}catch(r){k=null}try{v=b.hostname;z=b.protocol;if(z){z+="//"}}catch(r){v=z=""}if(!v){try{x=g.URL||b.href||"";s=x.match(/^((http[s]?)\:[\/]+)?([^:\/\s]+|[\:\dabcdef\.]+)/i);if(s&&s[1]&&s[3]){z=s[1]||"";v=s[3]||""}}catch(r){z=v=""}}if(!v||!k||!z||!A){return}while(l=d[w++]){t=l.replace(/\./g,"\\.");p=new RegExp("(\\.)+"+t+"$");if(v==l||v.search(p)!=-1){o=l;break}}if(!o){return}if(z===e){A=n}w=0;while(m=A[w++]){h(z+m+k[m.substr(1+m.lastIndexOf("="))])}i(f,u,o,86400)}j('04ed632825d1baa4a648e5e72b91a781',['ad.yieldmanager.com/csync?ver=2.1','csync.yahooapis.com/csync?ver=2.1','u2sb.interclick.com/beacon.gif?ver=2.1'],['ad.yieldmanager.com/csync?ver=2.1','cdnk.interclick.com/beacon.gif?ver=2.1','csync.yahooapis.com/csync?ver=2.1'],'{"2.1":"&id=23351&value=o4ute4c999fy1%26o%3d4%26q%3dnnJ94OgcLRYj5pMbCpL25fSvaHKgjUSJ_NLd8N--%26f%3ddz%26v%3d1SjRGqixKCWpXPKC8h19&optout=b%3d0&timeout=1399845989&sig=13v33g3st"}')})(window);
+</script>
+<!-- c32.finance.gq1.yahoo.com compressed/chunked Sun May 11 22:06:27 UTC 2014 -->
diff --git a/pandas/io/tests/data/yahoo_options2.html b/pandas/io/tests/data/yahoo_options2.html
new file mode 100644
index 0000000000000..91c7d41905120
--- /dev/null
+++ b/pandas/io/tests/data/yahoo_options2.html
@@ -0,0 +1,329 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>AAPL Options | Apple Inc. Stock - Yahoo! Finance</title><script type="text/javascript" src="http://l.yimg.com/a/i/us/fi/03rd/yg_csstare_nobgcolor.js"></script><link rel="stylesheet" href="http://l.yimg.com/zz/combo?kx/yucs/uh3/uh/css/1014/uh_non_mail-min.css&kx/yucs/uh_common/meta/3/css/meta-min.css&kx/yucs/uh3/uh3_top_bar/css/280/no_icons-min.css&kx/yucs/uh3/search/css/576/blue_border-min.css&kx/yucs/uh3/breakingnews/css/1/breaking_news-min.css&kx/yucs/uh3/promos/get_the_app/css/74/get_the_app-min.css&bm/lib/fi/common/p/d/static/css/2.0.333292/2.0.0/mini/yfi_yoda_legacy_lego_concat.css&bm/lib/fi/common/p/d/static/css/2.0.333292/2.0.0/mini/yfi_symbol_suggest.css&bm/lib/fi/common/p/d/static/css/2.0.333292/2.0.0/mini/yui_helper.css&bm/lib/fi/common/p/d/static/css/2.0.333292/2.0.0/mini/yfi_theme_teal.css" type="text/css"><script language="javascript">
+ ll_js = new Array();
+ </script><script type="text/javascript" src="http://l1.yimg.com/bm/combo?fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yui-min-3.9.1.js&fi/common/p/d/static/js/2.0.333292/yui_2.8.0/build/yuiloader-dom-event/2.0.0/mini/yuiloader-dom-event.js&fi/common/p/d/static/js/2.0.333292/yui_2.8.0/build/container/2.0.0/mini/container.js&fi/common/p/d/static/js/2.0.333292/yui_2.8.0/build/datasource/2.0.0/mini/datasource.js&fi/common/p/d/static/js/2.0.333292/yui_2.8.0/build/autocomplete/2.0.0/mini/autocomplete.js"></script><link rel="stylesheet" href="http://l1.yimg.com/bm/combo?fi/common/p/d/static/css/2.0.333292/2.0.0/mini/yfi_follow_quote.css" type="text/css"><link rel="stylesheet" href="http://l1.yimg.com/bm/combo?fi/common/p/d/static/css/2.0.333292/2.0.0/mini/yfi_follow_stencil.css" type="text/css"><script language="javascript">
+ ll_js.push({
+ 'success_callback' : function() {
+ YUI().use('stencil', 'follow-quote', 'node', function (Y) {
+ var conf = {'xhrBase': '/', 'lang': 'en-US', 'region': 'US', 'loginUrl': 'https://login.yahoo.com/config/login_verify2?&.done=http://finance.yahoo.com/q?s=AAPL&.intl=us'};
+
+ Y.Media.FollowQuote.init(conf, function () {
+ var exchNode = null,
+ followSecClass = "",
+ followHtml = "",
+ followNode = null;
+
+ followSecClass = Y.Media.FollowQuote.getFollowSectionClass();
+ followHtml = Y.Media.FollowQuote.getFollowBtnHTML({ ticker: 'AAPL', addl_classes: "follow-quote-always-visible", showFollowText: true });
+ followNode = Y.Node.create(followHtml);
+ exchNode = Y.one(".wl_sign");
+ if (!Y.Lang.isNull(exchNode)) {
+ exchNode.append(followNode);
+ }
+ });
+ });
+ }
+ });
+ </script><style>
+ /* [bug 3856904]*/
+ #ygma.ynzgma #teleban {width:100%;}
+
+ /* Style to override message boards template CSS */
+ .mboard div#footer {width: 970px !important;}
+ .mboard #screen {width: 970px !important; text-align:left !important;}
+ .mboard div#screen {width: 970px !important; text-align:left !important;}
+ .mboard table.yfnc_modtitle1 td{padding-top:10px;padding-bottom:10px;}
+ </style><meta name="keywords" content="AAPL, Apple Inc., AAPL options, Apple Inc. options, options, stocks, quotes, finance"><meta name="description" content="Discover the AAPL options chain with both straddle and stacked view on Yahoo! Finance. View Apple Inc. options listings by expiration date."><script type="text/javascript"><!--
+ var yfid = document;
+ var yfiagt = navigator.userAgent.toLowerCase();
+ var yfidom = yfid.getElementById;
+ var yfiie = yfid.all;
+ var yfimac = (yfiagt.indexOf('mac')!=-1);
+ var yfimie = (yfimac&&yfiie);
+ var yfiie5 = (yfiie&&yfidom&&!yfimie&&!Array.prototype.pop);
+ var yfiie55 = (yfiie&&yfidom&&!yfimie&&!yfiie5);
+ var yfiie6 = (yfiie55&&yfid.compatMode);
+ var yfisaf = ((yfiagt.indexOf('safari')>-1)?1:0);
+ var yfimoz = ((yfiagt.indexOf('gecko')>-1&&!yfisaf)?1:0);
+ var yfiopr = ((yfiagt.indexOf('opera')>-1&&!yfisaf)?1:0);
+ //--></script><link rel="canonical" href="http://finance.yahoo.com/q/op?s=AAPL"></head><body class="options intl-us yfin_gs gsg-0"><div id="masthead"><div class="yfi_doc yog-hd" id="yog-hd"><div class=""><style>#header,#y-hd,#hd .yfi_doc,#yfi_hd{background:#fff !important}#yfin_gs #yfimh #yucsHead,#yfin_gs #yfi_doc #yucsHead,#yfin_gs #yfi_fp_hd #yucsHead,#yfin_gs #y-hd #yucsHead,#yfin_gs #yfi_hd #yucsHead,#yfin_gs #yfi-doc #yucsHead{-webkit-box-shadow:0 0 9px 0 #490f76 !important;-moz-box-shadow:0 0 9px 0 #490f76 !important;box-shadow:0 0 9px 0 #490f76 !important;border-bottom:1px solid #490f76 !important}#yog-hd,#yfi-hd,#ysp-hd,#hd,#yfimh,#yfi_hd,#yfi_fp_hd,#masthead,#yfi_nav_header #navigation,#y-nav #navigation,.ad_in_head{background-color:#fff;background-image:none}#header,#hd .yfi_doc,#y-hd .yfi_doc,#yfi_hd .yfi_doc{width:100% !important}#yucs{margin:0 auto;width:970px}#yfi_nav_header,.y-nav-legobg,#y-nav #navigation{margin:0 auto;width:970px}#yucs .yucs-avatar{height:22px;width:22px}#yucs #yucs-profile_text .yuhead-name-greeting{display:none}#yucs #yucs-profile_text .yuhead-name{top:0;max-width:65px}#yucs-profile_text{max-width:65px}#yog-bd .yom-stage{background:transparent}#yog-hd{height:84px}.yog-bd,.yog-grid{padding:4px 10px}.nav-stack ul.yog-grid{padding:0}#yucs #yucs-search.yucs-bbb .yucs-button_theme{background:-moz-linear-gradient(top, #01a5e1 0, #0297ce 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #01a5e1), color-stop(100%, #0297ce));background:-webkit-linear-gradient(top, #01a5e1 0, #0297ce 100%);background:-o-linear-gradient(top, #01a5e1 0, #0297ce 100%);background:-ms-linear-gradient(top, #01a5e1 0, #0297ce 100%);background:linear-gradient(to bottom, #01a5e1 0, #0297ce 100%);-webkit-box-shadow:inset 0 1px 3px 0 #01c0eb;box-shadow:inset 0 1px 3px 0 #01c0eb;background-color:#019ed8;background-color:transparent\0/IE9;background-color:transparent\9;*background:none;border:1px solid #595959;padding-left:0px;padding-right:0px}#yucs #yucs-search.yucs-bbb #yucs-prop_search_button_wrapper .yucs-gradient{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#01a5e1', endColorstr='#0297ce',GradientType=0 );-ms-filter:"progid:DXImageTransform.Microsoft.gradient( startColorstr='#01a5e1', endColorstr='#0297ce',GradientType=0 )";background-color:#019ed8\0/IE9}#yucs #yucs-search.yucs-bbb #yucs-prop_search_button_wrapper{*border:1px solid #595959}#yucs #yucs-search .yucs-button_theme{background:#0f8ed8;border:0;box-shadow:0 2px #044e6e}@media all{#yucs.yucs-mc,#yucs-top-inner{width:auto !important;margin:0 !important}#yucsHead{_text-align:left !important}#yucs-top-inner,#yucs.yucs-mc{min-width:970px !important;max-width:1240px !important;padding-left:10px !important;padding-right:10px !important}#yucs.yucs-mc{_width:970px !important;_margin:0 !important}#yucsHead #yucs .yucs-fl-left #yucs-search{position:absolute;left:190px !important;max-width:none !important;margin-left:0;_left:190px;_width:510px !important}.yog-ad-billboard #yucs-top-inner,.yog-ad-billboard #yucs.yucs-mc{max-width:1130px !important}#yucs .yog-cp{position:inherit}}#yucs #yucs-logo{width:150px !important;height:34px !important}#yucs #yucs-logo div{width:94px !important;margin:0 auto !important}.lt #yucs-logo div{background-position:-121px center !important}#yucs-logo a{margin-left:-13px !important}</style><style>#yog-hd .yom-bar, #yog-hd .yom-nav, #y-nav, #hd .ysp-full-bar, #yfi_nav_header, #hd .mast {
+float: none;
+width: 970px;
+margin: 0 auto;
+}
+
+#yog-bd .yom-stage {
+background: transparent;
+}
+
+#y-nav .yom-nav {
+padding-top: 0px;
+}
+
+#ysp-search-assist .bd {
+display:none;
+}
+
+#ysp-search-assist h4 {
+padding-left: 8px;
+}
+
+
+ #yfi-portfolios-multi-quotes #y-nav, #yfi-portfolios-multi-quotes #navigation, #yfi-portfolios-multi-quotes .y-nav-legobg,
+ #yfi-portfolios-my-portfolios #y-nav, #yfi-portfolios-my-portfolios #navigation, #yfi-portfolios-my-portfolios .y-nav-legobg {
+ width : 100%;
+ }</style> <div id="yucsHead" class="yucs-finance yucs-en-us ua-ff yucs-standard"><!-- meta --><div id="yucs-meta" data-authstate="signedout" data-cobrand="standard" data-crumb="xqK0R2GH4z3" data-device="desktop" data-firstname="" data-flight="1400030096" data-forcecobrand="standard" data-guid="" data-host="finance.yahoo.com" data-https="" data-languagetag="en-us" data-property="finance" data-protocol="" data-shortfirstname="" data-shortuserid="" data-status="active" data-spaceid="" data-userid="" ></div><!-- /meta --><div id="yucs-disclaimer" class="yucs-disclaimer yucs-activate yucs-hide yucs-property-finance yucs-fcb- " data-disclaimertext="Do Not Track is no longer enabled on Yahoo. Your experience is now personalized. {disclaimerLink}More info{linkEnd}" data-ylt-link="https://us.lrd.yahoo.com/_ylt=AuyCw9EoWXwE7T1iw7SM9n50w7kB/SIG=11s0pk41b/EXP=1401239695/**https%3A//info.yahoo.com/privacy/us/yahoo/" data-ylt-disclaimerbarclose="/;_ylt=Aoq6rsGy6eD22zQ_bm4yYJF0w7kB" data-ylt-disclaimerbaropen="/;_ylt=Ao2qXoI8qeHRHnVt9zM_m9B0w7kB" data-linktarget="_top" data-lang="en-us" data-property="finance" data-device="Desktop" data-close-txt="Close this window"></div><div id="yucs-top-bar" class='yucs-ps'> <div id='yucs-top-inner'> <ul id='yucs-top-list'> <li id='yucs-top-home'><a href="https://us.lrd.yahoo.com/_ylt=AjzFllaWKiUGhEflEKIqJ8t0w7kB/SIG=11a7kbjgm/EXP=1401239695/**https%3A//www.yahoo.com/"><span class="sp yucs-top-ico"></span>Home</a></li> <li id='yucs-top-mail'><a href="https://mail.yahoo.com/;_ylt=AvYbokY8kuZaZ09PwmKVXeV0w7kB?.intl=us&.lang=en-US&.src=ym">Mail</a></li> <li id='yucs-top-news'><a href="http://news.yahoo.com/;_ylt=AiUBqipZL_ez0RYywQiflHR0w7kB">News</a></li> <li id='yucs-top-sports'><a href="http://sports.yahoo.com/;_ylt=AuDQ6AgnrxO133eK9WePM_l0w7kB">Sports</a></li> <li id='yucs-top-finance'><a href="http://finance.yahoo.com/;_ylt=AiPcw9hWCnqXCoYHjBQMbb90w7kB">Finance</a></li> <li id='yucs-top-weather'><a href="https://weather.yahoo.com/;_ylt=ArbDoUWyBv9rM9_cyPS0XDB0w7kB">Weather</a></li> <li id='yucs-top-games'><a href="https://games.yahoo.com/;_ylt=AoK6aMd0fCvdNmEUWYJkUe10w7kB">Games</a></li> <li id='yucs-top-groups'><a href="https://us.lrd.yahoo.com/_ylt=Aj38kC1G8thF4bTCK_hDseZ0w7kB/SIG=11dcd8k2m/EXP=1401239695/**https%3A//groups.yahoo.com/">Groups</a></li> <li id='yucs-top-answers'><a href="https://answers.yahoo.com/;_ylt=AsWYW8Lz8A5gsl9t_BE55KJ0w7kB">Answers</a></li> <li id='yucs-top-screen'><a href="https://us.lrd.yahoo.com/_ylt=AmugX6LAIdfh4N5ZKvdHbtl0w7kB/SIG=11ddq4ie6/EXP=1401239695/**https%3A//screen.yahoo.com/">Screen</a></li> <li id='yucs-top-flickr'><a href="https://us.lrd.yahoo.com/_ylt=AsCiprev_8tHMt2nem8jsgJ0w7kB/SIG=11beddno7/EXP=1401239695/**https%3A//www.flickr.com/">Flickr</a></li> <li id='yucs-top-mobile'><a href="https://mobile.yahoo.com/;_ylt=Ak15Bebkix4r2DD6y2KQfPF0w7kB">Mobile</a></li> <li id='yucs-more' class='yucs-menu yucs-more-activate' data-ylt="/;_ylt=AgBMYC5xLc5A6JoN_p5Qe5t0w7kB"><a href="#" id='yucs-more-link' class='yucs-leavable'>More<span class="sp yucs-top-ico"></span></a> <div id='yucs-top-menu'> <div class='yui3-menu-content'> <ul class='yucs-hide yucs-leavable'> <li id='yucs-top-omg'><a href="https://us.lrd.yahoo.com/_ylt=Arqg4DlMQSzInJb.VrrqIU50w7kB/SIG=11grq3f59/EXP=1401239695/**https%3A//celebrity.yahoo.com/">Celebrity</a></li> <li id='yucs-top-shine'><a href="https://shine.yahoo.com/;_ylt=AlXZ7hPP1pxlssuWgHmh7XZ0w7kB">Shine</a></li> <li id='yucs-top-movies'><a href="https://movies.yahoo.com/;_ylt=Au5Nb6dLBxPUt_E4NmhyGrJ0w7kB">Movies</a></li> <li id='yucs-top-music'><a href="https://music.yahoo.com/;_ylt=Avb0A3d__gTefa7IlJPlM590w7kB">Music</a></li> <li id='yucs-top-tv'><a href="https://tv.yahoo.com/;_ylt=AvSRie4vbWNL_Ezt.zJWoMJ0w7kB">TV</a></li> <li id='yucs-top-health'><a href="http://us.lrd.yahoo.com/_ylt=AseYgCZCRb3zrO1ZL1n9Ys90w7kB/SIG=11cg21t8u/EXP=1401239695/**http%3A//health.yahoo.com/">Health</a></li> <li id='yucs-top-shopping'><a href="http://shopping.yahoo.com/;_ylt=AjSMsRGWc89buAdvQGcWcmx0w7kB">Shopping</a></li> <li id='yucs-top-travel'><a href="https://us.lrd.yahoo.com/_ylt=AqgEZycPx0H4Y4jG.lczEYJ0w7kB/SIG=11cc93596/EXP=1401239695/**https%3A//yahoo.com/travel">Travel</a></li> <li id='yucs-top-autos'><a href="https://autos.yahoo.com/;_ylt=AoNSg0EaUlG0VCtzfxYyw0l0w7kB">Autos</a></li> <li id='yucs-top-homes'><a href="https://us.lrd.yahoo.com/_ylt=AqfVFWJtVkzR9.Y4H9tLcUV0w7kB/SIG=11cvcmj4f/EXP=1401239695/**https%3A//homes.yahoo.com/">Homes</a></li> </ul> </div> </div> </li> </ul> </div></div><div id="yucs" class="yucs-mc yog-grid" data-lang="en-us" data-property="finance" data-flight="1400030096" data-linktarget="_top" data-uhvc="/;_ylt=AqSnriWAMHWlDL_jPegFDLJ0w7kB"> <div class="yucs-fl-left yog-cp"> <div id="yucs-logo"> <style> #yucs #yucs-logo-ani { width:120px ; height:34px; background-image:url(https://s1.yimg.com/rz/l/yahoo_finance_en-US_f_pw_119x34.png) ; _background-image:url(https://s1.yimg.com/rz/l/yahoo_finance_en-US_f_pw_119x34.gif) ; *left: 0px; display:block ; visibility:hidden; clip: rect(22px,154px,42px,0px); *clip: rect(22px 154px 42px 0px); position: absolute; } .lt #yucs-logo-ani { background-position: 100% 0px !important; } .lt #yucs[data-property='mail'] #yucs-logo-ani { background-position: -350px 0px !important; } #yucs-logo { margin-top:0px!important; padding-top: 11px; width: 120px; } #yucs[data-property='homes'] #yucs-logo { width: 102px; } .advisor #yucs-link-ani { left: 21px !important; } #yucs #yucs-logo a {margin-left: 0!important;}#yucs #yucs-link-ani {width: 100% !important;} @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and ( min--moz-device-pixel-ratio: 2), only screen and ( -o-min-device-pixel-ratio: 2/1), only screen and ( min-device-pixel-ratio: 2), only screen and ( min-resolution: 192dpi), only screen and ( min-resolution: 2dppx) { #yucs #yucs-logo-ani { background-image: url(https://s1.yimg.com/rz/l/yahoo_finance_en-US_f_pw_119x34_2x.png) !important; background-size: 235px 34px; } } </style> <div> <a id="yucs-logo-ani" class="" href="http://finance.yahoo.com/;_ylt=Ai.6JZ76phVGwh9OtBkbfLl0w7kB" target="_top" data-alg=""> Yahoo Finance </a> </div> <img id="imageCheck" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" alt=""/> </div><noscript><style>#yucs #yucs-logo-ani {visibility: visible;position: relative;clip: auto;}</style></noscript><script charset='utf-8' type='text/javascript' src='http://l.yimg.com/zz/combo?kx/yucs/uh3/uh/js/49/ai.min.js'></script><script>function isIE() {var myNav = navigator.userAgent.toLowerCase();return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;}function loadAnimAfterOnLoad() { if (typeof Aniden != 'undefined'&& Aniden.play&& (document.getElementById('yucs').getAttribute('data-property') !== 'mail' || document.getElementById('yucs-logo-ani').getAttribute('data-alg'))) {Aniden.play();}}if (isIE()) {var _animPltTimer = setTimeout(function() {this.loadAnimAfterOnLoad();}, 6000);} else if((navigator.userAgent.toLowerCase().indexOf('firefox') > -1)) { var _animFireFoxTimer = setTimeout(function() { this.loadAnimAfterOnLoad(); }, 2000);}else {document.addEventListener("Aniden.animReadyEvent", function() {loadAnimAfterOnLoad();},true);}</script> <div id="yucs-search" style="width: 570px; display: block;" class=' yucs-search-activate'> <form role="search" class="yucs-search yucs-activate" target="_top" data-webaction="https://search.yahoo.com/search;_ylt=Avg8Lj7EHJnf9JNYFZvFx0x0w7kB" action="http://finance.yahoo.com/q;_ylt=AoNBeaqAFX3EqBEUeMvSVax0w7kB" method="get"> <table role="presentation"> <tbody role="presentation"> <tr role="presentation"> <td class="yucs-form-input" role="presentation"> <input autocomplete="off" class="yucs-search-input" name="s" type="search" aria-describedby="mnp-search_box" data-yltvsearch="http://finance.yahoo.com/q;_ylt=AktBqueGQCMjRo8i14D41cl0w7kB" data-yltvsearchsugg="/;_ylt=AtjZAY4ok0w45FxidK.ngpp0w7kB" data-satype="mini" data-gosurl="https://s.yimg.com/aq/autoc" data-pubid="666" data-enter-ylt="http://finance.yahoo.com/q;_ylt=AtcgxHblQAEr842BhTfWjip0w7kB" data-enter-fr="" data-maxresults="" id="mnp-search_box"/> </td><td NOWRAP class="yucs-form-btn" role="presentation"><div id="yucs-prop_search_button_wrapper" class="yucs-search-buttons"><div class="yucs-shadow"><div class="yucs-gradient"></div></div><button id="yucs-sprop_button" class="yucs-action_btn yucs-button_theme yucs-vsearch-button" type="submit" data-vfr="uhb2" data-searchNews="uh3_finance_vert_gs" data-vsearch="http://finance.yahoo.com/q">Search Finance</button></div><div id="yucs-web_search_button_wrapper" class="yucs-search-buttons"><div class="yucs-shadow"><div class="yucs-gradient"></div></div><button id="yucs-search_button" class="yucs-action_btn yucs-wsearch-button" onclick="var form=document.getElementById('yucs-search').children[0];var wa=form.getAttribute('data-webaction');form.setAttribute('action',wa);var searchbox=document.getElementById('mnp-search_box');searchbox.setAttribute('name','p');" type="submit">Search Web</button></div></td></tr> </tbody> </table> <input type="hidden" name="uhb" value="uhb2" data-searchNews="uh3_finance_vert_gs" /> <input type="hidden" name="type" value="2button" /> <input type="hidden" id="fr" name="fr" value="uh3_finance_web_gs" /> </form><div id="yucs-satray" class="sa-tray sa-hidden" data-wstext="Search Web for: " data-wsearch="https://search.yahoo.com/search;_ylt=Ain5Qg_5L12GuKvpR96g4Zd0w7kB" data-vfr="uhb2" data-searchNews="uh3_finance_vert_gs" data-vsearchAll="/;_ylt=Avdx5WgpicnFvC_c9sBb70d0w7kB" data-vsearch="http://finance.yahoo.com/q;_ylt=AjfwOPub4m1yaRxCF.H3CKJ0w7kB" data-vstext= "Search news for: " data-vert_fin_search="https://finance.search.yahoo.com/search/;_ylt=Aq_yrY6Jz9C7C4.V2ZiMSX10w7kB"></div> </div></div><div class="yucs-fl-right"> <div id="yucs-profile" class="yucs-profile yucs-signedout"> <a id="yucs-menu_link_profile_signed_out" href="https://login.yahoo.com/config/login;_ylt=AunrbNWomc08MgCq4G4Ukqx0w7kB?.src=quote&.intl=us&.lang=en-US&.done=http://finance.yahoo.com/q/op%3fs=AAPL%26m=2014-06" target="_top" rel="nofollow" class="sp yucs-fc" aria-label="Profile"> </a> <div id="yucs-profile_text" class="yucs-fc"> <a id="yucs-login_signIn" href="https://login.yahoo.com/config/login;_ylt=Ank7FWPgcrcF2KOsW94q3tx0w7kB?.src=quote&.intl=us&.lang=en-US&.done=http://finance.yahoo.com/q/op%3fs=AAPL%26m=2014-06" target="_top" rel="nofollow" class="yucs-fc"> Sign In </a> </div></div> <div class="yucs-mail_link yucs-mailpreview-ancestor"><a id="yucs-mail_link_id" class="sp yltasis yucs-fc" href="https://mail.yahoo.com/;_ylt=AstcVCi_.nAELdrrbDlQW.d0w7kB?.intl=us&.lang=en-US&.src=ym" rel="nofollow" target="_top"> Mail <span class="yucs-activate yucs-mail-count yucs-hide yucs-alert-count-con" data-uri-scheme="https" data-uri-path="mg.mail.yahoo.com/mailservices/v1/newmailcount" data-authstate="signedout" data-crumb="xqK0R2GH4z3" data-mc-crumb="X1/HlpTJxzS"><span class="yucs-alert-count"></span></span></a><div class="yucs-mail-preview-panel yucs-menu yucs-hide" data-mail-txt="Mail" data-uri-scheme="http" data-uri-path="ucs.query.yahoo.com/v1/console/yql" data-mail-view="Go to Mail" data-mail-help-txt="Help" data-mail-help-url="http://help.yahoo.com/l/us/yahoo/mail/ymail/" data-mail-loading-txt="Loading..." data-languagetag="en-us" data-mrd-crumb=".aPCsDRQyXG" data-authstate="signedout" data-middleauth-signin-text="Click here to view your mail" data-popup-login-url="https://login.yahoo.com/config/login_verify2?.pd=c%3DOIVaOGq62e5hAP8Tv..nr5E3&.src=sc" data-middleauthtext="You have {count} new messages." data-yltmessage-link="http://us.lrd.yahoo.com/_ylt=AhXl_ri3N1b9xThkwiiij4t0w7kB/SIG=13def2817/EXP=1401239695/**http%3A//mrd.mail.yahoo.com/msg%3Fmid=%7BmsgID%7D%26fid=Inbox%26src=uh%26.crumb=.aPCsDRQyXG" data-yltviewall-link="https://mail.yahoo.com/;_ylt=AlSaJ1ebU6r_.174GgvTsJZ0w7kB" data-yltpanelshown="/;_ylt=AnhsCqEsp3.DqtrtYtC5mQ50w7kB" data-ylterror="/;_ylt=AuVOPfse8Fpct0gqyuPrGyp0w7kB" data-ylttimeout="/;_ylt=AmP8lEwCkKx.csyD1krQMh50w7kB" data-generic-error="We're unable to preview your mail.<br>Go to Mail." data-nosubject="[No Subject]" data-timestamp='short'></div></div> <div id="yucs-help" class="yucs-activate yucs-help yucs-menu_nav"> <a id="yucs-help_button" class="sp yltasis" href="javascript:void(0);" aria-label="Help" rel="nofollow"> <em class="yucs-hide yucs-menu_anchor">Help</em> </a> <div id="yucs-help_inner" class="yucs-hide yucs-menu yucs-hm-activate" data-yltmenushown="/;_ylt=AjC7wKbrASyJbJ0H1D2nvUl0w7kB"> <span class="sp yucs-dock"></span> <ul id="yuhead-help-panel"> <li><a class="yucs-acct-link" href="https://us.lrd.yahoo.com/_ylt=AsOyLMUdxhrcMbdiXctVqZR0w7kB/SIG=169jdp5a8/EXP=1401239695/**https%3A//edit.yahoo.com/mc2.0/eval_profile%3F.intl=us%26.lang=en-US%26.done=http%3A//finance.yahoo.com/q/op%253fs=AAPL%2526m=2014-06%26amp;.src=quote%26amp;.intl=us%26amp;.lang=en-US" target="_top">Account Info</a></li> <li><a href="https://help.yahoo.com/l/us/yahoo/finance/;_ylt=AmJI8T71SUfHtZat7lOyZjl0w7kB" rel="nofollow" >Help</a></li> <span class="yucs-separator" role="presentation" style="display: block;"></span> <li><a href="http://us.lrd.yahoo.com/_ylt=ArC8CZZ7rWU5.Oo_s3X.r2p0w7kB/SIG=11rf3rol1/EXP=1401239695/**http%3A//feedback.yahoo.com/forums/207809" rel="nofollow" >Suggestions</a></li> </ul> </div></div> <div id="yucs-network_link"><a id="yucs-home_link" href="https://us.lrd.yahoo.com/_ylt=Aj_EuHb3_OivMslUzEtKPk50w7kB/SIG=11a7kbjgm/EXP=1401239695/**https%3A//www.yahoo.com/" rel="nofollow" target="_top">Yahoo</a></div> <div id="yucs-bnews" class="yucs-activate slide yucs-hide" data-linktarget="_top" data-authstate="signedout" data-deflink="http://news.yahoo.com" data-deflinktext="Visit Yahoo News for the latest." data-title="Breaking News" data-close="Close this window" data-lang="en-us" data-property="finance"></div> <div id="uh-dmos-wrapper"><div id="uh-dmos-overlay" class="uh-dmos-overlay"> </div> <div id="uh-dmos-container" class="uh-dmos-hide"> <div id="uh-dmos-msgbox" class="uh-dmos-msgbox" tabindex="0" aria-labelledby="modal-title" aria-describedby="uh-dmos-ticker-gadget"> <div class="uh-dmos-msgbox-canvas"> <div class="uh-dmos-msgbox-close"> <button id="uh-dmos-msgbox-close-btn" class="uh-dmos-msgbox-close-btn" type="button">close button</button> </div> <div id="uh-dmos-imagebg" class="uh-dmos-imagebg"> <h2 id="modal-title" class="uh-dmos-title uh-dmos-strong">Mobile App Promotion</h2> </div> <div id="uh-dmos-bd"> <p class="uh-dmos-Helvetica uh-dmos-alertText">Send me <strong>a link:</strong></p> <div class="uh-dmos-info"> <label for=input-id-phoneNumber>Phone Number</label> <input id="input-id-phoneNumber" class="phone-number-input" type="text" placeholder="+1 (555)-555-5555" name="phoneNumber"> <p id="uh-dmos-text-disclaimer" style="display:block">*Only U.S. numbers are accepted. Text messaging rates may apply.</p><p id="phone-prompt" class = "uh-dmos-Helvetica" style="display:none">Please enter a valid phone number.</p> <p id="phone-or-email-prompt" class = "uh-dmos-Helvetica" style="display:none">Please enter your Phone Number.</p> </div> <div class="uh-dmos-info-button"> <button id="uh-dmos-subscribe" class="subscribe uh-dmos-Helvetica" title="" type="button" data-crumb="7tDmxu2A6c3">Send</button> </div> </div> <div id="uh-dmos-success-message" style="display:none;"> <div class="uh-dmos-success-imagebg"> </div> <div id="uh-dmos-success-bd"> <p class="uh-dmos-Helvetica uh-dmos-confirmation"><strong>Thanks!</strong> A link has been sent.</p> <button id="uh-dmos-successBtn" class="successBtn uh-dmos-Helvetica" title="" type="button">Done</button> </div> </div> </div> </div> </div></div><script id="modal_inline" data-class="yucs_gta_finance" data-button-rev="1" data-modal-rev="1" data-appid ="modal-finance" href="https://mobile.yahoo.com/finance/;_ylt=AhmGC7MofMCaDqlqepjkjFl0w7kB" data-button-txt="Get the app" type="text/javascript"></script> </div> </div> <!-- contextual_shortcuts --><!-- /contextual_shortcuts --><!-- property: finance | languagetag: en-us | status: active | spaceid: | cobrand: standard | markup: empty --><div id="yucs-location-js" class="yucs-hide yucs-offscreen yucs-location-activate" data-appid="yahoo.locdrop.ucs.desktop" data-crumb="05MDkSilNcK"><!-- empty for ie --></div><div id="yUnivHead" class="yucs-hide"><!-- empty --></div></div></div><script type="text/javascript">
+ var yfi_dd = 'finance.yahoo.com';
+
+ ll_js.push({
+ 'file':'http://l.yimg.com/zz/combo?kx/yucs/uh3/uh/js/998/uh-min.js&kx/yucs/uh3/uh/js/102/gallery-jsonp-min.js&kx/yucs/uh3/uh/js/966/menu_utils_v3-min.js&kx/yucs/uh3/uh/js/834/localeDateFormat-min.js&kx/yucs/uh3/uh/js/872/timestamp_library_v2-min.js&kx/yucs/uh3/uh/js/829/logo_debug-min.js&kx/yucs/uh_common/meta/11/js/meta-min.js&kx/yucs/uh_common/beacon/18/js/beacon-min.js&kx/ucs/comet/js/76/cometd-yui3-min.js&kx/ucs/comet/js/76/conn-min.js&kx/ucs/comet/js/76/dark-test-min.js&kx/yucs/uh3/disclaimer/js/154/disclaimer_seed-min.js&kx/yucs/uh3/uh3_top_bar/js/274/top_bar_v3-min.js&kx/yucs/uh3/search/js/573/search-min.js&kx/ucs/common/js/135/jsonp-super-cached-min.js&kx/yucs/uh3/avatar/js/25/avatar-min.js&kx/yucs/uh3/mail_link/js/89/mailcount_ssl-min.js&kx/yucs/uh3/help/js/55/help_menu_v3-min.js&kx/ucs/common/js/131/jsonp-cached-min.js&kx/yucs/uh3/breakingnews/js/11/breaking_news-min.js&kx/yucs/uh3/promos/get_the_app/js/60/inputMaskClient-min.js&kx/yucs/uh3/promos/get_the_app/js/76/get_the_app-min.js&kx/yucs/uh3/location/js/7/uh_locdrop-min.js'
+ });
+
+ if(window.LH) {
+ LH.init({spaceid:'28951412'});
+ }
+ </script><style>
+ .yfin_gs #yog-hd{
+ position: relative;
+ }
+ html {
+ padding-top: 0 !important;
+ }
+
+ @media screen and (min-width: 806px) {
+ html {
+ padding-top:83px !important;
+ }
+ .yfin_gs #yog-hd{
+ position: fixed;
+ }
+ }
+ /* bug 6768808 - allow UH scrolling for smartphone */
+ @media only screen and (device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2),
+ only screen and (device-width: 320px) and (device-height: 568px) and (-webkit-min-device-pixel-ratio: 1),
+ only screen and (device-width: 320px) and (device-height: 534px) and (-webkit-device-pixel-ratio: 1.5),
+ only screen and (device-width: 720px) and (device-height: 1280px) and (-webkit-min-device-pixel-ratio: 2),
+ only screen and (device-width: 480px) and (device-height: 800px) and (-webkit-device-pixel-ratio: 1.5 ),
+ only screen and (device-width: 384px) and (device-height: 592px) and (-webkit-device-pixel-ratio: 2),
+ only screen and (device-width: 360px) and (device-height: 640px) and (-webkit-device-pixel-ratio: 3){
+ html {
+ padding-top: 0 !important;
+ }
+ .yfin_gs #yog-hd{
+ position: relative;
+ border-bottom: 0 none !important;
+ box-shadow: none !important;
+ }
+ }
+ </style><script type="text/javascript">
+ YUI().use('node',function(Y){
+ var gs_hdr_elem = Y.one('.yfin_gs #yog-hd');
+ var _window = Y.one('window');
+
+ if(gs_hdr_elem) {
+ _window.on('scroll', function() {
+ var scrollTop = _window.get('scrollTop');
+
+ if (scrollTop === 0 ) {
+ gs_hdr_elem.removeClass('yog-hd-border');
+ }
+ else {
+ gs_hdr_elem.addClass('yog-hd-border');
+ }
+ });
+ }
+ });
+ </script><script type="text/javascript">
+ if(typeof YAHOO == "undefined"){YAHOO={};}
+ if(typeof YAHOO.Finance == "undefined"){YAHOO.Finance={};}
+ if(typeof YAHOO.Finance.ComscoreConfig == "undefined"){YAHOO.Finance.ComscoreConfig={};}
+ YAHOO.Finance.ComscoreConfig={ "config" : [
+ {
+ c5: "28951412",
+ c7: "http://finance.yahoo.com/q/op?s=AAPL&m=2014-06"
+ }
+ ] }
+ ll_js.push({
+ 'file': 'http://l1.yimg.com/bm/lib/fi/common/p/d/static/js/2.0.333292/2.0.0/yfi_comscore.js'
+ });
+ </script><noscript><img src="http://b.scorecardresearch.com/p?c1=2&c2=7241469&c4=http://finance.yahoo.com/q/op?s=AAPL&m=2014-06&c5=28951412&cv=2.0&cj=1"></noscript></div></div><div class="ad_in_head"><div class="yfi_doc"></div><table width="752" id="yfncmkttme" cellpadding="0" cellspacing="0" border="0"><tr><td></td></tr></table></div><div id="y-nav"><div id="navigation" class="yom-mod yom-nav" role="navigation"><div class="bd"><div class="nav"><div class="y-nav-pri-legobg"><div id="y-nav-pri" class="nav-stack nav-0 yfi_doc"><ul class="yog-grid" id="y-main-nav"><li id="finance%2520home"><div class="level1"><a href="/"><span>Finance Home</span></a></div></li><li class="nav-fin-portfolios"><div class="level1"><a id="yfmya" href="/portfolios.html"><span>My Portfolio</span></a><div class="arrow"><em></em></div><div class="pointer"></div><ul class="nav-sub"><li><a href="/portfolios/">Sign in to access My Portfolios</a></li><li><a href="http://billing.finance.yahoo.com/realtime_quotes/signup?.src=quote&.refer=nb">Free trial of Real-Time Quotes</a></li></ul></div></li><li id="market%2520data"><div class="level1"><a href="/market-overview/"><span>Market Data</span></a><div class="arrow"><em></em></div><div class="pointer"></div><ul class="nav-sub"><li><a href="/stock-center/">Stocks</a></li><li><a href="/funds/">Mutual Funds</a></li><li><a href="/options/">Options</a></li><li><a href="/etf/">ETFs</a></li><li><a href="/bonds">Bonds</a></li><li><a href="/futures">Commodities</a></li><li><a href="/currency-investing">Currencies</a></li></ul></div></li><li id="business%2520%2526%2520finance"><div class="level1"><a href="/news/"><span>Business & Finance</span></a><div class="arrow"><em></em></div><div class="pointer"></div><ul class="nav-sub"><li><a href="/corporate-news/">Company News</a></li><li><a href="/economic-policy-news/">Economic News</a></li><li><a href="/investing-news/">Market News</a></li></ul></div></li><li id="personal%2520finance"><div class="level1"><a href="/personal-finance/"><span>Personal Finance</span></a><div class="arrow"><em></em></div><div class="pointer"></div><ul class="nav-sub"><li><a href="/career-education/">Career & Education</a></li><li><a href="/real-estate/">Real Estate</a></li><li><a href="/retirement/">Retirement</a></li><li><a href="/credit-debt/">Credit & Debt</a></li><li><a href="/taxes/">Taxes</a></li><li><a href="/lifestyle/">Health & Lifestyle</a></li><li><a href="/videos/">Featured Videos</a></li><li><a href="/rates/">Rates in Your Area</a></li><li><a href="/calculator/index/">Calculators</a></li></ul></div></li><li id="yahoo%2520originals"><div class="level1"><a href="/blogs/"><span>Yahoo Originals</span></a><div class="arrow"><em></em></div><div class="pointer"></div><ul class="nav-sub"><li><a href="/blogs/breakout/">Breakout</a></li><li><a href="/blogs/daily-ticker/">The Daily Ticker</a></li><li><a href="/blogs/driven/">Driven</a></li><li><a href="/blogs/the-exchange/">The Exchange</a></li><li><a href="/blogs/hot-stock-minute/">Hot Stock Minute</a></li><li><a href="/blogs/just-explain-it/">Just Explain It</a></li><li><a href="/blogs/michael-santoli/">Unexpected Returns</a></li></ul></div></li><li id="cnbc"><div class="level1"><a href="/cnbc/"><span>CNBC</span></a><div class="arrow"><em></em></div><div class="pointer"></div><ul class="nav-sub"><li><a href="/blogs/big-data-download/">Big Data Download</a></li><li><a href="/blogs/off-the-cuff/">Off the Cuff</a></li><li><a href="/blogs/power-pitch/">Power Pitch</a></li><li><a href="/blogs/talking-numbers/">Talking Numbers</a></li><li><a href="/blogs/the-biz-fix/">The Biz Fix</a></li><li><a href="/blogs/top-best-most/">Top/Best/Most</a></li></ul></div></li></ul></div></div> </div></div></div><script>
+
+ (function(el) {
+ function focusHandler(e){
+ if (e && e.target){
+ e.target == document ? null : e.target;
+ document.activeElement = e.target;
+ }
+ }
+ // Handle !IE browsers that do not support the .activeElement property
+ if(!document.activeElement){
+ if (document.addEventListener){
+ document.addEventListener("focus", focusHandler, true);
+ }
+ }
+ })(document);
+
+ </script><div class="y-nav-legobg"><div class="yfi_doc"><div id="y-nav-sec" class="clear"><div id="searchQuotes" class="ticker-search mod" mode="search"><div class="hd"></div><div class="bd"><form id="quote" name="quote" action="/q"><h2 class="yfi_signpost">Search for share prices</h2><label for="txtQuotes">Search for share prices</label><input id="txtQuotes" name="s" value="" type="text" autocomplete="off" placeholder="Enter Symbol"><input id="get_quote_logic_opt" name="ql" value="1" type="hidden" autocomplete="off"><div id="yfi_quotes_submit"><span><span><span><input type="submit" value="Look Up" id="btnQuotes" class="rapid-nf"></span></span></span></div></form></div><div class="ft"><a href="http://finance.search.yahoo.com?fr=fin-v1">Finance Search</a><p><span id="yfs_market_time">Tue, May 13, 2014, 9:14PM EDT - U.S. Markets closed</span></p></div></div></div></div></div></div><div id="screen"><span id="yfs_ad_" ></span><style type="text/css">
+ .yfi-price-change-up{
+ color:#008800
+ }
+
+ .yfi-price-change-down{
+ color:#cc0000
+ }
+ </style><div id="marketindices"> <a href="/q?s=%5EDJI">Dow</a> <span id="yfs_pp0_^dji"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"><b style="color:#008800;">0.12%</b></span> <a href="/q?s=%5EIXIC">Nasdaq</a> <span id="yfs_pp0_^ixic"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"><b style="color:#cc0000;">0.33%</b></span></div><div id="companynav"><table cellpadding="0" cellspacing="0" border="0"><tr><td height="5"></td></tr></table></div><div id="leftcol"><div id="yfi_investing_nav"><div class="hd"><h2>More On AAPL</h2></div><div class="bd"><h3>Quotes</h3><ul><li><a href="/q?s=AAPL">Summary</a></li><li><a href="/q/ecn?s=AAPL+Order+Book">Order Book</a></li><li class="selected">Options</li><li><a href="/q/hp?s=AAPL+Historical+Prices">Historical Prices</a></li></ul><h3>Charts</h3><ul><li><a href="/echarts?s=AAPL+Interactive#symbol=AAPL;range=">Interactive</a></li><li><a href="/q/bc?s=AAPL+Basic+Chart">Basic Chart</a></li><li><a href="/q/ta?s=AAPL+Basic+Tech.+Analysis">Basic Tech. Analysis</a></li></ul><h3>News & Info</h3><ul><li><a href="/q/h?s=AAPL+Headlines">Headlines</a></li><li><a href="/q/p?s=AAPL+Press+Releases">Press Releases</a></li><li><a href="/q/ce?s=AAPL+Company+Events">Company Events</a></li><li><a href="/mb/AAPL/">Message Boards</a></li><li><a href="/marketpulse/AAPL">Market Pulse</a></li></ul><h3>Company</h3><ul><li><a href="/q/pr?s=AAPL+Profile">Profile</a></li><li><a href="/q/ks?s=AAPL+Key+Statistics">Key Statistics</a></li><li><a href="/q/sec?s=AAPL+SEC+Filings">SEC Filings</a></li><li><a href="/q/co?s=AAPL+Competitors">Competitors</a></li><li><a href="/q/in?s=AAPL+Industry">Industry</a></li><li class="deselected">Components</li></ul><h3>Analyst Coverage</h3><ul><li><a href="/q/ao?s=AAPL+Analyst+Opinion">Analyst Opinion</a></li><li><a href="/q/ae?s=AAPL+Analyst+Estimates">Analyst Estimates</a></li></ul><h3>Ownership</h3><ul><li><a href="/q/mh?s=AAPL+Major+Holders">Major Holders</a></li><li><a href="/q/it?s=AAPL+Insider+Transactions">Insider Transactions</a></li><li><a href="/q/ir?s=AAPL+Insider+Roster">Insider Roster</a></li></ul><h3>Financials</h3><ul><li><a href="/q/is?s=AAPL+Income+Statement&annual">Income Statement</a></li><li><a href="/q/bs?s=AAPL+Balance+Sheet&annual">Balance Sheet</a></li><li><a href="/q/cf?s=AAPL+Cash+Flow&annual">Cash Flow</a></li></ul></div><div class="ft"></div></div></div><div id="rightcol"><table border="0" cellspacing="0" cellpadding="0" width="580" id="yfncbrobtn" style="padding-top:1px;"><tr><td align="center"><!--ADS:LOCATION=FB2--><span id="yfs_ad_n4FB2" ><!-- APT Vendor: WSOD, Format: Standard Graphical -->
+<script type="text/javascript" src="https://ad.wsod.com/embed/5fbc498f96d2d4ea0e6c7a3e8dc788e2/1.0.js.120x60/1400030096.781844?yud=smpv%3d3%26ed%3dKfb2BHkzZLF3yh3sUja2DRXi3LZjugk7yJsheWWxeT5uV9SYCdYQ_446QvaEZCyKSLrr70o.Nc5oZrJI1hhOOlXySheUe71FhRajF7TpCt5ebu6ZIxKQApIwdwXxA6rAH8Bwnom0wUOOZ.nGrfoUtSeMHI3EhDtLkRH6oUn3&encver=1&encalgo=3DES-CFB-SHA1&app=apt&intf=1&click=http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3NTNyZmh2dShnaWQkclRQN0F6SXdOaTVZZV9wYlVvN09fZ0FsTVRBNExsTnl3NF9fX3hNQSxzdCQxNDAwMDMwMDk2NzIyNDMxLHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkMzk5NDcxNTU1MSx2JDIuMCxhaWQkTFhweW4yS0xjMjQtLGN0JDI1LHlieCRXMC5kd2ZDcWVkM3RPT1Q3enJfMExRLGJpJDIwODA1NDUwNTEsbW1lJDg3NjU4MDUxMzIyODU2ODA4NDMsciQwLHlvbyQxLGFncCQzMTY3NDIzNTUxLGFwJEZCMikp/0/*"></script><NOSCRIPT><a href="http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3aXB0YzhhMyhnaWQkclRQN0F6SXdOaTVZZV9wYlVvN09fZ0FsTVRBNExsTnl3NF9fX3hNQSxzdCQxNDAwMDMwMDk2NzIyNDMxLHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkMzk5NDcxNTU1MSx2JDIuMCxhaWQkTFhweW4yS0xjMjQtLGN0JDI1LHlieCRXMC5kd2ZDcWVkM3RPT1Q3enJfMExRLGJpJDIwODA1NDUwNTEsbW1lJDg3NjU4MDUxMzIyODU2ODA4NDMsciQxLHJkJDE0OGt0dHByYix5b28kMSxhZ3AkMzE2NzQyMzU1MSxhcCRGQjIpKQ/2/*https://ad.wsod.com/click/5fbc498f96d2d4ea0e6c7a3e8dc788e2/1.0.img.120x60/?yud=&encver=${ENC_VERSION}&encalgo=${ENC_ALGO}&app=apt&intf=1" target="_blank"><img width="120" height="60" border="0" src="https://ad.wsod.com/embed/5fbc498f96d2d4ea0e6c7a3e8dc788e2/1.0.img.120x60/1400030096.781844?yud=smpv%3d3%26ed%3dKfb2BHkzZLF3yh3sUja2DRXi3LZjugk7yJsheWWxeT5uV9SYCdYQ_446QvaEZCyKSLrr70o.Nc5oZrJI1hhOOlXySheUe71FhRajF7TpCt5ebu6ZIxKQApIwdwXxA6rAH8Bwnom0wUOOZ.nGrfoUtSeMHI3EhDtLkRH6oUn3&encver=1&encalgo=3DES-CFB-SHA1&app=apt&intf=1&" /></a></NOSCRIPT>
+
+<img src="https://adfarm.mediaplex.com/ad/tr/17113-191624-6548-18?mpt=1400030096.781844" border="0" width=1 height=1><!--QYZ 2080545051,3994715551,98.139.115.231;;FB2;28951412;1;--><script language=javascript>
+if(window.xzq_d==null)window.xzq_d=new Object();
+window.xzq_d['LXpyn2KLc24-']='(as$12raq9u7f,aid$LXpyn2KLc24-,bi$2080545051,cr$3994715551,ct$25,at$H,eob$gd1_match_id=-1:ypos=FB2)';
+</script><noscript><img width=1 height=1 alt="" src="http://csc.beap.bc.yahoo.com/yi?bv=1.0.0&bs=(134t1g972(gid$rTP7AzIwNi5Ye_pbUo7O_gAlMTA4LlNyw4___xMA,st$1400030096722431,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3&al=(as$12raq9u7f,aid$LXpyn2KLc24-,bi$2080545051,cr$3994715551,ct$25,at$H,eob$gd1_match_id=-1:ypos=FB2)"></noscript></span></td><td align="center"><!--ADS:LOCATION=FB2--><span id="yfs_ad_n4FB2" ><!--Vendor: Insight Express, Format: Pixel, IO: -->
+<img src="https://secure.insightexpressai.com/adServer/adServerESI.aspx?bannerID=252561&script=false&redir=https://secure.insightexpressai.com/adserver/1pixel.gif"style="display: none;"><span id="flash-span"></span><div id="ad_1023532551_1397669580096_1400030096.782483"></div><script>var flashAd_config = {ad_config: {ad_type: 'apt_ad',target: '_blank',div: "ad_1023532551_1397669580096_1400030096.782483",flashver: '9',swf: 'http://ads.yldmgrimg.net/apex/mediastore/7ee30344-9b5f-479c-91ed-1b5a29e17715',altURL: 'http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3czNvdmxzaChnaWQkclRQN0F6SXdOaTVZZV9wYlVvN09fZ0FsTVRBNExsTnl3NF9fX3hNQSxzdCQxNDAwMDMwMDk2NzIyNDMxLHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkNDAwNjQ5OTA1MSx2JDIuMCxhaWQkRHBWeW4yS0xjMjQtLGN0JDI1LHlieCRXMC5kd2ZDcWVkM3RPT1Q3enJfMExRLGJpJDIwOTQ5OTk1NTEsbW1lJDg4MzIyNzQwNDYxNTg1OTM0NzgsciQwLGlkJGFsdGltZyxyZCQxMWtsMnZmaWEseW9vJDEsYWdwJDMxOTU5OTg1NTEsYXAkRkIyKSk/1/*https://ad.doubleclick.net/clk;280787674;106346158;s',altimg: 'http://ads.yldmgrimg.net/apex/mediastore/6922df5b-e98f-43fc-b9b3-729d9734c809',width: 120,height: 60,flash_vars: ['clickTAG', 'http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3cjh0ajB2aChnaWQkclRQN0F6SXdOaTVZZV9wYlVvN09fZ0FsTVRBNExsTnl3NF9fX3hNQSxzdCQxNDAwMDMwMDk2NzIyNDMxLHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkNDAwNjQ5OTA1MSx2JDIuMCxhaWQkRHBWeW4yS0xjMjQtLGN0JDI1LHlieCRXMC5kd2ZDcWVkM3RPT1Q3enJfMExRLGJpJDIwOTQ5OTk1NTEsbW1lJDg4MzIyNzQwNDYxNTg1OTM0NzgsciQxLGlkJGZsYXNoLHJkJDExa2wydmZpYSx5b28kMSxhZ3AkMzE5NTk5ODU1MSxhcCRGQjIpKQ/2/*https://ad.doubleclick.net/clk;280787674;106346158;s']}};</script><script src="http://ads.yldmgrimg.net/apex/template/swfobject.js"></script><script src="http://ads.yldmgrimg.net/apex/template/a_081610.js"></script><noscript><a href="http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3dXZxN2c2MihnaWQkclRQN0F6SXdOaTVZZV9wYlVvN09fZ0FsTVRBNExsTnl3NF9fX3hNQSxzdCQxNDAwMDMwMDk2NzIyNDMxLHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkNDAwNjQ5OTA1MSx2JDIuMCxhaWQkRHBWeW4yS0xjMjQtLGN0JDI1LHlieCRXMC5kd2ZDcWVkM3RPT1Q3enJfMExRLGJpJDIwOTQ5OTk1NTEsbW1lJDg4MzIyNzQwNDYxNTg1OTM0NzgsciQyLGlkJG5vc2NyaXB0LHJkJDExa2wydmZpYSx5b28kMSxhZ3AkMzE5NTk5ODU1MSxhcCRGQjIpKQ/2/*https://ad.doubleclick.net/clk;280787674;106346158;s" target="_blank"><img src="http://ads.yldmgrimg.net/apex/mediastore/6922df5b-e98f-43fc-b9b3-729d9734c809" width="120" height="60" border="0"></a></noscript><!--QYZ 2094999551,4006499051,98.139.115.231;;FB2;28951412;1;--><script language=javascript>
+if(window.xzq_d==null)window.xzq_d=new Object();
+window.xzq_d['DpVyn2KLc24-']='(as$12rdofqsl,aid$DpVyn2KLc24-,bi$2094999551,cr$4006499051,ct$25,at$H,eob$gd1_match_id=-1:ypos=FB2)';
+</script><noscript><img width=1 height=1 alt="" src="http://csc.beap.bc.yahoo.com/yi?bv=1.0.0&bs=(134t1g972(gid$rTP7AzIwNi5Ye_pbUo7O_gAlMTA4LlNyw4___xMA,st$1400030096722431,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3&al=(as$12rdofqsl,aid$DpVyn2KLc24-,bi$2094999551,cr$4006499051,ct$25,at$H,eob$gd1_match_id=-1:ypos=FB2)"></noscript></span></td><td align="center"><!--ADS:LOCATION=FB2--><span id="yfs_ad_n4FB2" ><!-- APT Vendor: WSOD, Format: Polite in Page -->
+<script type="text/javascript" src="https://ad.wsod.com/embed/8bec9b10877d5d7fd7c0fb6e6a631357/1542.0.js.120x60/1400030096.783028?yud=smpv%3d3%26ed%3dKfb2BHkzZLF3yh3sUja2DRXi3LZjugk7yJsheWWxeT5uV9SYCdYQ_446QvaEZCyKSLrr70o.Nc5oZrJI1hhOOlXySheUe71FhRajF7TpCt5ebu6ZIxKQApIwdwXxA6rAH8Bwnom0wEo0lzSBo9UT9FujfvRZdPvCK5SvdF9L&encver=1&encalgo=3DES-CFB-SHA1&app=apt&intf=1&click=http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3NWJnZjR0dihnaWQkclRQN0F6SXdOaTVZZV9wYlVvN09fZ0FsTVRBNExsTnl3NF9fX3hNQSxzdCQxNDAwMDMwMDk2NzIyNDMxLHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkNDAwNjQ5MDA1MSx2JDIuMCxhaWQkNzY5eW4yS0xjMjQtLGN0JDI1LHlieCRXMC5kd2ZDcWVkM3RPT1Q3enJfMExRLGJpJDIwOTQ5OTU1NTEsbW1lJDg4MzIxNzA5NjY5NDM0ODk0NDIsciQwLHlvbyQxLGFncCQzMTk1OTM2NTUxLGFwJEZCMikp/0/*"></script><NOSCRIPT><a href="http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3aXZyMzBmcyhnaWQkclRQN0F6SXdOaTVZZV9wYlVvN09fZ0FsTVRBNExsTnl3NF9fX3hNQSxzdCQxNDAwMDMwMDk2NzIyNDMxLHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkNDAwNjQ5MDA1MSx2JDIuMCxhaWQkNzY5eW4yS0xjMjQtLGN0JDI1LHlieCRXMC5kd2ZDcWVkM3RPT1Q3enJfMExRLGJpJDIwOTQ5OTU1NTEsbW1lJDg4MzIxNzA5NjY5NDM0ODk0NDIsciQxLHJkJDE0YnQ3b2dwYix5b28kMSxhZ3AkMzE5NTkzNjU1MSxhcCRGQjIpKQ/2/*https://ad.wsod.com/click/8bec9b10877d5d7fd7c0fb6e6a631357/1542.0.img.120x60/?yud=&encver=${ENC_VERSION}&encalgo=${ENC_ALGO}&app=apt&intf=1" target="_blank"><img width="120" height="60" border="0" src="https://ad.wsod.com/embed/8bec9b10877d5d7fd7c0fb6e6a631357/1542.0.img.120x60/1400030096.783028?yud=smpv%3d3%26ed%3dKfb2BHkzZLF3yh3sUja2DRXi3LZjugk7yJsheWWxeT5uV9SYCdYQ_446QvaEZCyKSLrr70o.Nc5oZrJI1hhOOlXySheUe71FhRajF7TpCt5ebu6ZIxKQApIwdwXxA6rAH8Bwnom0wEo0lzSBo9UT9FujfvRZdPvCK5SvdF9L&encver=1&encalgo=3DES-CFB-SHA1&app=apt&intf=1&" /></a></NOSCRIPT><!--QYZ 2094995551,4006490051,98.139.115.231;;FB2;28951412;1;--><script language=javascript>
+if(window.xzq_d==null)window.xzq_d=new Object();
+window.xzq_d['769yn2KLc24-']='(as$12r8mkgmk,aid$769yn2KLc24-,bi$2094995551,cr$4006490051,ct$25,at$H,eob$gd1_match_id=-1:ypos=FB2)';
+</script><noscript><img width=1 height=1 alt="" src="http://csc.beap.bc.yahoo.com/yi?bv=1.0.0&bs=(134t1g972(gid$rTP7AzIwNi5Ye_pbUo7O_gAlMTA4LlNyw4___xMA,st$1400030096722431,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3&al=(as$12r8mkgmk,aid$769yn2KLc24-,bi$2094995551,cr$4006490051,ct$25,at$H,eob$gd1_match_id=-1:ypos=FB2)"></noscript></span></td><td align="center"><!--ADS:LOCATION=FB2--><span id="yfs_ad_n4FB2" ><img src="https://secure.insightexpressai.com/adServer/adServerESI.aspx?bannerID=253032&script=false&redir=https://secure.insightexpressai.com/adserver/1pixel.gif"style="display: none;"><a href="http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3aWVpZnAyMihnaWQkclRQN0F6SXdOaTVZZV9wYlVvN09fZ0FsTVRBNExsTnl3NF9fX3hNQSxzdCQxNDAwMDMwMDk2NzIyNDMxLHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkMzg4MDc4MDU1MSx2JDIuMCxhaWQkME1weW4yS0xjMjQtLGN0JDI1LHlieCRXMC5kd2ZDcWVkM3RPT1Q3enJfMExRLGJpJDIwMjM4NDUwNTEsbW1lJDg1MTM4NzA5NDA2MzY2MzU5NzUsciQwLHJkJDExa2FyaXJpbCx5b28kMSxhZ3AkMzA2OTk5NTA1MSxhcCRGQjIpKQ/2/*https://ad.doubleclick.net/clk;278245624;105342498;l" target="_blank"><img src="http://ads.yldmgrimg.net/apex/mediastore/4394c4b5-da06-4cb2-9d07-01a5d600e43f" alt="" title="" width=120 height=60 border=0/></a><!--QYZ 2023845051,3880780551,98.139.115.231;;FB2;28951412;1;--><script language=javascript>
+if(window.xzq_d==null)window.xzq_d=new Object();
+window.xzq_d['0Mpyn2KLc24-']='(as$12rs1142r,aid$0Mpyn2KLc24-,bi$2023845051,cr$3880780551,ct$25,at$H,eob$gd1_match_id=-1:ypos=FB2)';
+</script><noscript><img width=1 height=1 alt="" src="http://csc.beap.bc.yahoo.com/yi?bv=1.0.0&bs=(134t1g972(gid$rTP7AzIwNi5Ye_pbUo7O_gAlMTA4LlNyw4___xMA,st$1400030096722431,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3&al=(as$12rs1142r,aid$0Mpyn2KLc24-,bi$2023845051,cr$3880780551,ct$25,at$H,eob$gd1_match_id=-1:ypos=FB2)"></noscript></span></td></tr></table><br><div class="rtq_leaf"><div class="rtq_div"><div class="yui-g"><div class="yfi_rt_quote_summary" id="yfi_rt_quote_summary"><div class="hd"><div class="title"><h2>Apple Inc. (AAPL)</h2> <span class="rtq_exch"><span class="rtq_dash">-</span>NasdaqGS </span><span class="wl_sign"></span></div></div><div class="yfi_rt_quote_summary_rt_top sigfig_promo_1"><div> <span class="time_rtq_ticker"><span id="yfs_l84_aapl">593.76</span></span> <span class="up_g time_rtq_content"><span id="yfs_c63_aapl"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> 0.93</span><span id="yfs_p43_aapl">(0.16%)</span> </span><span class="time_rtq"> <span id="yfs_t53_aapl"><span id="yfs_t53_aapl">4:00PM EDT</span></span></span></div><div><span class="rtq_separator">|</span>After Hours
+ :
+ <span class="yfs_rtq_quote"><span id="yfs_l86_aapl">593.12</span></span> <span class="down_r"><span id="yfs_c85_aapl"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> 0.64</span> <span id="yfs_c86_aapl"> (0.11%)</span></span><span class="time_rtq"> <span id="yfs_t54_aapl">7:59PM EDT</span></span></div></div><style>
+ #yfi_toolbox_mini_rtq.sigfig_promo {
+ bottom:45px !important;
+ }
+ </style><div class="sigfig_promo" id="yfi_toolbox_mini_rtq"><div class="promo_text">Get the big picture on all your investments.</div><div class="promo_link"><a href="https://finance.yahoo.com/portfolio/ytosv2">Sync your Yahoo portfolio now</a></div></div></div></div></div></div><table width="580" id="yfncsumtab" cellpadding="0" cellspacing="0" border="0"><tr><td colspan="3"><table border="0" cellspacing="0" class="yfnc_modtitle1" style="border-bottom:1px solid #dcdcdc; margin-bottom:10px; width:100%;"><form action="/q/op" accept-charset="utf-8"><tr><td><big><b>Options</b></big></td><td align="right"><small><b>Get Options for:</b> <input name="s" id="pageTicker" size="10" /></small><input id="get_quote_logic_opt" name="ql" value="1" type="hidden" autocomplete="off"><input value="GO" type="submit" style="margin-left:3px;" class="rapid-nf"></td></tr></form></table></td></tr><tr valign="top"><td>View By Expiration: <a href="/q/op?s=AAPL&m=2014-05">May 14</a> | <strong>Jun 14</strong> | <a href="/q/op?s=AAPL&m=2014-07">Jul 14</a> | <a href="/q/op?s=AAPL&m=2014-08">Aug 14</a> | <a href="/q/op?s=AAPL&m=2014-10">Oct 14</a> | <a href="/q/op?s=AAPL&m=2015-01">Jan 15</a> | <a href="/q/op?s=AAPL&m=2016-01">Jan 16</a><table cellpadding="0" cellspacing="0" border="0"><tr><td height="2"></td></tr></table><table class="yfnc_mod_table_title1" width="100%" cellpadding="2" cellspacing="0" border="0"><tr valign="top"><td><small><b><strong class="yfi-module-title">Call Options</strong></b></small></td><td align="right">Expire at close Saturday, June 21, 2014</td></tr></table><table class="yfnc_datamodoutline1" width="100%" cellpadding="0" cellspacing="0" border="0"><tr valign="top"><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><th scope="col" class="yfnc_tablehead1" width="12%" align="left">Strike</th><th scope="col" class="yfnc_tablehead1" width="12%">Symbol</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Last</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Chg</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Bid</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Ask</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Vol</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Open Int</th></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=300.000000"><strong>300.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00300000">AAPL140621C00300000</a></td><td class="yfnc_h" align="right"><b>229.24</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00300000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">293.05</td><td class="yfnc_h" align="right">294.50</td><td class="yfnc_h" align="right">15</td><td class="yfnc_h" align="right">15</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=330.000000"><strong>330.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00330000">AAPL140621C00330000</a></td><td class="yfnc_h" align="right"><b>184.90</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00330000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">263.05</td><td class="yfnc_h" align="right">264.55</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=400.000000"><strong>400.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00400000">AAPL140621C00400000</a></td><td class="yfnc_h" align="right"><b>192.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00400000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">193.10</td><td class="yfnc_h" align="right">194.60</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">10</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=420.000000"><strong>420.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00420000">AAPL140621C00420000</a></td><td class="yfnc_h" align="right"><b>171.05</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00420000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">173.05</td><td class="yfnc_h" align="right">174.60</td><td class="yfnc_h" align="right">157</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=430.000000"><strong>430.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00430000">AAPL140621C00430000</a></td><td class="yfnc_h" align="right"><b>163.48</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00430000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.48</b></span></td><td class="yfnc_h" align="right">163.10</td><td class="yfnc_h" align="right">164.45</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">7</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=450.000000"><strong>450.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00450000">AAPL140621C00450000</a></td><td class="yfnc_h" align="right"><b>131.63</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00450000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">143.05</td><td class="yfnc_h" align="right">144.60</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">19</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=450.000000"><strong>450.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621C00450000">AAPL7140621C00450000</a></td><td class="yfnc_h" align="right"><b>112.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621c00450000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">142.00</td><td class="yfnc_h" align="right">145.80</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=460.000000"><strong>460.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00460000">AAPL140621C00460000</a></td><td class="yfnc_h" align="right"><b>131.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00460000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">133.10</td><td class="yfnc_h" align="right">134.55</td><td class="yfnc_h" align="right">136</td><td class="yfnc_h" align="right">21</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=465.000000"><strong>465.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00465000">AAPL140621C00465000</a></td><td class="yfnc_h" align="right"><b>124.20</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00465000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">128.15</td><td class="yfnc_h" align="right">129.55</td><td class="yfnc_h" align="right">146</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=470.000000"><strong>470.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00470000">AAPL140621C00470000</a></td><td class="yfnc_h" align="right"><b>122.85</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00470000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">123.15</td><td class="yfnc_h" align="right">124.45</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">56</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=475.000000"><strong>475.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00475000">AAPL140621C00475000</a></td><td class="yfnc_h" align="right"><b>115.90</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00475000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">118.10</td><td class="yfnc_h" align="right">119.55</td><td class="yfnc_h" align="right">195</td><td class="yfnc_h" align="right">11</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=475.000000"><strong>475.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621C00475000">AAPL7140621C00475000</a></td><td class="yfnc_h" align="right"><b>117.35</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621c00475000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">117.10</td><td class="yfnc_h" align="right">120.75</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=480.000000"><strong>480.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00480000">AAPL140621C00480000</a></td><td class="yfnc_h" align="right"><b>112.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00480000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">113.20</td><td class="yfnc_h" align="right">114.50</td><td class="yfnc_h" align="right">126</td><td class="yfnc_h" align="right">7</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=485.000000"><strong>485.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00485000">AAPL140621C00485000</a></td><td class="yfnc_h" align="right"><b>106.55</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00485000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">108.10</td><td class="yfnc_h" align="right">109.55</td><td class="yfnc_h" align="right">124</td><td class="yfnc_h" align="right">3</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=490.000000"><strong>490.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00490000">AAPL140621C00490000</a></td><td class="yfnc_h" align="right"><b>103.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00490000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.20</b></span></td><td class="yfnc_h" align="right">103.20</td><td class="yfnc_h" align="right">104.60</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">21</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=495.000000"><strong>495.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00495000">AAPL140621C00495000</a></td><td class="yfnc_h" align="right"><b>92.86</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00495000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">98.35</td><td class="yfnc_h" align="right">99.50</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">3</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=500.000000"><strong>500.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606C00500000">AAPL140606C00500000</a></td><td class="yfnc_h" align="right"><b>85.70</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606c00500000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">92.95</td><td class="yfnc_h" align="right">94.60</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">3</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=500.000000"><strong>500.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613C00500000">AAPL140613C00500000</a></td><td class="yfnc_h" align="right"><b>93.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613c00500000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.35</b></span></td><td class="yfnc_h" align="right">93.00</td><td class="yfnc_h" align="right">94.65</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">12</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=500.000000"><strong>500.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140613C00500000">AAPL7140613C00500000</a></td><td class="yfnc_h" align="right"><b>82.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140613c00500000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">91.95</td><td class="yfnc_h" align="right">95.80</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=500.000000"><strong>500.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00500000">AAPL140621C00500000</a></td><td class="yfnc_h" align="right"><b>94.60</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00500000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.70</b></span></td><td class="yfnc_h" align="right">93.40</td><td class="yfnc_h" align="right">94.55</td><td class="yfnc_h" align="right">4</td><td class="yfnc_h" align="right">615</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=500.000000"><strong>500.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621C00500000">AAPL7140621C00500000</a></td><td class="yfnc_h" align="right"><b>89.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621c00500000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">92.25</td><td class="yfnc_h" align="right">95.80</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">7</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=505.000000"><strong>505.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00505000">AAPL140621C00505000</a></td><td class="yfnc_h" align="right"><b>78.38</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00505000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">88.40</td><td class="yfnc_h" align="right">89.65</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">76</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=505.000000"><strong>505.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621C00505000">AAPL7140621C00505000</a></td><td class="yfnc_h" align="right"><b>97.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621c00505000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">87.25</td><td class="yfnc_h" align="right">90.65</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">10</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=510.000000"><strong>510.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00510000">AAPL140621C00510000</a></td><td class="yfnc_h" align="right"><b>83.20</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00510000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.30</b></span></td><td class="yfnc_h" align="right">83.35</td><td class="yfnc_h" align="right">84.70</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">152</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=510.000000"><strong>510.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621C00510000">AAPL7140621C00510000</a></td><td class="yfnc_h" align="right"><b>84.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621c00510000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">82.20</td><td class="yfnc_h" align="right">85.90</td><td class="yfnc_h" align="right">10</td><td class="yfnc_h" align="right">2</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=515.000000"><strong>515.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00515000">AAPL140621C00515000</a></td><td class="yfnc_h" align="right"><b>69.95</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00515000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">78.40</td><td class="yfnc_h" align="right">79.70</td><td class="yfnc_h" align="right">11</td><td class="yfnc_h" align="right">25</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=520.000000"><strong>520.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606C00520000">AAPL140606C00520000</a></td><td class="yfnc_h" align="right"><b>69.20</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606c00520000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">72.95</td><td class="yfnc_h" align="right">74.55</td><td class="yfnc_h" align="right">63</td><td class="yfnc_h" align="right">15</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=520.000000"><strong>520.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00520000">AAPL140621C00520000</a></td><td class="yfnc_h" align="right"><b>75.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00520000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.75</b></span></td><td class="yfnc_h" align="right">73.50</td><td class="yfnc_h" align="right">74.75</td><td class="yfnc_h" align="right">42</td><td class="yfnc_h" align="right">278</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=520.000000"><strong>520.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621C00520000">AAPL7140621C00520000</a></td><td class="yfnc_h" align="right"><b>71.80</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621c00520000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">72.25</td><td class="yfnc_h" align="right">75.70</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">21</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=525.000000"><strong>525.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00525000">AAPL140621C00525000</a></td><td class="yfnc_h" align="right"><b>66.90</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00525000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.45</b></span></td><td class="yfnc_h" align="right">68.60</td><td class="yfnc_h" align="right">69.85</td><td class="yfnc_h" align="right">10</td><td class="yfnc_h" align="right">199</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=525.000000"><strong>525.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621C00525000">AAPL7140621C00525000</a></td><td class="yfnc_h" align="right"><b>67.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621c00525000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">67.40</td><td class="yfnc_h" align="right">70.80</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">28</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=530.000000"><strong>530.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613C00530000">AAPL140613C00530000</a></td><td class="yfnc_h" align="right"><b>63.75</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613c00530000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">10.95</b></span></td><td class="yfnc_h" align="right">63.30</td><td class="yfnc_h" align="right">65.00</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">2</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=530.000000"><strong>530.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00530000">AAPL140621C00530000</a></td><td class="yfnc_h" align="right"><b>63.78</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00530000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.57</b></span></td><td class="yfnc_h" align="right">63.60</td><td class="yfnc_h" align="right">64.95</td><td class="yfnc_h" align="right">28</td><td class="yfnc_h" align="right">359</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=530.000000"><strong>530.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621C00530000">AAPL7140621C00530000</a></td><td class="yfnc_h" align="right"><b>64.80</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621c00530000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.75</b></span></td><td class="yfnc_h" align="right">62.45</td><td class="yfnc_h" align="right">65.80</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">26</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=535.000000"><strong>535.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00535000">AAPL140621C00535000</a></td><td class="yfnc_h" align="right"><b>59.40</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00535000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">2.90</b></span></td><td class="yfnc_h" align="right">58.80</td><td class="yfnc_h" align="right">60.10</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">155</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=535.000000"><strong>535.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621C00535000">AAPL7140621C00535000</a></td><td class="yfnc_h" align="right"><b>48.18</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621c00535000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">57.60</td><td class="yfnc_h" align="right">61.10</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">38</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=540.000000"><strong>540.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606C00540000">AAPL140606C00540000</a></td><td class="yfnc_h" align="right"><b>52.42</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606c00540000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">10.12</b></span></td><td class="yfnc_h" align="right">53.45</td><td class="yfnc_h" align="right">54.70</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">12</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=540.000000"><strong>540.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613C00540000">AAPL140613C00540000</a></td><td class="yfnc_h" align="right"><b>52.90</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613c00540000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">53.55</td><td class="yfnc_h" align="right">55.10</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=540.000000"><strong>540.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00540000">AAPL140621C00540000</a></td><td class="yfnc_h" align="right"><b>55.10</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00540000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.05</b></span></td><td class="yfnc_h" align="right">54.10</td><td class="yfnc_h" align="right">55.00</td><td class="yfnc_h" align="right">14</td><td class="yfnc_h" align="right">440</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=540.000000"><strong>540.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621C00540000">AAPL7140621C00540000</a></td><td class="yfnc_h" align="right"><b>54.80</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621c00540000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.20</b></span></td><td class="yfnc_h" align="right">53.25</td><td class="yfnc_h" align="right">56.30</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">7</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=545.000000"><strong>545.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606C00545000">AAPL140606C00545000</a></td><td class="yfnc_h" align="right"><b>43.42</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606c00545000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">48.40</td><td class="yfnc_h" align="right">49.70</td><td class="yfnc_h" align="right">30</td><td class="yfnc_h" align="right">10</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=545.000000"><strong>545.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00545000">AAPL140621C00545000</a></td><td class="yfnc_h" align="right"><b>50.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00545000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">2.00</b></span></td><td class="yfnc_h" align="right">49.45</td><td class="yfnc_h" align="right">50.55</td><td class="yfnc_h" align="right">5</td><td class="yfnc_h" align="right">622</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=545.000000"><strong>545.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621C00545000">AAPL7140621C00545000</a></td><td class="yfnc_h" align="right"><b>53.88</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621c00545000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">48.50</td><td class="yfnc_h" align="right">51.30</td><td class="yfnc_h" align="right">15</td><td class="yfnc_h" align="right">33</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=545.000000"><strong>545.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140627C00545000">AAPL140627C00545000</a></td><td class="yfnc_h" align="right"><b>41.70</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140627c00545000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">49.75</td><td class="yfnc_h" align="right">51.10</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=550.000000"><strong>550.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606C00550000">AAPL140606C00550000</a></td><td class="yfnc_h" align="right"><b>44.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606c00550000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.00</b></span></td><td class="yfnc_h" align="right">43.70</td><td class="yfnc_h" align="right">44.85</td><td class="yfnc_h" align="right">72</td><td class="yfnc_h" align="right">97</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=550.000000"><strong>550.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613C00550000">AAPL140613C00550000</a></td><td class="yfnc_h" align="right"><b>44.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613c00550000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.50</b></span></td><td class="yfnc_h" align="right">44.25</td><td class="yfnc_h" align="right">45.65</td><td class="yfnc_h" align="right">4</td><td class="yfnc_h" align="right">22</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=550.000000"><strong>550.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00550000">AAPL140621C00550000</a></td><td class="yfnc_h" align="right"><b>45.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00550000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.50</b></span></td><td class="yfnc_h" align="right">44.75</td><td class="yfnc_h" align="right">45.70</td><td class="yfnc_h" align="right">39</td><td class="yfnc_h" align="right">2,403</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=550.000000"><strong>550.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621C00550000">AAPL7140621C00550000</a></td><td class="yfnc_h" align="right"><b>45.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621c00550000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">8.50</b></span></td><td class="yfnc_h" align="right">44.10</td><td class="yfnc_h" align="right">46.60</td><td class="yfnc_h" align="right">5</td><td class="yfnc_h" align="right">223</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=550.000000"><strong>550.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140627C00550000">AAPL140627C00550000</a></td><td class="yfnc_h" align="right"><b>43.80</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140627c00550000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">45.25</td><td class="yfnc_h" align="right">46.60</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">2</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=555.000000"><strong>555.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606C00555000">AAPL140606C00555000</a></td><td class="yfnc_h" align="right"><b>34.53</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606c00555000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">38.70</td><td class="yfnc_h" align="right">40.00</td><td class="yfnc_h" align="right">99</td><td class="yfnc_h" align="right">10</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=555.000000"><strong>555.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613C00555000">AAPL140613C00555000</a></td><td class="yfnc_h" align="right"><b>38.72</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613c00555000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">4.87</b></span></td><td class="yfnc_h" align="right">39.70</td><td class="yfnc_h" align="right">41.20</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=555.000000"><strong>555.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00555000">AAPL140621C00555000</a></td><td class="yfnc_h" align="right"><b>40.75</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00555000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.95</b></span></td><td class="yfnc_h" align="right">40.40</td><td class="yfnc_h" align="right">41.35</td><td class="yfnc_h" align="right">28</td><td class="yfnc_h" align="right">885</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=555.000000"><strong>555.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621C00555000">AAPL7140621C00555000</a></td><td class="yfnc_h" align="right"><b>39.01</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621c00555000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">39.85</td><td class="yfnc_h" align="right">42.15</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">126</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606C00560000">AAPL140606C00560000</a></td><td class="yfnc_h" align="right"><b>33.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606c00560000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.50</b></span></td><td class="yfnc_h" align="right">34.10</td><td class="yfnc_h" align="right">35.30</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">84</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613C00560000">AAPL140613C00560000</a></td><td class="yfnc_h" align="right"><b>35.31</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613c00560000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.04</b></span></td><td class="yfnc_h" align="right">35.35</td><td class="yfnc_h" align="right">36.45</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">117</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140613C00560000">AAPL7140613C00560000</a></td><td class="yfnc_h" align="right"><b>33.20</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140613c00560000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">34.60</td><td class="yfnc_h" align="right">36.90</td><td class="yfnc_h" align="right">4</td><td class="yfnc_h" align="right">4</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00560000">AAPL140621C00560000</a></td><td class="yfnc_h" align="right"><b>35.75</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00560000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.25</b></span></td><td class="yfnc_h" align="right">36.05</td><td class="yfnc_h" align="right">37.00</td><td class="yfnc_h" align="right">20</td><td class="yfnc_h" align="right">2,934</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621C00560000">AAPL7140621C00560000</a></td><td class="yfnc_h" align="right"><b>35.90</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621c00560000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.25</b></span></td><td class="yfnc_h" align="right">35.25</td><td class="yfnc_h" align="right">37.50</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">556</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140627C00560000">AAPL140627C00560000</a></td><td class="yfnc_h" align="right"><b>34.25</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140627c00560000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">36.55</td><td class="yfnc_h" align="right">38.00</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">3</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=562.500000"><strong>562.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606C00562500">AAPL140606C00562500</a></td><td class="yfnc_h" align="right"><b>30.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606c00562500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">31.85</td><td class="yfnc_h" align="right">33.00</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">124</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=562.500000"><strong>562.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140606C00562500">AAPL7140606C00562500</a></td><td class="yfnc_h" align="right"><b>23.25</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140606c00562500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">30.80</td><td class="yfnc_h" align="right">34.05</td><td class="yfnc_h" align="right">9</td><td class="yfnc_h" align="right">9</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606C00565000">AAPL140606C00565000</a></td><td class="yfnc_h" align="right"><b>29.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606c00565000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.50</b></span></td><td class="yfnc_h" align="right">29.65</td><td class="yfnc_h" align="right">30.70</td><td class="yfnc_h" align="right">8</td><td class="yfnc_h" align="right">455</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140606C00565000">AAPL7140606C00565000</a></td><td class="yfnc_h" align="right"><b>29.80</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140606c00565000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">7.77</b></span></td><td class="yfnc_h" align="right">29.15</td><td class="yfnc_h" align="right">31.80</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">13</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613C00565000">AAPL140613C00565000</a></td><td class="yfnc_h" align="right"><b>29.75</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613c00565000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">31.05</td><td class="yfnc_h" align="right">32.15</td><td class="yfnc_h" align="right">6</td><td class="yfnc_h" align="right">27</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140613C00565000">AAPL7140613C00565000</a></td><td class="yfnc_h" align="right"><b>35.60</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140613c00565000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">30.40</td><td class="yfnc_h" align="right">32.65</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">2</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00565000">AAPL140621C00565000</a></td><td class="yfnc_h" align="right"><b>31.90</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00565000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.50</b></span></td><td class="yfnc_h" align="right">31.70</td><td class="yfnc_h" align="right">32.80</td><td class="yfnc_h" align="right">41</td><td class="yfnc_h" align="right">1,573</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621C00565000">AAPL7140621C00565000</a></td><td class="yfnc_h" align="right"><b>32.41</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621c00565000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">31.60</td><td class="yfnc_h" align="right">33.50</td><td class="yfnc_h" align="right">6</td><td class="yfnc_h" align="right">387</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=567.500000"><strong>567.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613C00567500">AAPL140613C00567500</a></td><td class="yfnc_h" align="right"><b>27.60</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613c00567500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">28.90</td><td class="yfnc_h" align="right">30.10</td><td class="yfnc_h" align="right">10</td><td class="yfnc_h" align="right">9</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606C00570000">AAPL140606C00570000</a></td><td class="yfnc_h" align="right"><b>26.36</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606c00570000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.46</b></span></td><td class="yfnc_h" align="right">25.55</td><td class="yfnc_h" align="right">26.05</td><td class="yfnc_h" align="right">12</td><td class="yfnc_h" align="right">319</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140606C00570000">AAPL7140606C00570000</a></td><td class="yfnc_h" align="right"><b>18.40</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140606c00570000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">24.20</td><td class="yfnc_h" align="right">26.90</td><td class="yfnc_h" align="right">4</td><td class="yfnc_h" align="right">19</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613C00570000">AAPL140613C00570000</a></td><td class="yfnc_h" align="right"><b>27.49</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613c00570000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">26.80</td><td class="yfnc_h" align="right">28.05</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">13</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00570000">AAPL140621C00570000</a></td><td class="yfnc_h" align="right"><b>28.30</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00570000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.77</b></span></td><td class="yfnc_h" align="right">28.30</td><td class="yfnc_h" align="right">28.50</td><td class="yfnc_h" align="right">2,432</td><td class="yfnc_h" align="right">4,953</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621C00570000">AAPL7140621C00570000</a></td><td class="yfnc_h" align="right"><b>29.60</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621c00570000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">1.60</b></span></td><td class="yfnc_h" align="right">27.40</td><td class="yfnc_h" align="right">28.85</td><td class="yfnc_h" align="right">6</td><td class="yfnc_h" align="right">655</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140627C00570000">AAPL140627C00570000</a></td><td class="yfnc_h" align="right"><b>22.70</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140627c00570000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">28.90</td><td class="yfnc_h" align="right">29.90</td><td class="yfnc_h" align="right">5</td><td class="yfnc_h" align="right">10</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=572.500000"><strong>572.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613C00572500">AAPL140613C00572500</a></td><td class="yfnc_h" align="right"><b>25.94</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613c00572500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">3.19</b></span></td><td class="yfnc_h" align="right">24.95</td><td class="yfnc_h" align="right">26.05</td><td class="yfnc_h" align="right">20</td><td class="yfnc_h" align="right">12</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606C00575000">AAPL140606C00575000</a></td><td class="yfnc_h" align="right"><b>21.20</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606c00575000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.30</b></span></td><td class="yfnc_h" align="right">21.15</td><td class="yfnc_h" align="right">21.95</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">439</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140606C00575000">AAPL7140606C00575000</a></td><td class="yfnc_h" align="right"><b>25.30</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140606c00575000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">20.50</td><td class="yfnc_h" align="right">22.95</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">6</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613C00575000">AAPL140613C00575000</a></td><td class="yfnc_h" align="right"><b>23.75</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613c00575000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.50</b></span></td><td class="yfnc_h" align="right">23.40</td><td class="yfnc_h" align="right">24.20</td><td class="yfnc_h" align="right">13</td><td class="yfnc_h" align="right">30</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00575000">AAPL140621C00575000</a></td><td class="yfnc_h" align="right"><b>24.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00575000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.65</b></span></td><td class="yfnc_h" align="right">24.60</td><td class="yfnc_h" align="right">24.85</td><td class="yfnc_h" align="right">201</td><td class="yfnc_h" align="right">2,135</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621C00575000">AAPL7140621C00575000</a></td><td class="yfnc_h" align="right"><b>24.93</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621c00575000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.93</b></span></td><td class="yfnc_h" align="right">24.30</td><td class="yfnc_h" align="right">25.25</td><td class="yfnc_h" align="right">4</td><td class="yfnc_h" align="right">384</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=577.500000"><strong>577.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613C00577500">AAPL140613C00577500</a></td><td class="yfnc_h" align="right"><b>20.85</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613c00577500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">21.30</td><td class="yfnc_h" align="right">22.05</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">10</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606C00580000">AAPL140606C00580000</a></td><td class="yfnc_h" align="right"><b>18.20</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606c00580000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.20</b></span></td><td class="yfnc_h" align="right">17.70</td><td class="yfnc_h" align="right">18.15</td><td class="yfnc_h" align="right">12</td><td class="yfnc_h" align="right">433</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140606C00580000">AAPL7140606C00580000</a></td><td class="yfnc_h" align="right"><b>16.95</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140606c00580000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">16.70</td><td class="yfnc_h" align="right">19.15</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">14</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613C00580000">AAPL140613C00580000</a></td><td class="yfnc_h" align="right"><b>20.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613c00580000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">19.65</td><td class="yfnc_h" align="right">20.45</td><td class="yfnc_h" align="right">51</td><td class="yfnc_h" align="right">82</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00580000">AAPL140621C00580000</a></td><td class="yfnc_h" align="right"><b>20.95</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00580000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.60</b></span></td><td class="yfnc_h" align="right">21.15</td><td class="yfnc_h" align="right">21.40</td><td class="yfnc_h" align="right">523</td><td class="yfnc_h" align="right">3,065</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621C00580000">AAPL7140621C00580000</a></td><td class="yfnc_h" align="right"><b>21.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621c00580000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.15</b></span></td><td class="yfnc_h" align="right">20.95</td><td class="yfnc_h" align="right">21.80</td><td class="yfnc_h" align="right">4</td><td class="yfnc_h" align="right">246</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140627C00580000">AAPL140627C00580000</a></td><td class="yfnc_h" align="right"><b>22.40</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140627c00580000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.20</b></span></td><td class="yfnc_h" align="right">21.80</td><td class="yfnc_h" align="right">22.55</td><td class="yfnc_h" align="right">30</td><td class="yfnc_h" align="right">47</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=582.500000"><strong>582.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613C00582500">AAPL140613C00582500</a></td><td class="yfnc_h" align="right"><b>13.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613c00582500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">18.05</td><td class="yfnc_h" align="right">18.75</td><td class="yfnc_h" align="right">6</td><td class="yfnc_h" align="right">7</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=582.500000"><strong>582.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140613C00582500">AAPL7140613C00582500</a></td><td class="yfnc_h" align="right"><b>15.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140613c00582500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">16.80</td><td class="yfnc_h" align="right">19.70</td><td class="yfnc_h" align="right">30</td><td class="yfnc_h" align="right">30</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=582.500000"><strong>582.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140627C00582500">AAPL140627C00582500</a></td><td class="yfnc_h" align="right"><b>20.95</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140627c00582500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">20.35</td><td class="yfnc_h" align="right">21.00</td><td class="yfnc_h" align="right">4</td><td class="yfnc_h" align="right">9</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606C00585000">AAPL140606C00585000</a></td><td class="yfnc_h" align="right"><b>14.25</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606c00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.85</b></span></td><td class="yfnc_h" align="right">14.40</td><td class="yfnc_h" align="right">14.70</td><td class="yfnc_h" align="right">19</td><td class="yfnc_h" align="right">372</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140606C00585000">AAPL7140606C00585000</a></td><td class="yfnc_h" align="right"><b>14.14</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140606c00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.08</b></span></td><td class="yfnc_h" align="right">13.45</td><td class="yfnc_h" align="right">15.65</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">28</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613C00585000">AAPL140613C00585000</a></td><td class="yfnc_h" align="right"><b>17.25</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613c00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.85</b></span></td><td class="yfnc_h" align="right">16.45</td><td class="yfnc_h" align="right">17.15</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">177</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00585000">AAPL140621C00585000</a></td><td class="yfnc_h" align="right"><b>17.90</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.03</b></span></td><td class="yfnc_h" align="right">18.10</td><td class="yfnc_h" align="right">18.25</td><td class="yfnc_h" align="right">161</td><td class="yfnc_h" align="right">2,407</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621C00585000">AAPL7140621C00585000</a></td><td class="yfnc_h" align="right"><b>17.85</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621c00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.65</b></span></td><td class="yfnc_h" align="right">17.85</td><td class="yfnc_h" align="right">18.60</td><td class="yfnc_h" align="right">99</td><td class="yfnc_h" align="right">304</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140627C00585000">AAPL140627C00585000</a></td><td class="yfnc_h" align="right"><b>19.55</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140627c00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.43</b></span></td><td class="yfnc_h" align="right">18.85</td><td class="yfnc_h" align="right">19.45</td><td class="yfnc_h" align="right">5</td><td class="yfnc_h" align="right">11</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=587.500000"><strong>587.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613C00587500">AAPL140613C00587500</a></td><td class="yfnc_h" align="right"><b>15.65</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613c00587500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">15.05</td><td class="yfnc_h" align="right">15.65</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">34</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=587.500000"><strong>587.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140613C00587500">AAPL7140613C00587500</a></td><td class="yfnc_h" align="right"><b>14.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140613c00587500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">14.70</td><td class="yfnc_h" align="right">16.75</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">22</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=587.500000"><strong>587.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140627C00587500">AAPL140627C00587500</a></td><td class="yfnc_h" align="right"><b>17.10</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140627c00587500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">17.50</td><td class="yfnc_h" align="right">18.00</td><td class="yfnc_h" align="right">6</td><td class="yfnc_h" align="right">27</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606C00590000">AAPL140606C00590000</a></td><td class="yfnc_h" align="right"><b>11.05</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606c00590000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.90</b></span></td><td class="yfnc_h" align="right">11.35</td><td class="yfnc_h" align="right">11.70</td><td class="yfnc_h" align="right">55</td><td class="yfnc_h" align="right">1,297</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140606C00590000">AAPL7140606C00590000</a></td><td class="yfnc_h" align="right"><b>11.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140606c00590000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.87</b></span></td><td class="yfnc_h" align="right">10.20</td><td class="yfnc_h" align="right">12.40</td><td class="yfnc_h" align="right">6</td><td class="yfnc_h" align="right">45</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613C00590000">AAPL140613C00590000</a></td><td class="yfnc_h" align="right"><b>14.10</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613c00590000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.37</b></span></td><td class="yfnc_h" align="right">13.65</td><td class="yfnc_h" align="right">14.25</td><td class="yfnc_h" align="right">38</td><td class="yfnc_h" align="right">448</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621C00590000">AAPL140621C00590000</a></td><td class="yfnc_h" align="right"><b>15.15</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621c00590000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.59</b></span></td><td class="yfnc_h" align="right">15.25</td><td class="yfnc_h" align="right">15.40</td><td class="yfnc_h" align="right">618</td><td class="yfnc_h" align="right">14,296</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621C00590000">AAPL7140621C00590000</a></td><td class="yfnc_h" align="right"><b>15.20</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621c00590000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.80</b></span></td><td class="yfnc_h" align="right">15.05</td><td class="yfnc_h" align="right">15.85</td><td class="yfnc_h" align="right">19</td><td class="yfnc_h" align="right">230</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140627C00590000">AAPL140627C00590000</a></td><td class="yfnc_h" align="right"><b>16.35</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140627c00590000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.95</b></span></td><td class="yfnc_h" align="right">16.15</td><td class="yfnc_h" align="right">16.65</td><td class="yfnc_h" align="right">20</td><td class="yfnc_h" align="right">57</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140627C00590000">AAPL7140627C00590000</a></td><td class="yfnc_h" align="right"><b>14.13</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140627c00590000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">15.00</td><td class="yfnc_h" align="right">17.55</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">3</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=592.500000"><strong>592.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613C00592500">AAPL140613C00592500</a></td><td class="yfnc_h" align="right"><b>12.60</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613c00592500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.35</b></span></td><td class="yfnc_h" align="right">12.50</td><td class="yfnc_h" align="right">12.85</td><td class="yfnc_h" align="right">29</td><td class="yfnc_h" align="right">60</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=592.500000"><strong>592.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140613C00592500">AAPL7140613C00592500</a></td><td class="yfnc_h" align="right"><b>12.70</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140613c00592500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">2.50</b></span></td><td class="yfnc_h" align="right">12.15</td><td class="yfnc_h" align="right">14.35</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">3</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=592.500000"><strong>592.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140627C00592500">AAPL140627C00592500</a></td><td class="yfnc_h" align="right"><b>15.05</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140627c00592500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.65</b></span></td><td class="yfnc_h" align="right">14.80</td><td class="yfnc_h" align="right">15.30</td><td class="yfnc_h" align="right">40</td><td class="yfnc_h" align="right">12</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=592.500000"><strong>592.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140627C00592500">AAPL7140627C00592500</a></td><td class="yfnc_h" align="right"><b>14.80</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140627c00592500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">14.55</td><td class="yfnc_h" align="right">16.55</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">4</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606C00595000">AAPL140606C00595000</a></td><td class="yfnc_tabledata1" align="right"><b>8.78</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606c00595000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.52</b></span></td><td class="yfnc_tabledata1" align="right">8.80</td><td class="yfnc_tabledata1" align="right">9.05</td><td class="yfnc_tabledata1" align="right">315</td><td class="yfnc_tabledata1" align="right">1,315</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606C00595000">AAPL7140606C00595000</a></td><td class="yfnc_tabledata1" align="right"><b>9.17</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606c00595000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.67</b></span></td><td class="yfnc_tabledata1" align="right">8.20</td><td class="yfnc_tabledata1" align="right">10.15</td><td class="yfnc_tabledata1" align="right">42</td><td class="yfnc_tabledata1" align="right">83</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613C00595000">AAPL140613C00595000</a></td><td class="yfnc_tabledata1" align="right"><b>11.55</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613c00595000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.05</b></span></td><td class="yfnc_tabledata1" align="right">11.45</td><td class="yfnc_tabledata1" align="right">11.60</td><td class="yfnc_tabledata1" align="right">292</td><td class="yfnc_tabledata1" align="right">318</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613C00595000">AAPL7140613C00595000</a></td><td class="yfnc_tabledata1" align="right"><b>9.38</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613c00595000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">11.00</td><td class="yfnc_tabledata1" align="right">12.45</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">8</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00595000">AAPL140621C00595000</a></td><td class="yfnc_tabledata1" align="right"><b>12.54</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00595000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.66</b></span></td><td class="yfnc_tabledata1" align="right">12.65</td><td class="yfnc_tabledata1" align="right">12.85</td><td class="yfnc_tabledata1" align="right">857</td><td class="yfnc_tabledata1" align="right">2,741</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621C00595000">AAPL7140621C00595000</a></td><td class="yfnc_tabledata1" align="right"><b>13.25</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621c00595000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.25</b></span></td><td class="yfnc_tabledata1" align="right">12.45</td><td class="yfnc_tabledata1" align="right">13.35</td><td class="yfnc_tabledata1" align="right">17</td><td class="yfnc_tabledata1" align="right">317</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627C00595000">AAPL140627C00595000</a></td><td class="yfnc_tabledata1" align="right"><b>13.94</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627c00595000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.86</b></span></td><td class="yfnc_tabledata1" align="right">13.60</td><td class="yfnc_tabledata1" align="right">14.05</td><td class="yfnc_tabledata1" align="right">7</td><td class="yfnc_tabledata1" align="right">60</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140627C00595000">AAPL7140627C00595000</a></td><td class="yfnc_tabledata1" align="right"><b>14.24</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140627c00595000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.76</b></span></td><td class="yfnc_tabledata1" align="right">13.20</td><td class="yfnc_tabledata1" align="right">15.10</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">7</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=597.500000"><strong>597.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613C00597500">AAPL140613C00597500</a></td><td class="yfnc_tabledata1" align="right"><b>9.96</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613c00597500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">10.00</td><td class="yfnc_tabledata1" align="right">10.55</td><td class="yfnc_tabledata1" align="right">22</td><td class="yfnc_tabledata1" align="right">74</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=597.500000"><strong>597.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627C00597500">AAPL140627C00597500</a></td><td class="yfnc_tabledata1" align="right"><b>12.85</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627c00597500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">12.65</td><td class="yfnc_tabledata1" align="right">12.90</td><td class="yfnc_tabledata1" align="right">52</td><td class="yfnc_tabledata1" align="right">36</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606C00600000">AAPL140606C00600000</a></td><td class="yfnc_tabledata1" align="right"><b>6.70</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606c00600000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.40</b></span></td><td class="yfnc_tabledata1" align="right">6.65</td><td class="yfnc_tabledata1" align="right">6.90</td><td class="yfnc_tabledata1" align="right">323</td><td class="yfnc_tabledata1" align="right">1,841</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606C00600000">AAPL7140606C00600000</a></td><td class="yfnc_tabledata1" align="right"><b>6.75</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606c00600000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.80</b></span></td><td class="yfnc_tabledata1" align="right">6.55</td><td class="yfnc_tabledata1" align="right">7.10</td><td class="yfnc_tabledata1" align="right">15</td><td class="yfnc_tabledata1" align="right">179</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613C00600000">AAPL140613C00600000</a></td><td class="yfnc_tabledata1" align="right"><b>9.40</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613c00600000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.40</b></span></td><td class="yfnc_tabledata1" align="right">9.20</td><td class="yfnc_tabledata1" align="right">9.40</td><td class="yfnc_tabledata1" align="right">123</td><td class="yfnc_tabledata1" align="right">690</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613C00600000">AAPL7140613C00600000</a></td><td class="yfnc_tabledata1" align="right"><b>9.43</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613c00600000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.23</b></span></td><td class="yfnc_tabledata1" align="right">8.85</td><td class="yfnc_tabledata1" align="right">10.00</td><td class="yfnc_tabledata1" align="right">16</td><td class="yfnc_tabledata1" align="right">18</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00600000">AAPL140621C00600000</a></td><td class="yfnc_tabledata1" align="right"><b>10.55</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00600000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.50</b></span></td><td class="yfnc_tabledata1" align="right">10.50</td><td class="yfnc_tabledata1" align="right">10.60</td><td class="yfnc_tabledata1" align="right">827</td><td class="yfnc_tabledata1" align="right">8,816</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621C00600000">AAPL7140621C00600000</a></td><td class="yfnc_tabledata1" align="right"><b>10.15</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621c00600000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.85</b></span></td><td class="yfnc_tabledata1" align="right">10.20</td><td class="yfnc_tabledata1" align="right">11.00</td><td class="yfnc_tabledata1" align="right">68</td><td class="yfnc_tabledata1" align="right">416</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627C00600000">AAPL140627C00600000</a></td><td class="yfnc_tabledata1" align="right"><b>11.63</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627c00600000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.87</b></span></td><td class="yfnc_tabledata1" align="right">11.35</td><td class="yfnc_tabledata1" align="right">11.80</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">34</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140627C00600000">AAPL7140627C00600000</a></td><td class="yfnc_tabledata1" align="right"><b>9.22</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140627c00600000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">11.20</td><td class="yfnc_tabledata1" align="right">12.65</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=602.500000"><strong>602.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613C00602500">AAPL140613C00602500</a></td><td class="yfnc_tabledata1" align="right"><b>8.50</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613c00602500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">8.05</td><td class="yfnc_tabledata1" align="right">8.50</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">51</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=602.500000"><strong>602.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613C00602500">AAPL7140613C00602500</a></td><td class="yfnc_tabledata1" align="right"><b>6.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613c00602500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">8.05</td><td class="yfnc_tabledata1" align="right">8.50</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">3</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=605.000000"><strong>605.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606C00605000">AAPL140606C00605000</a></td><td class="yfnc_tabledata1" align="right"><b>5.03</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606c00605000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.27</b></span></td><td class="yfnc_tabledata1" align="right">4.90</td><td class="yfnc_tabledata1" align="right">5.10</td><td class="yfnc_tabledata1" align="right">476</td><td class="yfnc_tabledata1" align="right">849</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=605.000000"><strong>605.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606C00605000">AAPL7140606C00605000</a></td><td class="yfnc_tabledata1" align="right"><b>5.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606c00605000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">4.85</td><td class="yfnc_tabledata1" align="right">5.30</td><td class="yfnc_tabledata1" align="right">14</td><td class="yfnc_tabledata1" align="right">132</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=605.000000"><strong>605.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613C00605000">AAPL140613C00605000</a></td><td class="yfnc_tabledata1" align="right"><b>7.40</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613c00605000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.70</b></span></td><td class="yfnc_tabledata1" align="right">7.15</td><td class="yfnc_tabledata1" align="right">7.60</td><td class="yfnc_tabledata1" align="right">7</td><td class="yfnc_tabledata1" align="right">112</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=605.000000"><strong>605.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613C00605000">AAPL7140613C00605000</a></td><td class="yfnc_tabledata1" align="right"><b>7.80</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613c00605000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">7.15</td><td class="yfnc_tabledata1" align="right">9.00</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">9</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=605.000000"><strong>605.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00605000">AAPL140621C00605000</a></td><td class="yfnc_tabledata1" align="right"><b>8.45</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00605000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.60</b></span></td><td class="yfnc_tabledata1" align="right">8.50</td><td class="yfnc_tabledata1" align="right">8.60</td><td class="yfnc_tabledata1" align="right">419</td><td class="yfnc_tabledata1" align="right">2,326</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=605.000000"><strong>605.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621C00605000">AAPL7140621C00605000</a></td><td class="yfnc_tabledata1" align="right"><b>8.70</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621c00605000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">8.35</td><td class="yfnc_tabledata1" align="right">8.65</td><td class="yfnc_tabledata1" align="right">7</td><td class="yfnc_tabledata1" align="right">738</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=605.000000"><strong>605.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627C00605000">AAPL140627C00605000</a></td><td class="yfnc_tabledata1" align="right"><b>9.75</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627c00605000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.10</b></span></td><td class="yfnc_tabledata1" align="right">9.40</td><td class="yfnc_tabledata1" align="right">9.80</td><td class="yfnc_tabledata1" align="right">8</td><td class="yfnc_tabledata1" align="right">17</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=607.500000"><strong>607.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613C00607500">AAPL140613C00607500</a></td><td class="yfnc_tabledata1" align="right"><b>5.72</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613c00607500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">6.35</td><td class="yfnc_tabledata1" align="right">6.75</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">9</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=607.500000"><strong>607.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613C00607500">AAPL7140613C00607500</a></td><td class="yfnc_tabledata1" align="right"><b>10.25</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613c00607500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">6.35</td><td class="yfnc_tabledata1" align="right">6.75</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">4</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=607.500000"><strong>607.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627C00607500">AAPL140627C00607500</a></td><td class="yfnc_tabledata1" align="right"><b>9.64</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627c00607500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">8.55</td><td class="yfnc_tabledata1" align="right">8.90</td><td class="yfnc_tabledata1" align="right">6</td><td class="yfnc_tabledata1" align="right">19</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=610.000000"><strong>610.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606C00610000">AAPL140606C00610000</a></td><td class="yfnc_tabledata1" align="right"><b>3.65</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606c00610000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.55</b></span></td><td class="yfnc_tabledata1" align="right">3.55</td><td class="yfnc_tabledata1" align="right">3.70</td><td class="yfnc_tabledata1" align="right">648</td><td class="yfnc_tabledata1" align="right">924</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=610.000000"><strong>610.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606C00610000">AAPL7140606C00610000</a></td><td class="yfnc_tabledata1" align="right"><b>3.90</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606c00610000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.25</b></span></td><td class="yfnc_tabledata1" align="right">3.50</td><td class="yfnc_tabledata1" align="right">3.95</td><td class="yfnc_tabledata1" align="right">16</td><td class="yfnc_tabledata1" align="right">135</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=610.000000"><strong>610.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613C00610000">AAPL140613C00610000</a></td><td class="yfnc_tabledata1" align="right"><b>6.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613c00610000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.25</b></span></td><td class="yfnc_tabledata1" align="right">5.60</td><td class="yfnc_tabledata1" align="right">6.00</td><td class="yfnc_tabledata1" align="right">26</td><td class="yfnc_tabledata1" align="right">131</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=610.000000"><strong>610.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613C00610000">AAPL7140613C00610000</a></td><td class="yfnc_tabledata1" align="right"><b>9.70</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613c00610000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">5.60</td><td class="yfnc_tabledata1" align="right">6.00</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">10</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=610.000000"><strong>610.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00610000">AAPL140621C00610000</a></td><td class="yfnc_tabledata1" align="right"><b>6.75</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00610000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.64</b></span></td><td class="yfnc_tabledata1" align="right">6.85</td><td class="yfnc_tabledata1" align="right">7.00</td><td class="yfnc_tabledata1" align="right">497</td><td class="yfnc_tabledata1" align="right">2,521</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=610.000000"><strong>610.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621C00610000">AAPL7140621C00610000</a></td><td class="yfnc_tabledata1" align="right"><b>7.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621c00610000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.20</b></span></td><td class="yfnc_tabledata1" align="right">6.75</td><td class="yfnc_tabledata1" align="right">7.00</td><td class="yfnc_tabledata1" align="right">13</td><td class="yfnc_tabledata1" align="right">423</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=610.000000"><strong>610.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627C00610000">AAPL140627C00610000</a></td><td class="yfnc_tabledata1" align="right"><b>8.01</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627c00610000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.44</b></span></td><td class="yfnc_tabledata1" align="right">7.75</td><td class="yfnc_tabledata1" align="right">8.10</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">40</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=610.000000"><strong>610.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140627C00610000">AAPL7140627C00610000</a></td><td class="yfnc_tabledata1" align="right"><b>8.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140627c00610000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">7.55</td><td class="yfnc_tabledata1" align="right">9.10</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">3</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=612.500000"><strong>612.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613C00612500">AAPL140613C00612500</a></td><td class="yfnc_tabledata1" align="right"><b>5.80</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613c00612500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">4.90</td><td class="yfnc_tabledata1" align="right">5.35</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">45</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=612.500000"><strong>612.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613C00612500">AAPL7140613C00612500</a></td><td class="yfnc_tabledata1" align="right"><b>6.55</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613c00612500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">4.90</td><td class="yfnc_tabledata1" align="right">5.40</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">2</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=612.500000"><strong>612.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627C00612500">AAPL140627C00612500</a></td><td class="yfnc_tabledata1" align="right"><b>5.57</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627c00612500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">7.00</td><td class="yfnc_tabledata1" align="right">7.40</td><td class="yfnc_tabledata1" align="right">20</td><td class="yfnc_tabledata1" align="right">21</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=615.000000"><strong>615.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606C00615000">AAPL140606C00615000</a></td><td class="yfnc_tabledata1" align="right"><b>2.95</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606c00615000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.05</b></span></td><td class="yfnc_tabledata1" align="right">2.54</td><td class="yfnc_tabledata1" align="right">2.73</td><td class="yfnc_tabledata1" align="right">105</td><td class="yfnc_tabledata1" align="right">619</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=615.000000"><strong>615.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606C00615000">AAPL7140606C00615000</a></td><td class="yfnc_tabledata1" align="right"><b>2.82</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606c00615000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.17</b></span></td><td class="yfnc_tabledata1" align="right">2.42</td><td class="yfnc_tabledata1" align="right">2.83</td><td class="yfnc_tabledata1" align="right">8</td><td class="yfnc_tabledata1" align="right">135</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=615.000000"><strong>615.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613C00615000">AAPL140613C00615000</a></td><td class="yfnc_tabledata1" align="right"><b>4.80</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613c00615000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.20</b></span></td><td class="yfnc_tabledata1" align="right">4.35</td><td class="yfnc_tabledata1" align="right">4.75</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">51</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=615.000000"><strong>615.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00615000">AAPL140621C00615000</a></td><td class="yfnc_tabledata1" align="right"><b>5.40</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00615000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.60</b></span></td><td class="yfnc_tabledata1" align="right">5.45</td><td class="yfnc_tabledata1" align="right">5.55</td><td class="yfnc_tabledata1" align="right">247</td><td class="yfnc_tabledata1" align="right">1,992</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=615.000000"><strong>615.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621C00615000">AAPL7140621C00615000</a></td><td class="yfnc_tabledata1" align="right"><b>5.30</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621c00615000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">5.35</td><td class="yfnc_tabledata1" align="right">5.70</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">74</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=615.000000"><strong>615.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627C00615000">AAPL140627C00615000</a></td><td class="yfnc_tabledata1" align="right"><b>7.40</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627c00615000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">6.30</td><td class="yfnc_tabledata1" align="right">6.60</td><td class="yfnc_tabledata1" align="right">39</td><td class="yfnc_tabledata1" align="right">38</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=617.500000"><strong>617.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613C00617500">AAPL140613C00617500</a></td><td class="yfnc_tabledata1" align="right"><b>4.15</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613c00617500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.65</b></span></td><td class="yfnc_tabledata1" align="right">3.85</td><td class="yfnc_tabledata1" align="right">4.20</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">3</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=617.500000"><strong>617.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613C00617500">AAPL7140613C00617500</a></td><td class="yfnc_tabledata1" align="right"><b>6.45</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613c00617500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">3.80</td><td class="yfnc_tabledata1" align="right">4.15</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=617.500000"><strong>617.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627C00617500">AAPL140627C00617500</a></td><td class="yfnc_tabledata1" align="right"><b>4.60</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627c00617500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">5.60</td><td class="yfnc_tabledata1" align="right">5.95</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">21</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=617.500000"><strong>617.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140627C00617500">AAPL7140627C00617500</a></td><td class="yfnc_tabledata1" align="right"><b>4.55</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140627c00617500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">5.40</td><td class="yfnc_tabledata1" align="right">6.60</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">3</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=620.000000"><strong>620.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606C00620000">AAPL140606C00620000</a></td><td class="yfnc_tabledata1" align="right"><b>1.88</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606c00620000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.41</b></span></td><td class="yfnc_tabledata1" align="right">1.84</td><td class="yfnc_tabledata1" align="right">1.97</td><td class="yfnc_tabledata1" align="right">217</td><td class="yfnc_tabledata1" align="right">738</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=620.000000"><strong>620.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606C00620000">AAPL7140606C00620000</a></td><td class="yfnc_tabledata1" align="right"><b>2.00</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606c00620000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.60</b></span></td><td class="yfnc_tabledata1" align="right">1.78</td><td class="yfnc_tabledata1" align="right">2.15</td><td class="yfnc_tabledata1" align="right">18</td><td class="yfnc_tabledata1" align="right">46</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=620.000000"><strong>620.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613C00620000">AAPL140613C00620000</a></td><td class="yfnc_tabledata1" align="right"><b>3.50</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613c00620000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.55</b></span></td><td class="yfnc_tabledata1" align="right">3.35</td><td class="yfnc_tabledata1" align="right">3.70</td><td class="yfnc_tabledata1" align="right">16</td><td class="yfnc_tabledata1" align="right">140</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=620.000000"><strong>620.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613C00620000">AAPL7140613C00620000</a></td><td class="yfnc_tabledata1" align="right"><b>3.65</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613c00620000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.07</b></span></td><td class="yfnc_tabledata1" align="right">3.30</td><td class="yfnc_tabledata1" align="right">3.65</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">3</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=620.000000"><strong>620.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00620000">AAPL140621C00620000</a></td><td class="yfnc_tabledata1" align="right"><b>4.26</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00620000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.49</b></span></td><td class="yfnc_tabledata1" align="right">4.30</td><td class="yfnc_tabledata1" align="right">4.40</td><td class="yfnc_tabledata1" align="right">249</td><td class="yfnc_tabledata1" align="right">7,992</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=620.000000"><strong>620.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621C00620000">AAPL7140621C00620000</a></td><td class="yfnc_tabledata1" align="right"><b>4.60</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621c00620000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.35</b></span></td><td class="yfnc_tabledata1" align="right">4.20</td><td class="yfnc_tabledata1" align="right">4.45</td><td class="yfnc_tabledata1" align="right">9</td><td class="yfnc_tabledata1" align="right">226</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=620.000000"><strong>620.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627C00620000">AAPL140627C00620000</a></td><td class="yfnc_tabledata1" align="right"><b>5.48</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627c00620000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.27</b></span></td><td class="yfnc_tabledata1" align="right">5.05</td><td class="yfnc_tabledata1" align="right">5.40</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">76</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=620.000000"><strong>620.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140627C00620000">AAPL7140627C00620000</a></td><td class="yfnc_tabledata1" align="right"><b>4.00</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140627c00620000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">3.65</td><td class="yfnc_tabledata1" align="right">5.95</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">16</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=622.500000"><strong>622.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613C00622500">AAPL140613C00622500</a></td><td class="yfnc_tabledata1" align="right"><b>3.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613c00622500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.45</b></span></td><td class="yfnc_tabledata1" align="right">2.93</td><td class="yfnc_tabledata1" align="right">3.25</td><td class="yfnc_tabledata1" align="right">13</td><td class="yfnc_tabledata1" align="right">11</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=622.500000"><strong>622.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613C00622500">AAPL7140613C00622500</a></td><td class="yfnc_tabledata1" align="right"><b>3.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613c00622500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">2.90</td><td class="yfnc_tabledata1" align="right">3.30</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">2</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=622.500000"><strong>622.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140627C00622500">AAPL7140627C00622500</a></td><td class="yfnc_tabledata1" align="right"><b>4.60</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140627c00622500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">4.40</td><td class="yfnc_tabledata1" align="right">5.40</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=625.000000"><strong>625.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606C00625000">AAPL140606C00625000</a></td><td class="yfnc_tabledata1" align="right"><b>1.53</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606c00625000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.04</b></span></td><td class="yfnc_tabledata1" align="right">1.36</td><td class="yfnc_tabledata1" align="right">1.44</td><td class="yfnc_tabledata1" align="right">2,164</td><td class="yfnc_tabledata1" align="right">2,256</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=625.000000"><strong>625.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606C00625000">AAPL7140606C00625000</a></td><td class="yfnc_tabledata1" align="right"><b>1.50</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606c00625000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.50</b></span></td><td class="yfnc_tabledata1" align="right">1.30</td><td class="yfnc_tabledata1" align="right">1.48</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">29</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=625.000000"><strong>625.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613C00625000">AAPL140613C00625000</a></td><td class="yfnc_tabledata1" align="right"><b>2.75</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613c00625000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.45</b></span></td><td class="yfnc_tabledata1" align="right">2.58</td><td class="yfnc_tabledata1" align="right">2.84</td><td class="yfnc_tabledata1" align="right">13</td><td class="yfnc_tabledata1" align="right">54</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=625.000000"><strong>625.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613C00625000">AAPL7140613C00625000</a></td><td class="yfnc_tabledata1" align="right"><b>2.18</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613c00625000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">2.53</td><td class="yfnc_tabledata1" align="right">2.83</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">2</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=625.000000"><strong>625.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00625000">AAPL140621C00625000</a></td><td class="yfnc_tabledata1" align="right"><b>3.40</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00625000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.40</b></span></td><td class="yfnc_tabledata1" align="right">3.40</td><td class="yfnc_tabledata1" align="right">3.45</td><td class="yfnc_tabledata1" align="right">411</td><td class="yfnc_tabledata1" align="right">2,307</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=625.000000"><strong>625.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621C00625000">AAPL7140621C00625000</a></td><td class="yfnc_tabledata1" align="right"><b>3.64</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621c00625000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.11</b></span></td><td class="yfnc_tabledata1" align="right">3.20</td><td class="yfnc_tabledata1" align="right">3.60</td><td class="yfnc_tabledata1" align="right">9</td><td class="yfnc_tabledata1" align="right">230</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=625.000000"><strong>625.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627C00625000">AAPL140627C00625000</a></td><td class="yfnc_tabledata1" align="right"><b>4.40</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627c00625000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.20</b></span></td><td class="yfnc_tabledata1" align="right">4.10</td><td class="yfnc_tabledata1" align="right">4.35</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">28</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=625.000000"><strong>625.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140627C00625000">AAPL7140627C00625000</a></td><td class="yfnc_tabledata1" align="right"><b>4.42</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140627c00625000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.22</b></span></td><td class="yfnc_tabledata1" align="right">3.90</td><td class="yfnc_tabledata1" align="right">4.95</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=627.500000"><strong>627.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613C00627500">AAPL140613C00627500</a></td><td class="yfnc_tabledata1" align="right"><b>2.76</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613c00627500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">2.26</td><td class="yfnc_tabledata1" align="right">2.52</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">4</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=627.500000"><strong>627.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627C00627500">AAPL140627C00627500</a></td><td class="yfnc_tabledata1" align="right"><b>3.94</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627c00627500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.26</b></span></td><td class="yfnc_tabledata1" align="right">3.65</td><td class="yfnc_tabledata1" align="right">3.95</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">17</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=627.500000"><strong>627.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140627C00627500">AAPL7140627C00627500</a></td><td class="yfnc_tabledata1" align="right"><b>3.80</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140627c00627500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">3.45</td><td class="yfnc_tabledata1" align="right">4.40</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=630.000000"><strong>630.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606C00630000">AAPL140606C00630000</a></td><td class="yfnc_tabledata1" align="right"><b>1.01</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606c00630000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.13</b></span></td><td class="yfnc_tabledata1" align="right">0.95</td><td class="yfnc_tabledata1" align="right">1.07</td><td class="yfnc_tabledata1" align="right">139</td><td class="yfnc_tabledata1" align="right">409</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=630.000000"><strong>630.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606C00630000">AAPL7140606C00630000</a></td><td class="yfnc_tabledata1" align="right"><b>1.77</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606c00630000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.89</td><td class="yfnc_tabledata1" align="right">1.10</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">8</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=630.000000"><strong>630.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613C00630000">AAPL140613C00630000</a></td><td class="yfnc_tabledata1" align="right"><b>2.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613c00630000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.22</b></span></td><td class="yfnc_tabledata1" align="right">1.97</td><td class="yfnc_tabledata1" align="right">2.14</td><td class="yfnc_tabledata1" align="right">41</td><td class="yfnc_tabledata1" align="right">568</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=630.000000"><strong>630.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613C00630000">AAPL7140613C00630000</a></td><td class="yfnc_tabledata1" align="right"><b>5.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613c00630000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">1.97</td><td class="yfnc_tabledata1" align="right">2.18</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">3</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=630.000000"><strong>630.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00630000">AAPL140621C00630000</a></td><td class="yfnc_tabledata1" align="right"><b>2.69</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00630000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.38</b></span></td><td class="yfnc_tabledata1" align="right">2.68</td><td class="yfnc_tabledata1" align="right">2.73</td><td class="yfnc_tabledata1" align="right">732</td><td class="yfnc_tabledata1" align="right">5,019</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=630.000000"><strong>630.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621C00630000">AAPL7140621C00630000</a></td><td class="yfnc_tabledata1" align="right"><b>3.15</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621c00630000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">2.52</td><td class="yfnc_tabledata1" align="right">2.85</td><td class="yfnc_tabledata1" align="right">21</td><td class="yfnc_tabledata1" align="right">148</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=630.000000"><strong>630.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627C00630000">AAPL140627C00630000</a></td><td class="yfnc_tabledata1" align="right"><b>3.50</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627c00630000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.45</b></span></td><td class="yfnc_tabledata1" align="right">3.30</td><td class="yfnc_tabledata1" align="right">3.55</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">39</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=630.000000"><strong>630.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140627C00630000">AAPL7140627C00630000</a></td><td class="yfnc_tabledata1" align="right"><b>3.45</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140627c00630000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">2.04</td><td class="yfnc_tabledata1" align="right">3.95</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=632.500000"><strong>632.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613C00632500">AAPL140613C00632500</a></td><td class="yfnc_tabledata1" align="right"><b>1.95</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613c00632500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.05</b></span></td><td class="yfnc_tabledata1" align="right">1.72</td><td class="yfnc_tabledata1" align="right">1.88</td><td class="yfnc_tabledata1" align="right">109</td><td class="yfnc_tabledata1" align="right">25</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=632.500000"><strong>632.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613C00632500">AAPL7140613C00632500</a></td><td class="yfnc_tabledata1" align="right"><b>3.65</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613c00632500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">1.65</td><td class="yfnc_tabledata1" align="right">1.96</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=635.000000"><strong>635.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606C00635000">AAPL140606C00635000</a></td><td class="yfnc_tabledata1" align="right"><b>0.74</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606c00635000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">0.69</td><td class="yfnc_tabledata1" align="right">0.79</td><td class="yfnc_tabledata1" align="right">47</td><td class="yfnc_tabledata1" align="right">252</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=635.000000"><strong>635.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606C00635000">AAPL7140606C00635000</a></td><td class="yfnc_tabledata1" align="right"><b>2.07</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606c00635000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.51</td><td class="yfnc_tabledata1" align="right">0.84</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">22</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=635.000000"><strong>635.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613C00635000">AAPL140613C00635000</a></td><td class="yfnc_tabledata1" align="right"><b>1.65</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613c00635000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.30</b></span></td><td class="yfnc_tabledata1" align="right">1.53</td><td class="yfnc_tabledata1" align="right">1.66</td><td class="yfnc_tabledata1" align="right">45</td><td class="yfnc_tabledata1" align="right">60</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=635.000000"><strong>635.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613C00635000">AAPL7140613C00635000</a></td><td class="yfnc_tabledata1" align="right"><b>3.30</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613c00635000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">1.43</td><td class="yfnc_tabledata1" align="right">1.82</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=635.000000"><strong>635.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00635000">AAPL140621C00635000</a></td><td class="yfnc_tabledata1" align="right"><b>2.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00635000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.36</b></span></td><td class="yfnc_tabledata1" align="right">2.11</td><td class="yfnc_tabledata1" align="right">2.16</td><td class="yfnc_tabledata1" align="right">217</td><td class="yfnc_tabledata1" align="right">1,188</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=635.000000"><strong>635.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621C00635000">AAPL7140621C00635000</a></td><td class="yfnc_tabledata1" align="right"><b>2.44</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621c00635000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">1.95</td><td class="yfnc_tabledata1" align="right">2.18</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">57</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=635.000000"><strong>635.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627C00635000">AAPL140627C00635000</a></td><td class="yfnc_tabledata1" align="right"><b>2.94</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627c00635000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.16</b></span></td><td class="yfnc_tabledata1" align="right">2.65</td><td class="yfnc_tabledata1" align="right">2.85</td><td class="yfnc_tabledata1" align="right">27</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=640.000000"><strong>640.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606C00640000">AAPL140606C00640000</a></td><td class="yfnc_tabledata1" align="right"><b>0.55</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606c00640000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.15</b></span></td><td class="yfnc_tabledata1" align="right">0.50</td><td class="yfnc_tabledata1" align="right">0.64</td><td class="yfnc_tabledata1" align="right">39</td><td class="yfnc_tabledata1" align="right">260</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=640.000000"><strong>640.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606C00640000">AAPL7140606C00640000</a></td><td class="yfnc_tabledata1" align="right"><b>0.65</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606c00640000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.47</td><td class="yfnc_tabledata1" align="right">0.66</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">24</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=640.000000"><strong>640.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613C00640000">AAPL140613C00640000</a></td><td class="yfnc_tabledata1" align="right"><b>1.30</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613c00640000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.23</b></span></td><td class="yfnc_tabledata1" align="right">1.15</td><td class="yfnc_tabledata1" align="right">1.31</td><td class="yfnc_tabledata1" align="right">141</td><td class="yfnc_tabledata1" align="right">187</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=640.000000"><strong>640.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613C00640000">AAPL7140613C00640000</a></td><td class="yfnc_tabledata1" align="right"><b>1.24</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613c00640000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.21</b></span></td><td class="yfnc_tabledata1" align="right">1.15</td><td class="yfnc_tabledata1" align="right">1.33</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">13</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=640.000000"><strong>640.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00640000">AAPL140621C00640000</a></td><td class="yfnc_tabledata1" align="right"><b>1.66</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00640000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.27</b></span></td><td class="yfnc_tabledata1" align="right">1.66</td><td class="yfnc_tabledata1" align="right">1.70</td><td class="yfnc_tabledata1" align="right">112</td><td class="yfnc_tabledata1" align="right">1,451</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=640.000000"><strong>640.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627C00640000">AAPL140627C00640000</a></td><td class="yfnc_tabledata1" align="right"><b>2.29</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627c00640000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.18</b></span></td><td class="yfnc_tabledata1" align="right">2.11</td><td class="yfnc_tabledata1" align="right">2.31</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">7</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=645.000000"><strong>645.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606C00645000">AAPL140606C00645000</a></td><td class="yfnc_tabledata1" align="right"><b>0.44</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606c00645000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.06</b></span></td><td class="yfnc_tabledata1" align="right">0.38</td><td class="yfnc_tabledata1" align="right">0.49</td><td class="yfnc_tabledata1" align="right">33</td><td class="yfnc_tabledata1" align="right">147</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=645.000000"><strong>645.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606C00645000">AAPL7140606C00645000</a></td><td class="yfnc_tabledata1" align="right"><b>1.65</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606c00645000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.20</td><td class="yfnc_tabledata1" align="right">0.54</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">3</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=645.000000"><strong>645.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613C00645000">AAPL140613C00645000</a></td><td class="yfnc_tabledata1" align="right"><b>1.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613c00645000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.90</td><td class="yfnc_tabledata1" align="right">1.03</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">89</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=645.000000"><strong>645.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613C00645000">AAPL7140613C00645000</a></td><td class="yfnc_tabledata1" align="right"><b>2.39</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613c00645000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.88</td><td class="yfnc_tabledata1" align="right">1.07</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">5</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=645.000000"><strong>645.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00645000">AAPL140621C00645000</a></td><td class="yfnc_tabledata1" align="right"><b>1.35</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00645000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.26</b></span></td><td class="yfnc_tabledata1" align="right">1.32</td><td class="yfnc_tabledata1" align="right">1.36</td><td class="yfnc_tabledata1" align="right">147</td><td class="yfnc_tabledata1" align="right">848</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=645.000000"><strong>645.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627C00645000">AAPL140627C00645000</a></td><td class="yfnc_tabledata1" align="right"><b>1.78</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627c00645000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.13</b></span></td><td class="yfnc_tabledata1" align="right">1.68</td><td class="yfnc_tabledata1" align="right">1.88</td><td class="yfnc_tabledata1" align="right">23</td><td class="yfnc_tabledata1" align="right">14</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=645.000000"><strong>645.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140627C00645000">AAPL7140627C00645000</a></td><td class="yfnc_tabledata1" align="right"><b>1.91</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140627c00645000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">1.17</td><td class="yfnc_tabledata1" align="right">2.12</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=650.000000"><strong>650.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606C00650000">AAPL140606C00650000</a></td><td class="yfnc_tabledata1" align="right"><b>0.29</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606c00650000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.15</b></span></td><td class="yfnc_tabledata1" align="right">0.28</td><td class="yfnc_tabledata1" align="right">0.40</td><td class="yfnc_tabledata1" align="right">14</td><td class="yfnc_tabledata1" align="right">742</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=650.000000"><strong>650.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606C00650000">AAPL7140606C00650000</a></td><td class="yfnc_tabledata1" align="right"><b>0.35</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606c00650000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">0.44</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">27</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=650.000000"><strong>650.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613C00650000">AAPL140613C00650000</a></td><td class="yfnc_tabledata1" align="right"><b>0.95</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613c00650000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.69</td><td class="yfnc_tabledata1" align="right">0.84</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">124</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=650.000000"><strong>650.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613C00650000">AAPL7140613C00650000</a></td><td class="yfnc_tabledata1" align="right"><b>0.78</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613c00650000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.46</b></span></td><td class="yfnc_tabledata1" align="right">0.67</td><td class="yfnc_tabledata1" align="right">0.87</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">11</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=650.000000"><strong>650.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00650000">AAPL140621C00650000</a></td><td class="yfnc_tabledata1" align="right"><b>1.08</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00650000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.22</b></span></td><td class="yfnc_tabledata1" align="right">1.06</td><td class="yfnc_tabledata1" align="right">1.10</td><td class="yfnc_tabledata1" align="right">694</td><td class="yfnc_tabledata1" align="right">10,025</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=650.000000"><strong>650.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627C00650000">AAPL140627C00650000</a></td><td class="yfnc_tabledata1" align="right"><b>1.46</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627c00650000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.13</b></span></td><td class="yfnc_tabledata1" align="right">1.36</td><td class="yfnc_tabledata1" align="right">1.57</td><td class="yfnc_tabledata1" align="right">28</td><td class="yfnc_tabledata1" align="right">32</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=650.000000"><strong>650.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140627C00650000">AAPL7140627C00650000</a></td><td class="yfnc_tabledata1" align="right"><b>3.95</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140627c00650000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.52</td><td class="yfnc_tabledata1" align="right">1.86</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=655.000000"><strong>655.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00655000">AAPL140621C00655000</a></td><td class="yfnc_tabledata1" align="right"><b>0.87</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00655000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.23</b></span></td><td class="yfnc_tabledata1" align="right">0.86</td><td class="yfnc_tabledata1" align="right">0.88</td><td class="yfnc_tabledata1" align="right">166</td><td class="yfnc_tabledata1" align="right">1,192</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=660.000000"><strong>660.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00660000">AAPL140621C00660000</a></td><td class="yfnc_tabledata1" align="right"><b>0.74</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00660000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.12</b></span></td><td class="yfnc_tabledata1" align="right">0.69</td><td class="yfnc_tabledata1" align="right">0.72</td><td class="yfnc_tabledata1" align="right">153</td><td class="yfnc_tabledata1" align="right">1,066</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=665.000000"><strong>665.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00665000">AAPL140621C00665000</a></td><td class="yfnc_tabledata1" align="right"><b>0.63</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00665000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.10</b></span></td><td class="yfnc_tabledata1" align="right">0.57</td><td class="yfnc_tabledata1" align="right">0.60</td><td class="yfnc_tabledata1" align="right">62</td><td class="yfnc_tabledata1" align="right">462</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=670.000000"><strong>670.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00670000">AAPL140621C00670000</a></td><td class="yfnc_tabledata1" align="right"><b>0.50</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00670000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.13</b></span></td><td class="yfnc_tabledata1" align="right">0.48</td><td class="yfnc_tabledata1" align="right">0.50</td><td class="yfnc_tabledata1" align="right">49</td><td class="yfnc_tabledata1" align="right">475</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=675.000000"><strong>675.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00675000">AAPL140621C00675000</a></td><td class="yfnc_tabledata1" align="right"><b>0.45</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00675000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.08</b></span></td><td class="yfnc_tabledata1" align="right">0.41</td><td class="yfnc_tabledata1" align="right">0.42</td><td class="yfnc_tabledata1" align="right">31</td><td class="yfnc_tabledata1" align="right">377</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=680.000000"><strong>680.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00680000">AAPL140621C00680000</a></td><td class="yfnc_tabledata1" align="right"><b>0.36</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00680000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.09</b></span></td><td class="yfnc_tabledata1" align="right">0.35</td><td class="yfnc_tabledata1" align="right">0.36</td><td class="yfnc_tabledata1" align="right">25</td><td class="yfnc_tabledata1" align="right">456</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=685.000000"><strong>685.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00685000">AAPL140621C00685000</a></td><td class="yfnc_tabledata1" align="right"><b>0.31</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00685000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.09</b></span></td><td class="yfnc_tabledata1" align="right">0.30</td><td class="yfnc_tabledata1" align="right">0.31</td><td class="yfnc_tabledata1" align="right">12</td><td class="yfnc_tabledata1" align="right">393</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=690.000000"><strong>690.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00690000">AAPL140621C00690000</a></td><td class="yfnc_tabledata1" align="right"><b>0.26</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00690000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.07</b></span></td><td class="yfnc_tabledata1" align="right">0.26</td><td class="yfnc_tabledata1" align="right">0.27</td><td class="yfnc_tabledata1" align="right">18</td><td class="yfnc_tabledata1" align="right">485</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=695.000000"><strong>695.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00695000">AAPL140621C00695000</a></td><td class="yfnc_tabledata1" align="right"><b>0.26</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00695000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.03</b></span></td><td class="yfnc_tabledata1" align="right">0.23</td><td class="yfnc_tabledata1" align="right">0.24</td><td class="yfnc_tabledata1" align="right">7</td><td class="yfnc_tabledata1" align="right">333</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=700.000000"><strong>700.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00700000">AAPL140621C00700000</a></td><td class="yfnc_tabledata1" align="right"><b>0.21</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00700000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.06</b></span></td><td class="yfnc_tabledata1" align="right">0.20</td><td class="yfnc_tabledata1" align="right">0.21</td><td class="yfnc_tabledata1" align="right">111</td><td class="yfnc_tabledata1" align="right">3,476</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=705.000000"><strong>705.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00705000">AAPL140621C00705000</a></td><td class="yfnc_tabledata1" align="right"><b>0.22</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00705000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">0.17</td><td class="yfnc_tabledata1" align="right">0.18</td><td class="yfnc_tabledata1" align="right">25</td><td class="yfnc_tabledata1" align="right">790</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=710.000000"><strong>710.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00710000">AAPL140621C00710000</a></td><td class="yfnc_tabledata1" align="right"><b>0.17</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00710000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">0.14</td><td class="yfnc_tabledata1" align="right">0.16</td><td class="yfnc_tabledata1" align="right">12</td><td class="yfnc_tabledata1" align="right">520</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=715.000000"><strong>715.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00715000">AAPL140621C00715000</a></td><td class="yfnc_tabledata1" align="right"><b>0.15</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00715000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">0.13</td><td class="yfnc_tabledata1" align="right">9</td><td class="yfnc_tabledata1" align="right">441</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=720.000000"><strong>720.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00720000">AAPL140621C00720000</a></td><td class="yfnc_tabledata1" align="right"><b>0.11</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00720000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.03</b></span></td><td class="yfnc_tabledata1" align="right">0.10</td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">13</td><td class="yfnc_tabledata1" align="right">265</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=725.000000"><strong>725.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00725000">AAPL140621C00725000</a></td><td class="yfnc_tabledata1" align="right"><b>0.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00725000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">0.10</td><td class="yfnc_tabledata1" align="right">9</td><td class="yfnc_tabledata1" align="right">178</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=730.000000"><strong>730.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00730000">AAPL140621C00730000</a></td><td class="yfnc_tabledata1" align="right"><b>0.09</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00730000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">0.08</td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">38</td><td class="yfnc_tabledata1" align="right">260</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=735.000000"><strong>735.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00735000">AAPL140621C00735000</a></td><td class="yfnc_tabledata1" align="right"><b>0.08</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00735000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.03</b></span></td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">0.08</td><td class="yfnc_tabledata1" align="right">116</td><td class="yfnc_tabledata1" align="right">687</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=740.000000"><strong>740.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00740000">AAPL140621C00740000</a></td><td class="yfnc_tabledata1" align="right"><b>0.07</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00740000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">0.07</td><td class="yfnc_tabledata1" align="right">98</td><td class="yfnc_tabledata1" align="right">870</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=745.000000"><strong>745.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00745000">AAPL140621C00745000</a></td><td class="yfnc_tabledata1" align="right"><b>0.06</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00745000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">171</td><td class="yfnc_tabledata1" align="right">659</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=750.000000"><strong>750.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00750000">AAPL140621C00750000</a></td><td class="yfnc_tabledata1" align="right"><b>0.07</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00750000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">1,954</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=755.000000"><strong>755.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00755000">AAPL140621C00755000</a></td><td class="yfnc_tabledata1" align="right"><b>0.07</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00755000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">210</td><td class="yfnc_tabledata1" align="right">558</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=760.000000"><strong>760.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00760000">AAPL140621C00760000</a></td><td class="yfnc_tabledata1" align="right"><b>0.03</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00760000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">65</td><td class="yfnc_tabledata1" align="right">3,809</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=765.000000"><strong>765.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00765000">AAPL140621C00765000</a></td><td class="yfnc_tabledata1" align="right"><b>0.04</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00765000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">2,394</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=770.000000"><strong>770.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00770000">AAPL140621C00770000</a></td><td class="yfnc_tabledata1" align="right"><b>0.01</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00770000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.02</b></span></td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">274</td><td class="yfnc_tabledata1" align="right">4,282</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=775.000000"><strong>775.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00775000">AAPL140621C00775000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00775000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">50</td><td class="yfnc_tabledata1" align="right">2,627</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=780.000000"><strong>780.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00780000">AAPL140621C00780000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00780000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">500</td><td class="yfnc_tabledata1" align="right">1,941</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=785.000000"><strong>785.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621C00785000">AAPL140621C00785000</a></td><td class="yfnc_tabledata1" align="right"><b>0.01</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621c00785000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">36</td><td class="yfnc_tabledata1" align="right">2,514</td></tr></table></td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td height="10"></td></tr></table><table class="yfnc_mod_table_title1" width="100%" cellpadding="2" cellspacing="0" border="0"><tr valign="top"><td><small><b><strong class="yfi-module-title">Put Options</strong></b></small></td><td align="right">Expire at close Saturday, June 21, 2014</td></tr></table><table class="yfnc_datamodoutline1" width="100%" cellpadding="0" cellspacing="0" border="0"><tr valign="top"><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><th scope="col" class="yfnc_tablehead1" width="12%" align="left">Strike</th><th scope="col" class="yfnc_tablehead1" width="12%">Symbol</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Last</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Chg</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Bid</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Ask</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Vol</th><th scope="col" class="yfnc_tablehead1" width="12%" align="right">Open Int</th></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=280.000000"><strong>280.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00280000">AAPL140621P00280000</a></td><td class="yfnc_tabledata1" align="right"><b>0.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00280000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">10</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=300.000000"><strong>300.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00300000">AAPL140621P00300000</a></td><td class="yfnc_tabledata1" align="right"><b>0.09</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00300000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.07</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">44</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=325.000000"><strong>325.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00325000">AAPL140621P00325000</a></td><td class="yfnc_tabledata1" align="right"><b>0.09</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00325000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">10</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=330.000000"><strong>330.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00330000">AAPL140621P00330000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00330000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">20</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=335.000000"><strong>335.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00335000">AAPL140621P00335000</a></td><td class="yfnc_tabledata1" align="right"><b>0.01</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00335000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">42</td><td class="yfnc_tabledata1" align="right">42</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=345.000000"><strong>345.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00345000">AAPL140621P00345000</a></td><td class="yfnc_tabledata1" align="right"><b>0.01</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00345000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">66</td><td class="yfnc_tabledata1" align="right">66</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=350.000000"><strong>350.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00350000">AAPL140621P00350000</a></td><td class="yfnc_tabledata1" align="right"><b>0.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00350000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.08</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">102</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=360.000000"><strong>360.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00360000">AAPL140621P00360000</a></td><td class="yfnc_tabledata1" align="right"><b>0.17</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00360000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">20</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=365.000000"><strong>365.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00365000">AAPL140621P00365000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00365000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">12</td><td class="yfnc_tabledata1" align="right">180</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=370.000000"><strong>370.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00370000">AAPL140621P00370000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00370000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">11</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=375.000000"><strong>375.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00375000">AAPL140621P00375000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00375000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">5</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=380.000000"><strong>380.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00380000">AAPL140621P00380000</a></td><td class="yfnc_tabledata1" align="right"><b>0.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00380000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">26</td><td class="yfnc_tabledata1" align="right">28</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=385.000000"><strong>385.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00385000">AAPL140621P00385000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00385000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">176</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=390.000000"><strong>390.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00390000">AAPL140621P00390000</a></td><td class="yfnc_tabledata1" align="right"><b>0.03</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00390000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">104</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=395.000000"><strong>395.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00395000">AAPL140621P00395000</a></td><td class="yfnc_tabledata1" align="right"><b>0.17</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00395000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">15</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=400.000000"><strong>400.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00400000">AAPL140621P00400000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00400000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">981</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=405.000000"><strong>405.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00405000">AAPL140621P00405000</a></td><td class="yfnc_tabledata1" align="right"><b>0.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00405000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.03</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">17</td><td class="yfnc_tabledata1" align="right">49</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=410.000000"><strong>410.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00410000">AAPL140621P00410000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00410000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">109</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=415.000000"><strong>415.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00415000">AAPL140621P00415000</a></td><td class="yfnc_tabledata1" align="right"><b>0.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00415000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">97</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=420.000000"><strong>420.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00420000">AAPL140621P00420000</a></td><td class="yfnc_tabledata1" align="right"><b>0.01</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00420000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">40</td><td class="yfnc_tabledata1" align="right">256</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=425.000000"><strong>425.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00425000">AAPL140621P00425000</a></td><td class="yfnc_tabledata1" align="right"><b>0.04</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00425000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">13</td><td class="yfnc_tabledata1" align="right">685</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=425.000000"><strong>425.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00425000">AAPL7140621P00425000</a></td><td class="yfnc_tabledata1" align="right"><b>0.47</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00425000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.16</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">5</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=430.000000"><strong>430.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00430000">AAPL140621P00430000</a></td><td class="yfnc_tabledata1" align="right"><b>0.04</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00430000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">412</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=435.000000"><strong>435.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00435000">AAPL140621P00435000</a></td><td class="yfnc_tabledata1" align="right"><b>0.04</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00435000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">199</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=435.000000"><strong>435.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00435000">AAPL7140621P00435000</a></td><td class="yfnc_tabledata1" align="right"><b>0.31</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00435000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.17</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">2</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=440.000000"><strong>440.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00440000">AAPL140621P00440000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00440000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1,593</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=440.000000"><strong>440.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00440000">AAPL7140621P00440000</a></td><td class="yfnc_tabledata1" align="right"><b>1.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00440000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.17</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">16</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=445.000000"><strong>445.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00445000">AAPL140621P00445000</a></td><td class="yfnc_tabledata1" align="right"><b>0.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00445000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.03</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">233</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=450.000000"><strong>450.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00450000">AAPL140621P00450000</a></td><td class="yfnc_tabledata1" align="right"><b>0.07</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00450000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">273</td><td class="yfnc_tabledata1" align="right">2,123</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=450.000000"><strong>450.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00450000">AAPL7140621P00450000</a></td><td class="yfnc_tabledata1" align="right"><b>1.27</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00450000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.19</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">5</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=455.000000"><strong>455.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00455000">AAPL140621P00455000</a></td><td class="yfnc_tabledata1" align="right"><b>0.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00455000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.11</td><td class="yfnc_tabledata1" align="right">29</td><td class="yfnc_tabledata1" align="right">245</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=460.000000"><strong>460.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00460000">AAPL140621P00460000</a></td><td class="yfnc_tabledata1" align="right"><b>0.06</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00460000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="pos_arrow" alt="Up"> <b style="color:#008800;">0.01</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.11</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">506</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=460.000000"><strong>460.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00460000">AAPL7140621P00460000</a></td><td class="yfnc_tabledata1" align="right"><b>0.30</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00460000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.20</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">3</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=465.000000"><strong>465.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00465000">AAPL140621P00465000</a></td><td class="yfnc_tabledata1" align="right"><b>0.11</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00465000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">27</td><td class="yfnc_tabledata1" align="right">1,123</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=465.000000"><strong>465.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00465000">AAPL7140621P00465000</a></td><td class="yfnc_tabledata1" align="right"><b>2.99</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00465000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">64</td><td class="yfnc_tabledata1" align="right">98</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=470.000000"><strong>470.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00470000">AAPL140621P00470000</a></td><td class="yfnc_tabledata1" align="right"><b>0.04</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00470000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.05</b></span></td><td class="yfnc_tabledata1" align="right">0.02</td><td class="yfnc_tabledata1" align="right">0.10</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">1,279</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=470.000000"><strong>470.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00470000">AAPL7140621P00470000</a></td><td class="yfnc_tabledata1" align="right"><b>4.70</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00470000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">13</td><td class="yfnc_tabledata1" align="right">54</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=475.000000"><strong>475.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00475000">AAPL140621P00475000</a></td><td class="yfnc_tabledata1" align="right"><b>0.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00475000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.05</b></span></td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">0.07</td><td class="yfnc_tabledata1" align="right">41</td><td class="yfnc_tabledata1" align="right">2,028</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=475.000000"><strong>475.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00475000">AAPL7140621P00475000</a></td><td class="yfnc_tabledata1" align="right"><b>0.25</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00475000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.24</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">79</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=480.000000"><strong>480.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00480000">AAPL140621P00480000</a></td><td class="yfnc_tabledata1" align="right"><b>0.07</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00480000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.05</b></span></td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">23</td><td class="yfnc_tabledata1" align="right">2,070</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=480.000000"><strong>480.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00480000">AAPL7140621P00480000</a></td><td class="yfnc_tabledata1" align="right"><b>0.22</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00480000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">32</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=485.000000"><strong>485.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00485000">AAPL140621P00485000</a></td><td class="yfnc_tabledata1" align="right"><b>0.08</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00485000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.05</b></span></td><td class="yfnc_tabledata1" align="right">0.07</td><td class="yfnc_tabledata1" align="right">0.08</td><td class="yfnc_tabledata1" align="right">16</td><td class="yfnc_tabledata1" align="right">871</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=485.000000"><strong>485.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00485000">AAPL7140621P00485000</a></td><td class="yfnc_tabledata1" align="right"><b>4.45</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00485000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">39</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=490.000000"><strong>490.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00490000">AAPL140606P00490000</a></td><td class="yfnc_tabledata1" align="right"><b>0.34</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00490000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.15</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">66</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=490.000000"><strong>490.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00490000">AAPL140621P00490000</a></td><td class="yfnc_tabledata1" align="right"><b>0.09</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00490000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.07</b></span></td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">0.10</td><td class="yfnc_tabledata1" align="right">131</td><td class="yfnc_tabledata1" align="right">2,770</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=490.000000"><strong>490.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00490000">AAPL7140621P00490000</a></td><td class="yfnc_tabledata1" align="right"><b>5.00</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00490000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.30</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">87</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=492.500000"><strong>492.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00492500">AAPL140606P00492500</a></td><td class="yfnc_tabledata1" align="right"><b>0.30</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00492500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.19</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">12</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=495.000000"><strong>495.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00495000">AAPL140606P00495000</a></td><td class="yfnc_tabledata1" align="right"><b>0.60</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00495000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.20</td><td class="yfnc_tabledata1" align="right">8</td><td class="yfnc_tabledata1" align="right">8</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=495.000000"><strong>495.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00495000">AAPL140621P00495000</a></td><td class="yfnc_tabledata1" align="right"><b>0.11</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00495000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.08</b></span></td><td class="yfnc_tabledata1" align="right">0.11</td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">64</td><td class="yfnc_tabledata1" align="right">2,606</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=495.000000"><strong>495.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00495000">AAPL7140621P00495000</a></td><td class="yfnc_tabledata1" align="right"><b>5.75</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00495000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">0.22</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">22</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=500.000000"><strong>500.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00500000">AAPL140606P00500000</a></td><td class="yfnc_tabledata1" align="right"><b>0.21</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00500000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">0.18</td><td class="yfnc_tabledata1" align="right">9</td><td class="yfnc_tabledata1" align="right">10</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=500.000000"><strong>500.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606P00500000">AAPL7140606P00500000</a></td><td class="yfnc_tabledata1" align="right"><b>1.45</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606p00500000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">30</td><td class="yfnc_tabledata1" align="right">30</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=500.000000"><strong>500.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00500000">AAPL140613P00500000</a></td><td class="yfnc_tabledata1" align="right"><b>0.33</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00500000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.05</td><td class="yfnc_tabledata1" align="right">0.19</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">12</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=500.000000"><strong>500.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00500000">AAPL140621P00500000</a></td><td class="yfnc_tabledata1" align="right"><b>0.13</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00500000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.11</b></span></td><td class="yfnc_tabledata1" align="right">0.13</td><td class="yfnc_tabledata1" align="right">0.14</td><td class="yfnc_tabledata1" align="right">267</td><td class="yfnc_tabledata1" align="right">2,383</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=500.000000"><strong>500.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00500000">AAPL7140621P00500000</a></td><td class="yfnc_tabledata1" align="right"><b>0.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00500000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.15</b></span></td><td class="yfnc_tabledata1" align="right">0.09</td><td class="yfnc_tabledata1" align="right">0.24</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">96</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=505.000000"><strong>505.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00505000">AAPL140606P00505000</a></td><td class="yfnc_tabledata1" align="right"><b>0.86</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00505000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">N/A</td><td class="yfnc_tabledata1" align="right">0.20</td><td class="yfnc_tabledata1" align="right">16</td><td class="yfnc_tabledata1" align="right">17</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=505.000000"><strong>505.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00505000">AAPL140621P00505000</a></td><td class="yfnc_tabledata1" align="right"><b>0.16</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00505000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.11</b></span></td><td class="yfnc_tabledata1" align="right">0.15</td><td class="yfnc_tabledata1" align="right">0.17</td><td class="yfnc_tabledata1" align="right">487</td><td class="yfnc_tabledata1" align="right">861</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=505.000000"><strong>505.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00505000">AAPL7140621P00505000</a></td><td class="yfnc_tabledata1" align="right"><b>0.40</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00505000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.10</td><td class="yfnc_tabledata1" align="right">0.27</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">34</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=507.500000"><strong>507.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00507500">AAPL140606P00507500</a></td><td class="yfnc_tabledata1" align="right"><b>0.27</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00507500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.01</td><td class="yfnc_tabledata1" align="right">0.22</td><td class="yfnc_tabledata1" align="right">8</td><td class="yfnc_tabledata1" align="right">18</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=510.000000"><strong>510.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00510000">AAPL140606P00510000</a></td><td class="yfnc_tabledata1" align="right"><b>0.17</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00510000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">0.22</td><td class="yfnc_tabledata1" align="right">20</td><td class="yfnc_tabledata1" align="right">35</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=510.000000"><strong>510.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00510000">AAPL140621P00510000</a></td><td class="yfnc_tabledata1" align="right"><b>0.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00510000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.13</b></span></td><td class="yfnc_tabledata1" align="right">0.19</td><td class="yfnc_tabledata1" align="right">0.20</td><td class="yfnc_tabledata1" align="right">227</td><td class="yfnc_tabledata1" align="right">2,308</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=510.000000"><strong>510.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00510000">AAPL7140621P00510000</a></td><td class="yfnc_tabledata1" align="right"><b>0.23</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00510000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.15</b></span></td><td class="yfnc_tabledata1" align="right">0.12</td><td class="yfnc_tabledata1" align="right">0.30</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">112</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=515.000000"><strong>515.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00515000">AAPL140606P00515000</a></td><td class="yfnc_tabledata1" align="right"><b>0.29</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00515000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">0.23</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">50</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=515.000000"><strong>515.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00515000">AAPL140613P00515000</a></td><td class="yfnc_tabledata1" align="right"><b>0.24</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00515000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.13</td><td class="yfnc_tabledata1" align="right">0.27</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=515.000000"><strong>515.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00515000">AAPL140621P00515000</a></td><td class="yfnc_tabledata1" align="right"><b>0.24</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00515000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.17</b></span></td><td class="yfnc_tabledata1" align="right">0.23</td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">159</td><td class="yfnc_tabledata1" align="right">1,634</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=515.000000"><strong>515.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00515000">AAPL7140621P00515000</a></td><td class="yfnc_tabledata1" align="right"><b>0.35</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00515000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.75</b></span></td><td class="yfnc_tabledata1" align="right">0.08</td><td class="yfnc_tabledata1" align="right">0.35</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">24</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=517.500000"><strong>517.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00517500">AAPL140606P00517500</a></td><td class="yfnc_tabledata1" align="right"><b>0.41</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00517500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.03</td><td class="yfnc_tabledata1" align="right">0.18</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">23</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=520.000000"><strong>520.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00520000">AAPL140606P00520000</a></td><td class="yfnc_tabledata1" align="right"><b>0.13</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00520000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.16</b></span></td><td class="yfnc_tabledata1" align="right">0.04</td><td class="yfnc_tabledata1" align="right">0.19</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">128</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=520.000000"><strong>520.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00520000">AAPL140613P00520000</a></td><td class="yfnc_tabledata1" align="right"><b>0.34</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00520000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.18</td><td class="yfnc_tabledata1" align="right">0.31</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">20</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=520.000000"><strong>520.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00520000">AAPL140621P00520000</a></td><td class="yfnc_tabledata1" align="right"><b>0.31</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00520000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.21</b></span></td><td class="yfnc_tabledata1" align="right">0.31</td><td class="yfnc_tabledata1" align="right">0.32</td><td class="yfnc_tabledata1" align="right">295</td><td class="yfnc_tabledata1" align="right">2,777</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=520.000000"><strong>520.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00520000">AAPL7140621P00520000</a></td><td class="yfnc_tabledata1" align="right"><b>0.50</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00520000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.16</td><td class="yfnc_tabledata1" align="right">0.40</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">125</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=522.500000"><strong>522.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00522500">AAPL140606P00522500</a></td><td class="yfnc_tabledata1" align="right"><b>0.54</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00522500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.06</td><td class="yfnc_tabledata1" align="right">0.20</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">2</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=525.000000"><strong>525.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00525000">AAPL140606P00525000</a></td><td class="yfnc_tabledata1" align="right"><b>0.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00525000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.17</b></span></td><td class="yfnc_tabledata1" align="right">0.08</td><td class="yfnc_tabledata1" align="right">0.19</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">204</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=525.000000"><strong>525.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00525000">AAPL140613P00525000</a></td><td class="yfnc_tabledata1" align="right"><b>0.47</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00525000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">0.37</td><td class="yfnc_tabledata1" align="right">11</td><td class="yfnc_tabledata1" align="right">41</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=525.000000"><strong>525.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00525000">AAPL140621P00525000</a></td><td class="yfnc_tabledata1" align="right"><b>0.40</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00525000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.21</b></span></td><td class="yfnc_tabledata1" align="right">0.38</td><td class="yfnc_tabledata1" align="right">0.39</td><td class="yfnc_tabledata1" align="right">212</td><td class="yfnc_tabledata1" align="right">2,729</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=525.000000"><strong>525.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00525000">AAPL7140621P00525000</a></td><td class="yfnc_tabledata1" align="right"><b>1.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00525000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.34</td><td class="yfnc_tabledata1" align="right">0.49</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">94</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=527.500000"><strong>527.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00527500">AAPL140606P00527500</a></td><td class="yfnc_tabledata1" align="right"><b>0.17</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00527500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.29</b></span></td><td class="yfnc_tabledata1" align="right">0.10</td><td class="yfnc_tabledata1" align="right">0.20</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">22</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=530.000000"><strong>530.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00530000">AAPL140606P00530000</a></td><td class="yfnc_tabledata1" align="right"><b>0.56</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00530000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.11</td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">72</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=530.000000"><strong>530.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606P00530000">AAPL7140606P00530000</a></td><td class="yfnc_tabledata1" align="right"><b>3.24</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606p00530000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.06</td><td class="yfnc_tabledata1" align="right">0.27</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">4</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=530.000000"><strong>530.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00530000">AAPL140613P00530000</a></td><td class="yfnc_tabledata1" align="right"><b>0.76</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00530000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.34</td><td class="yfnc_tabledata1" align="right">0.45</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">27</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=530.000000"><strong>530.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00530000">AAPL140621P00530000</a></td><td class="yfnc_tabledata1" align="right"><b>0.52</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00530000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.26</b></span></td><td class="yfnc_tabledata1" align="right">0.48</td><td class="yfnc_tabledata1" align="right">0.50</td><td class="yfnc_tabledata1" align="right">289</td><td class="yfnc_tabledata1" align="right">2,675</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=530.000000"><strong>530.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00530000">AAPL7140621P00530000</a></td><td class="yfnc_tabledata1" align="right"><b>1.44</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00530000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.42</td><td class="yfnc_tabledata1" align="right">0.60</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">75</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=530.000000"><strong>530.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627P00530000">AAPL140627P00530000</a></td><td class="yfnc_tabledata1" align="right"><b>0.75</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627p00530000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.23</b></span></td><td class="yfnc_tabledata1" align="right">0.68</td><td class="yfnc_tabledata1" align="right">0.85</td><td class="yfnc_tabledata1" align="right">12</td><td class="yfnc_tabledata1" align="right">122</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=532.500000"><strong>532.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00532500">AAPL140606P00532500</a></td><td class="yfnc_tabledata1" align="right"><b>0.90</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00532500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.11</td><td class="yfnc_tabledata1" align="right">0.27</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">2</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=535.000000"><strong>535.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00535000">AAPL140606P00535000</a></td><td class="yfnc_tabledata1" align="right"><b>0.41</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00535000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.14</td><td class="yfnc_tabledata1" align="right">0.29</td><td class="yfnc_tabledata1" align="right">40</td><td class="yfnc_tabledata1" align="right">100</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=535.000000"><strong>535.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606P00535000">AAPL7140606P00535000</a></td><td class="yfnc_tabledata1" align="right"><b>1.12</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606p00535000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.15</td><td class="yfnc_tabledata1" align="right">0.31</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">2</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=535.000000"><strong>535.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00535000">AAPL140613P00535000</a></td><td class="yfnc_tabledata1" align="right"><b>0.56</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00535000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.35</b></span></td><td class="yfnc_tabledata1" align="right">0.44</td><td class="yfnc_tabledata1" align="right">0.55</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">108</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=535.000000"><strong>535.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613P00535000">AAPL7140613P00535000</a></td><td class="yfnc_tabledata1" align="right"><b>0.51</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613p00535000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.64</b></span></td><td class="yfnc_tabledata1" align="right">0.29</td><td class="yfnc_tabledata1" align="right">0.58</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=535.000000"><strong>535.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00535000">AAPL140621P00535000</a></td><td class="yfnc_tabledata1" align="right"><b>0.65</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00535000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.30</b></span></td><td class="yfnc_tabledata1" align="right">0.63</td><td class="yfnc_tabledata1" align="right">0.65</td><td class="yfnc_tabledata1" align="right">117</td><td class="yfnc_tabledata1" align="right">1,322</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=535.000000"><strong>535.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00535000">AAPL7140621P00535000</a></td><td class="yfnc_tabledata1" align="right"><b>2.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00535000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.58</td><td class="yfnc_tabledata1" align="right">0.75</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">42</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=537.500000"><strong>537.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00537500">AAPL140606P00537500</a></td><td class="yfnc_tabledata1" align="right"><b>0.33</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00537500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.18</td><td class="yfnc_tabledata1" align="right">0.32</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">36</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=540.000000"><strong>540.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00540000">AAPL140606P00540000</a></td><td class="yfnc_tabledata1" align="right"><b>0.29</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00540000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.12</b></span></td><td class="yfnc_tabledata1" align="right">0.22</td><td class="yfnc_tabledata1" align="right">0.32</td><td class="yfnc_tabledata1" align="right">29</td><td class="yfnc_tabledata1" align="right">133</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=540.000000"><strong>540.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606P00540000">AAPL7140606P00540000</a></td><td class="yfnc_tabledata1" align="right"><b>4.85</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606p00540000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.21</td><td class="yfnc_tabledata1" align="right">0.37</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">6</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=540.000000"><strong>540.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00540000">AAPL140613P00540000</a></td><td class="yfnc_tabledata1" align="right"><b>1.09</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00540000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.60</td><td class="yfnc_tabledata1" align="right">0.70</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">17</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=540.000000"><strong>540.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00540000">AAPL140621P00540000</a></td><td class="yfnc_tabledata1" align="right"><b>0.85</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00540000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.38</b></span></td><td class="yfnc_tabledata1" align="right">0.82</td><td class="yfnc_tabledata1" align="right">0.85</td><td class="yfnc_tabledata1" align="right">144</td><td class="yfnc_tabledata1" align="right">3,077</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=540.000000"><strong>540.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00540000">AAPL7140621P00540000</a></td><td class="yfnc_tabledata1" align="right"><b>0.88</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00540000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.42</b></span></td><td class="yfnc_tabledata1" align="right">0.69</td><td class="yfnc_tabledata1" align="right">0.95</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">369</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=540.000000"><strong>540.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627P00540000">AAPL140627P00540000</a></td><td class="yfnc_tabledata1" align="right"><b>1.25</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627p00540000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.93</b></span></td><td class="yfnc_tabledata1" align="right">1.15</td><td class="yfnc_tabledata1" align="right">1.33</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">64</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=542.500000"><strong>542.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00542500">AAPL140606P00542500</a></td><td class="yfnc_tabledata1" align="right"><b>1.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00542500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">0.39</td><td class="yfnc_tabledata1" align="right">12</td><td class="yfnc_tabledata1" align="right">118</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=545.000000"><strong>545.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00545000">AAPL140606P00545000</a></td><td class="yfnc_tabledata1" align="right"><b>0.45</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00545000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.69</b></span></td><td class="yfnc_tabledata1" align="right">0.27</td><td class="yfnc_tabledata1" align="right">0.44</td><td class="yfnc_tabledata1" align="right">8</td><td class="yfnc_tabledata1" align="right">107</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=545.000000"><strong>545.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606P00545000">AAPL7140606P00545000</a></td><td class="yfnc_tabledata1" align="right"><b>1.91</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606p00545000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.25</td><td class="yfnc_tabledata1" align="right">0.46</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=545.000000"><strong>545.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00545000">AAPL140613P00545000</a></td><td class="yfnc_tabledata1" align="right"><b>0.87</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00545000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.27</b></span></td><td class="yfnc_tabledata1" align="right">0.81</td><td class="yfnc_tabledata1" align="right">0.90</td><td class="yfnc_tabledata1" align="right">64</td><td class="yfnc_tabledata1" align="right">135</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=545.000000"><strong>545.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613P00545000">AAPL7140613P00545000</a></td><td class="yfnc_tabledata1" align="right"><b>3.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613p00545000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.56</td><td class="yfnc_tabledata1" align="right">0.98</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">10</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=545.000000"><strong>545.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00545000">AAPL140621P00545000</a></td><td class="yfnc_tabledata1" align="right"><b>1.14</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00545000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.41</b></span></td><td class="yfnc_tabledata1" align="right">1.09</td><td class="yfnc_tabledata1" align="right">1.13</td><td class="yfnc_tabledata1" align="right">385</td><td class="yfnc_tabledata1" align="right">4,203</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=545.000000"><strong>545.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00545000">AAPL7140621P00545000</a></td><td class="yfnc_tabledata1" align="right"><b>3.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00545000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.95</td><td class="yfnc_tabledata1" align="right">1.21</td><td class="yfnc_tabledata1" align="right">7</td><td class="yfnc_tabledata1" align="right">426</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=545.000000"><strong>545.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627P00545000">AAPL140627P00545000</a></td><td class="yfnc_tabledata1" align="right"><b>1.58</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627p00545000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.98</b></span></td><td class="yfnc_tabledata1" align="right">1.50</td><td class="yfnc_tabledata1" align="right">1.65</td><td class="yfnc_tabledata1" align="right">22</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=547.500000"><strong>547.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00547500">AAPL140606P00547500</a></td><td class="yfnc_tabledata1" align="right"><b>0.49</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00547500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.28</b></span></td><td class="yfnc_tabledata1" align="right">0.36</td><td class="yfnc_tabledata1" align="right">0.49</td><td class="yfnc_tabledata1" align="right">7</td><td class="yfnc_tabledata1" align="right">53</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=547.500000"><strong>547.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606P00547500">AAPL7140606P00547500</a></td><td class="yfnc_tabledata1" align="right"><b>2.43</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606p00547500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.31</td><td class="yfnc_tabledata1" align="right">0.52</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=550.000000"><strong>550.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00550000">AAPL140606P00550000</a></td><td class="yfnc_tabledata1" align="right"><b>0.49</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00550000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.23</b></span></td><td class="yfnc_tabledata1" align="right">0.42</td><td class="yfnc_tabledata1" align="right">0.49</td><td class="yfnc_tabledata1" align="right">26</td><td class="yfnc_tabledata1" align="right">431</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=550.000000"><strong>550.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606P00550000">AAPL7140606P00550000</a></td><td class="yfnc_tabledata1" align="right"><b>1.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606p00550000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.24</td><td class="yfnc_tabledata1" align="right">0.60</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">6</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=550.000000"><strong>550.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00550000">AAPL140613P00550000</a></td><td class="yfnc_tabledata1" align="right"><b>1.16</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00550000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.46</b></span></td><td class="yfnc_tabledata1" align="right">1.08</td><td class="yfnc_tabledata1" align="right">1.20</td><td class="yfnc_tabledata1" align="right">69</td><td class="yfnc_tabledata1" align="right">100</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=550.000000"><strong>550.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613P00550000">AAPL7140613P00550000</a></td><td class="yfnc_tabledata1" align="right"><b>1.11</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613p00550000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.69</b></span></td><td class="yfnc_tabledata1" align="right">0.98</td><td class="yfnc_tabledata1" align="right">1.27</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">11</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=550.000000"><strong>550.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00550000">AAPL140621P00550000</a></td><td class="yfnc_tabledata1" align="right"><b>1.47</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00550000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.55</b></span></td><td class="yfnc_tabledata1" align="right">1.45</td><td class="yfnc_tabledata1" align="right">1.49</td><td class="yfnc_tabledata1" align="right">344</td><td class="yfnc_tabledata1" align="right">4,118</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=550.000000"><strong>550.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00550000">AAPL7140621P00550000</a></td><td class="yfnc_tabledata1" align="right"><b>1.60</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00550000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.07</b></span></td><td class="yfnc_tabledata1" align="right">1.33</td><td class="yfnc_tabledata1" align="right">1.66</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">348</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=550.000000"><strong>550.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627P00550000">AAPL140627P00550000</a></td><td class="yfnc_tabledata1" align="right"><b>2.54</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627p00550000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.71</b></span></td><td class="yfnc_tabledata1" align="right">1.95</td><td class="yfnc_tabledata1" align="right">2.12</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">83</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=552.500000"><strong>552.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00552500">AAPL140606P00552500</a></td><td class="yfnc_tabledata1" align="right"><b>0.60</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00552500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.29</b></span></td><td class="yfnc_tabledata1" align="right">0.52</td><td class="yfnc_tabledata1" align="right">0.63</td><td class="yfnc_tabledata1" align="right">9</td><td class="yfnc_tabledata1" align="right">33</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=552.500000"><strong>552.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606P00552500">AAPL7140606P00552500</a></td><td class="yfnc_tabledata1" align="right"><b>4.90</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606p00552500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.33</td><td class="yfnc_tabledata1" align="right">0.68</td><td class="yfnc_tabledata1" align="right">30</td><td class="yfnc_tabledata1" align="right">30</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=555.000000"><strong>555.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00555000">AAPL140606P00555000</a></td><td class="yfnc_tabledata1" align="right"><b>0.89</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00555000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.12</b></span></td><td class="yfnc_tabledata1" align="right">0.62</td><td class="yfnc_tabledata1" align="right">0.74</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">372</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=555.000000"><strong>555.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606P00555000">AAPL7140606P00555000</a></td><td class="yfnc_tabledata1" align="right"><b>3.55</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606p00555000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.43</td><td class="yfnc_tabledata1" align="right">0.78</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">2</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=555.000000"><strong>555.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00555000">AAPL140613P00555000</a></td><td class="yfnc_tabledata1" align="right"><b>1.52</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00555000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.60</b></span></td><td class="yfnc_tabledata1" align="right">1.47</td><td class="yfnc_tabledata1" align="right">1.60</td><td class="yfnc_tabledata1" align="right">102</td><td class="yfnc_tabledata1" align="right">113</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=555.000000"><strong>555.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613P00555000">AAPL7140613P00555000</a></td><td class="yfnc_tabledata1" align="right"><b>4.70</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613p00555000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">1.26</td><td class="yfnc_tabledata1" align="right">1.64</td><td class="yfnc_tabledata1" align="right">20</td><td class="yfnc_tabledata1" align="right">20</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=555.000000"><strong>555.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00555000">AAPL140621P00555000</a></td><td class="yfnc_tabledata1" align="right"><b>2.03</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00555000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.56</b></span></td><td class="yfnc_tabledata1" align="right">1.94</td><td class="yfnc_tabledata1" align="right">1.98</td><td class="yfnc_tabledata1" align="right">388</td><td class="yfnc_tabledata1" align="right">1,057</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=555.000000"><strong>555.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00555000">AAPL7140621P00555000</a></td><td class="yfnc_tabledata1" align="right"><b>2.65</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00555000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.11</b></span></td><td class="yfnc_tabledata1" align="right">1.80</td><td class="yfnc_tabledata1" align="right">2.11</td><td class="yfnc_tabledata1" align="right">8</td><td class="yfnc_tabledata1" align="right">27</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=555.000000"><strong>555.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627P00555000">AAPL140627P00555000</a></td><td class="yfnc_tabledata1" align="right"><b>3.75</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627p00555000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">2.53</td><td class="yfnc_tabledata1" align="right">2.72</td><td class="yfnc_tabledata1" align="right">6</td><td class="yfnc_tabledata1" align="right">16</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=557.500000"><strong>557.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00557500">AAPL140606P00557500</a></td><td class="yfnc_tabledata1" align="right"><b>0.84</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00557500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.38</b></span></td><td class="yfnc_tabledata1" align="right">0.75</td><td class="yfnc_tabledata1" align="right">0.89</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">67</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=557.500000"><strong>557.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606P00557500">AAPL7140606P00557500</a></td><td class="yfnc_tabledata1" align="right"><b>3.55</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606p00557500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.65</td><td class="yfnc_tabledata1" align="right">0.92</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">4</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=557.500000"><strong>557.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627P00557500">AAPL140627P00557500</a></td><td class="yfnc_tabledata1" align="right"><b>2.96</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627p00557500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">3.59</b></span></td><td class="yfnc_tabledata1" align="right">2.87</td><td class="yfnc_tabledata1" align="right">3.10</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">19</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00560000">AAPL140606P00560000</a></td><td class="yfnc_tabledata1" align="right"><b>0.98</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00560000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.31</b></span></td><td class="yfnc_tabledata1" align="right">0.90</td><td class="yfnc_tabledata1" align="right">1.00</td><td class="yfnc_tabledata1" align="right">41</td><td class="yfnc_tabledata1" align="right">396</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606P00560000">AAPL7140606P00560000</a></td><td class="yfnc_tabledata1" align="right"><b>1.73</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606p00560000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.72</td><td class="yfnc_tabledata1" align="right">1.06</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">12</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00560000">AAPL140613P00560000</a></td><td class="yfnc_tabledata1" align="right"><b>2.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00560000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.49</b></span></td><td class="yfnc_tabledata1" align="right">2.00</td><td class="yfnc_tabledata1" align="right">2.23</td><td class="yfnc_tabledata1" align="right">15</td><td class="yfnc_tabledata1" align="right">148</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00560000">AAPL140621P00560000</a></td><td class="yfnc_tabledata1" align="right"><b>2.64</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00560000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.69</b></span></td><td class="yfnc_tabledata1" align="right">2.56</td><td class="yfnc_tabledata1" align="right">2.63</td><td class="yfnc_tabledata1" align="right">387</td><td class="yfnc_tabledata1" align="right">5,780</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00560000">AAPL7140621P00560000</a></td><td class="yfnc_tabledata1" align="right"><b>3.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00560000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.89</b></span></td><td class="yfnc_tabledata1" align="right">2.45</td><td class="yfnc_tabledata1" align="right">2.74</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">130</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=560.000000"><strong>560.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627P00560000">AAPL140627P00560000</a></td><td class="yfnc_tabledata1" align="right"><b>3.90</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627p00560000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.70</b></span></td><td class="yfnc_tabledata1" align="right">3.20</td><td class="yfnc_tabledata1" align="right">3.50</td><td class="yfnc_tabledata1" align="right">21</td><td class="yfnc_tabledata1" align="right">75</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=562.500000"><strong>562.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00562500">AAPL140606P00562500</a></td><td class="yfnc_tabledata1" align="right"><b>1.21</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00562500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.34</b></span></td><td class="yfnc_tabledata1" align="right">1.10</td><td class="yfnc_tabledata1" align="right">1.23</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">154</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=562.500000"><strong>562.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606P00562500">AAPL7140606P00562500</a></td><td class="yfnc_tabledata1" align="right"><b>4.60</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606p00562500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">0.91</td><td class="yfnc_tabledata1" align="right">1.25</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">2</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=562.500000"><strong>562.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00562500">AAPL140613P00562500</a></td><td class="yfnc_tabledata1" align="right"><b>2.51</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00562500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.54</b></span></td><td class="yfnc_tabledata1" align="right">2.29</td><td class="yfnc_tabledata1" align="right">2.57</td><td class="yfnc_tabledata1" align="right">37</td><td class="yfnc_tabledata1" align="right">79</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=562.500000"><strong>562.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613P00562500">AAPL7140613P00562500</a></td><td class="yfnc_tabledata1" align="right"><b>6.45</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613p00562500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">2.09</td><td class="yfnc_tabledata1" align="right">2.49</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">10</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00565000">AAPL140606P00565000</a></td><td class="yfnc_tabledata1" align="right"><b>1.50</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00565000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.29</b></span></td><td class="yfnc_tabledata1" align="right">1.35</td><td class="yfnc_tabledata1" align="right">1.42</td><td class="yfnc_tabledata1" align="right">46</td><td class="yfnc_tabledata1" align="right">1,051</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606P00565000">AAPL7140606P00565000</a></td><td class="yfnc_tabledata1" align="right"><b>1.82</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606p00565000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">3.33</b></span></td><td class="yfnc_tabledata1" align="right">1.28</td><td class="yfnc_tabledata1" align="right">1.48</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">7</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00565000">AAPL140613P00565000</a></td><td class="yfnc_tabledata1" align="right"><b>2.87</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00565000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.59</b></span></td><td class="yfnc_tabledata1" align="right">2.66</td><td class="yfnc_tabledata1" align="right">2.95</td><td class="yfnc_tabledata1" align="right">30</td><td class="yfnc_tabledata1" align="right">191</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613P00565000">AAPL7140613P00565000</a></td><td class="yfnc_tabledata1" align="right"><b>6.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613p00565000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">2.42</td><td class="yfnc_tabledata1" align="right">2.87</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">13</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00565000">AAPL140621P00565000</a></td><td class="yfnc_tabledata1" align="right"><b>3.50</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00565000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.70</b></span></td><td class="yfnc_tabledata1" align="right">3.40</td><td class="yfnc_tabledata1" align="right">3.45</td><td class="yfnc_tabledata1" align="right">253</td><td class="yfnc_tabledata1" align="right">2,292</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00565000">AAPL7140621P00565000</a></td><td class="yfnc_tabledata1" align="right"><b>8.32</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00565000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">3.25</td><td class="yfnc_tabledata1" align="right">3.60</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">222</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=565.000000"><strong>565.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627P00565000">AAPL140627P00565000</a></td><td class="yfnc_tabledata1" align="right"><b>4.96</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627p00565000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.82</b></span></td><td class="yfnc_tabledata1" align="right">4.20</td><td class="yfnc_tabledata1" align="right">4.40</td><td class="yfnc_tabledata1" align="right">11</td><td class="yfnc_tabledata1" align="right">4</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=567.500000"><strong>567.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00567500">AAPL140613P00567500</a></td><td class="yfnc_tabledata1" align="right"><b>3.22</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00567500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.78</b></span></td><td class="yfnc_tabledata1" align="right">3.10</td><td class="yfnc_tabledata1" align="right">3.40</td><td class="yfnc_tabledata1" align="right">15</td><td class="yfnc_tabledata1" align="right">47</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=567.500000"><strong>567.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627P00567500">AAPL140627P00567500</a></td><td class="yfnc_tabledata1" align="right"><b>5.52</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627p00567500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">4.70</td><td class="yfnc_tabledata1" align="right">5.00</td><td class="yfnc_tabledata1" align="right">7</td><td class="yfnc_tabledata1" align="right">33</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=567.500000"><strong>567.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140627P00567500">AAPL7140627P00567500</a></td><td class="yfnc_tabledata1" align="right"><b>8.55</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140627p00567500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">4.35</td><td class="yfnc_tabledata1" align="right">6.10</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00570000">AAPL140606P00570000</a></td><td class="yfnc_tabledata1" align="right"><b>2.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00570000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.53</b></span></td><td class="yfnc_tabledata1" align="right">1.94</td><td class="yfnc_tabledata1" align="right">2.12</td><td class="yfnc_tabledata1" align="right">117</td><td class="yfnc_tabledata1" align="right">469</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606P00570000">AAPL7140606P00570000</a></td><td class="yfnc_tabledata1" align="right"><b>7.00</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606p00570000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">1.83</td><td class="yfnc_tabledata1" align="right">2.17</td><td class="yfnc_tabledata1" align="right">7</td><td class="yfnc_tabledata1" align="right">15</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00570000">AAPL140613P00570000</a></td><td class="yfnc_tabledata1" align="right"><b>4.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00570000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.44</b></span></td><td class="yfnc_tabledata1" align="right">3.55</td><td class="yfnc_tabledata1" align="right">3.95</td><td class="yfnc_tabledata1" align="right">6</td><td class="yfnc_tabledata1" align="right">78</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613P00570000">AAPL7140613P00570000</a></td><td class="yfnc_tabledata1" align="right"><b>8.03</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613p00570000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">3.55</td><td class="yfnc_tabledata1" align="right">3.80</td><td class="yfnc_tabledata1" align="right">6</td><td class="yfnc_tabledata1" align="right">6</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00570000">AAPL140621P00570000</a></td><td class="yfnc_tabledata1" align="right"><b>4.55</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00570000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.80</b></span></td><td class="yfnc_tabledata1" align="right">4.45</td><td class="yfnc_tabledata1" align="right">4.55</td><td class="yfnc_tabledata1" align="right">759</td><td class="yfnc_tabledata1" align="right">3,360</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00570000">AAPL7140621P00570000</a></td><td class="yfnc_tabledata1" align="right"><b>4.68</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00570000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">5.32</b></span></td><td class="yfnc_tabledata1" align="right">4.40</td><td class="yfnc_tabledata1" align="right">4.65</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">80</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627P00570000">AAPL140627P00570000</a></td><td class="yfnc_tabledata1" align="right"><b>6.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627p00570000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.12</b></span></td><td class="yfnc_tabledata1" align="right">5.30</td><td class="yfnc_tabledata1" align="right">5.60</td><td class="yfnc_tabledata1" align="right">8</td><td class="yfnc_tabledata1" align="right">40</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=570.000000"><strong>570.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140627P00570000">AAPL7140627P00570000</a></td><td class="yfnc_tabledata1" align="right"><b>8.30</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140627p00570000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">5.00</td><td class="yfnc_tabledata1" align="right">6.75</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=572.500000"><strong>572.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00572500">AAPL140613P00572500</a></td><td class="yfnc_tabledata1" align="right"><b>4.38</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00572500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.69</b></span></td><td class="yfnc_tabledata1" align="right">4.10</td><td class="yfnc_tabledata1" align="right">4.50</td><td class="yfnc_tabledata1" align="right">18</td><td class="yfnc_tabledata1" align="right">93</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=572.500000"><strong>572.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613P00572500">AAPL7140613P00572500</a></td><td class="yfnc_tabledata1" align="right"><b>8.35</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613p00572500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">4.10</td><td class="yfnc_tabledata1" align="right">4.40</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">11</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=572.500000"><strong>572.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627P00572500">AAPL140627P00572500</a></td><td class="yfnc_tabledata1" align="right"><b>7.30</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627p00572500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">5.95</td><td class="yfnc_tabledata1" align="right">6.30</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">3</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=572.500000"><strong>572.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140627P00572500">AAPL7140627P00572500</a></td><td class="yfnc_tabledata1" align="right"><b>10.30</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140627p00572500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">5.60</td><td class="yfnc_tabledata1" align="right">7.50</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00575000">AAPL140606P00575000</a></td><td class="yfnc_tabledata1" align="right"><b>3.00</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00575000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.85</b></span></td><td class="yfnc_tabledata1" align="right">2.83</td><td class="yfnc_tabledata1" align="right">2.97</td><td class="yfnc_tabledata1" align="right">95</td><td class="yfnc_tabledata1" align="right">265</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606P00575000">AAPL7140606P00575000</a></td><td class="yfnc_tabledata1" align="right"><b>6.50</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606p00575000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">2.76</td><td class="yfnc_tabledata1" align="right">3.10</td><td class="yfnc_tabledata1" align="right">12</td><td class="yfnc_tabledata1" align="right">63</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00575000">AAPL140613P00575000</a></td><td class="yfnc_tabledata1" align="right"><b>5.10</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00575000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.90</b></span></td><td class="yfnc_tabledata1" align="right">4.70</td><td class="yfnc_tabledata1" align="right">5.15</td><td class="yfnc_tabledata1" align="right">22</td><td class="yfnc_tabledata1" align="right">144</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613P00575000">AAPL7140613P00575000</a></td><td class="yfnc_tabledata1" align="right"><b>6.80</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613p00575000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">4.60</td><td class="yfnc_tabledata1" align="right">5.10</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">22</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00575000">AAPL140621P00575000</a></td><td class="yfnc_tabledata1" align="right"><b>5.86</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00575000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.97</b></span></td><td class="yfnc_tabledata1" align="right">5.70</td><td class="yfnc_tabledata1" align="right">5.85</td><td class="yfnc_tabledata1" align="right">506</td><td class="yfnc_tabledata1" align="right">1,326</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00575000">AAPL7140621P00575000</a></td><td class="yfnc_tabledata1" align="right"><b>7.79</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00575000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">5.70</td><td class="yfnc_tabledata1" align="right">5.95</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">306</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=575.000000"><strong>575.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627P00575000">AAPL140627P00575000</a></td><td class="yfnc_tabledata1" align="right"><b>7.48</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627p00575000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.77</b></span></td><td class="yfnc_tabledata1" align="right">6.65</td><td class="yfnc_tabledata1" align="right">7.00</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">23</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=577.500000"><strong>577.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00577500">AAPL140613P00577500</a></td><td class="yfnc_tabledata1" align="right"><b>5.73</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00577500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.42</b></span></td><td class="yfnc_tabledata1" align="right">5.40</td><td class="yfnc_tabledata1" align="right">5.85</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">63</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=577.500000"><strong>577.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613P00577500">AAPL7140613P00577500</a></td><td class="yfnc_tabledata1" align="right"><b>10.40</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613p00577500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">5.40</td><td class="yfnc_tabledata1" align="right">5.80</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">5</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=577.500000"><strong>577.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627P00577500">AAPL140627P00577500</a></td><td class="yfnc_tabledata1" align="right"><b>10.34</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627p00577500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">7.45</td><td class="yfnc_tabledata1" align="right">7.80</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00580000">AAPL140606P00580000</a></td><td class="yfnc_tabledata1" align="right"><b>4.15</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00580000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.92</b></span></td><td class="yfnc_tabledata1" align="right">4.00</td><td class="yfnc_tabledata1" align="right">4.20</td><td class="yfnc_tabledata1" align="right">171</td><td class="yfnc_tabledata1" align="right">301</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606P00580000">AAPL7140606P00580000</a></td><td class="yfnc_tabledata1" align="right"><b>5.00</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606p00580000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">3.95</td><td class="yfnc_tabledata1" align="right">4.35</td><td class="yfnc_tabledata1" align="right">33</td><td class="yfnc_tabledata1" align="right">46</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00580000">AAPL140613P00580000</a></td><td class="yfnc_tabledata1" align="right"><b>6.58</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00580000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.42</b></span></td><td class="yfnc_tabledata1" align="right">6.20</td><td class="yfnc_tabledata1" align="right">6.60</td><td class="yfnc_tabledata1" align="right">14</td><td class="yfnc_tabledata1" align="right">86</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613P00580000">AAPL7140613P00580000</a></td><td class="yfnc_tabledata1" align="right"><b>7.40</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613p00580000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">6.05</td><td class="yfnc_tabledata1" align="right">6.60</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">22</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00580000">AAPL140621P00580000</a></td><td class="yfnc_tabledata1" align="right"><b>7.50</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00580000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.06</b></span></td><td class="yfnc_tabledata1" align="right">7.30</td><td class="yfnc_tabledata1" align="right">7.45</td><td class="yfnc_tabledata1" align="right">513</td><td class="yfnc_tabledata1" align="right">3,276</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00580000">AAPL7140621P00580000</a></td><td class="yfnc_tabledata1" align="right"><b>8.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00580000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.60</b></span></td><td class="yfnc_tabledata1" align="right">7.20</td><td class="yfnc_tabledata1" align="right">7.60</td><td class="yfnc_tabledata1" align="right">24</td><td class="yfnc_tabledata1" align="right">162</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=580.000000"><strong>580.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627P00580000">AAPL140627P00580000</a></td><td class="yfnc_tabledata1" align="right"><b>9.45</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627p00580000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.60</b></span></td><td class="yfnc_tabledata1" align="right">8.35</td><td class="yfnc_tabledata1" align="right">8.70</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">27</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=582.500000"><strong>582.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00582500">AAPL140613P00582500</a></td><td class="yfnc_tabledata1" align="right"><b>7.25</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00582500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.20</b></span></td><td class="yfnc_tabledata1" align="right">7.00</td><td class="yfnc_tabledata1" align="right">7.45</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">31</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=582.500000"><strong>582.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613P00582500">AAPL7140613P00582500</a></td><td class="yfnc_tabledata1" align="right"><b>12.85</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613p00582500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">7.00</td><td class="yfnc_tabledata1" align="right">8.85</td><td class="yfnc_tabledata1" align="right">72</td><td class="yfnc_tabledata1" align="right">72</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=582.500000"><strong>582.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627P00582500">AAPL140627P00582500</a></td><td class="yfnc_tabledata1" align="right"><b>11.95</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627p00582500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">9.25</td><td class="yfnc_tabledata1" align="right">9.65</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">384</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00585000">AAPL140606P00585000</a></td><td class="yfnc_tabledata1" align="right"><b>5.60</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.85</b></span></td><td class="yfnc_tabledata1" align="right">5.55</td><td class="yfnc_tabledata1" align="right">5.95</td><td class="yfnc_tabledata1" align="right">561</td><td class="yfnc_tabledata1" align="right">271</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606P00585000">AAPL7140606P00585000</a></td><td class="yfnc_tabledata1" align="right"><b>7.48</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606p00585000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">5.45</td><td class="yfnc_tabledata1" align="right">6.05</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">12</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00585000">AAPL140613P00585000</a></td><td class="yfnc_tabledata1" align="right"><b>9.15</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.75</b></span></td><td class="yfnc_tabledata1" align="right">7.95</td><td class="yfnc_tabledata1" align="right">8.40</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">159</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613P00585000">AAPL7140613P00585000</a></td><td class="yfnc_tabledata1" align="right"><b>10.05</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613p00585000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">7.75</td><td class="yfnc_tabledata1" align="right">10.35</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">1</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00585000">AAPL140621P00585000</a></td><td class="yfnc_tabledata1" align="right"><b>9.30</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.15</b></span></td><td class="yfnc_tabledata1" align="right">9.15</td><td class="yfnc_tabledata1" align="right">9.30</td><td class="yfnc_tabledata1" align="right">293</td><td class="yfnc_tabledata1" align="right">1,145</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00585000">AAPL7140621P00585000</a></td><td class="yfnc_tabledata1" align="right"><b>9.50</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.90</b></span></td><td class="yfnc_tabledata1" align="right">9.10</td><td class="yfnc_tabledata1" align="right">9.80</td><td class="yfnc_tabledata1" align="right">20</td><td class="yfnc_tabledata1" align="right">171</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627P00585000">AAPL140627P00585000</a></td><td class="yfnc_tabledata1" align="right"><b>10.25</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627p00585000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.65</b></span></td><td class="yfnc_tabledata1" align="right">10.25</td><td class="yfnc_tabledata1" align="right">10.60</td><td class="yfnc_tabledata1" align="right">11</td><td class="yfnc_tabledata1" align="right">6</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=585.000000"><strong>585.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140627P00585000">AAPL7140627P00585000</a></td><td class="yfnc_tabledata1" align="right"><b>13.82</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140627p00585000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">9.95</td><td class="yfnc_tabledata1" align="right">12.05</td><td class="yfnc_tabledata1" align="right">3</td><td class="yfnc_tabledata1" align="right">7</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=587.500000"><strong>587.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00587500">AAPL140613P00587500</a></td><td class="yfnc_tabledata1" align="right"><b>9.00</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00587500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.20</b></span></td><td class="yfnc_tabledata1" align="right">9.00</td><td class="yfnc_tabledata1" align="right">9.25</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">99</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=587.500000"><strong>587.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613P00587500">AAPL7140613P00587500</a></td><td class="yfnc_tabledata1" align="right"><b>13.50</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613p00587500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">8.65</td><td class="yfnc_tabledata1" align="right">11.35</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">2</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=587.500000"><strong>587.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627P00587500">AAPL140627P00587500</a></td><td class="yfnc_tabledata1" align="right"><b>14.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627p00587500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">11.30</td><td class="yfnc_tabledata1" align="right">11.70</td><td class="yfnc_tabledata1" align="right">4</td><td class="yfnc_tabledata1" align="right">54</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140606P00590000">AAPL140606P00590000</a></td><td class="yfnc_tabledata1" align="right"><b>7.80</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140606p00590000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.20</b></span></td><td class="yfnc_tabledata1" align="right">7.60</td><td class="yfnc_tabledata1" align="right">7.85</td><td class="yfnc_tabledata1" align="right">264</td><td class="yfnc_tabledata1" align="right">546</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140606P00590000">AAPL7140606P00590000</a></td><td class="yfnc_tabledata1" align="right"><b>17.67</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140606p00590000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">7.35</td><td class="yfnc_tabledata1" align="right">9.40</td><td class="yfnc_tabledata1" align="right">9</td><td class="yfnc_tabledata1" align="right">38</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00590000">AAPL140613P00590000</a></td><td class="yfnc_tabledata1" align="right"><b>10.80</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00590000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.55</b></span></td><td class="yfnc_tabledata1" align="right">10.05</td><td class="yfnc_tabledata1" align="right">10.50</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">211</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140621P00590000">AAPL140621P00590000</a></td><td class="yfnc_tabledata1" align="right"><b>11.39</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140621p00590000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.97</b></span></td><td class="yfnc_tabledata1" align="right">11.30</td><td class="yfnc_tabledata1" align="right">11.45</td><td class="yfnc_tabledata1" align="right">946</td><td class="yfnc_tabledata1" align="right">2,582</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140621P00590000">AAPL7140621P00590000</a></td><td class="yfnc_tabledata1" align="right"><b>12.39</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140621p00590000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.79</b></span></td><td class="yfnc_tabledata1" align="right">11.25</td><td class="yfnc_tabledata1" align="right">11.60</td><td class="yfnc_tabledata1" align="right">5</td><td class="yfnc_tabledata1" align="right">98</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627P00590000">AAPL140627P00590000</a></td><td class="yfnc_tabledata1" align="right"><b>15.90</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627p00590000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">12.40</td><td class="yfnc_tabledata1" align="right">12.80</td><td class="yfnc_tabledata1" align="right">12</td><td class="yfnc_tabledata1" align="right">43</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=590.000000"><strong>590.00</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140627P00590000">AAPL7140627P00590000</a></td><td class="yfnc_tabledata1" align="right"><b>14.75</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140627p00590000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">12.10</td><td class="yfnc_tabledata1" align="right">14.70</td><td class="yfnc_tabledata1" align="right">2</td><td class="yfnc_tabledata1" align="right">4</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=592.500000"><strong>592.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140613P00592500">AAPL140613P00592500</a></td><td class="yfnc_tabledata1" align="right"><b>12.20</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140613p00592500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.00</b></span></td><td class="yfnc_tabledata1" align="right">11.20</td><td class="yfnc_tabledata1" align="right">11.80</td><td class="yfnc_tabledata1" align="right">10</td><td class="yfnc_tabledata1" align="right">17</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=592.500000"><strong>592.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL7140613P00592500">AAPL7140613P00592500</a></td><td class="yfnc_tabledata1" align="right"><b>13.02</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl7140613p00592500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.43</b></span></td><td class="yfnc_tabledata1" align="right">11.00</td><td class="yfnc_tabledata1" align="right">13.60</td><td class="yfnc_tabledata1" align="right">1</td><td class="yfnc_tabledata1" align="right">2</td></tr><tr><td class="yfnc_tabledata1" nowrap><a href="/q/op?s=AAPL&k=592.500000"><strong>592.50</strong></a></td><td class="yfnc_tabledata1"><a href="/q?s=AAPL140627P00592500">AAPL140627P00592500</a></td><td class="yfnc_tabledata1" align="right"><b>17.00</b></td><td class="yfnc_tabledata1" align="right"><span id="yfs_c10_aapl140627p00592500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_tabledata1" align="right">13.60</td><td class="yfnc_tabledata1" align="right">13.90</td><td class="yfnc_tabledata1" align="right">48</td><td class="yfnc_tabledata1" align="right">40</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606P00595000">AAPL140606P00595000</a></td><td class="yfnc_h" align="right"><b>10.15</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606p00595000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.95</b></span></td><td class="yfnc_h" align="right">10.00</td><td class="yfnc_h" align="right">10.30</td><td class="yfnc_h" align="right">57</td><td class="yfnc_h" align="right">406</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140606P00595000">AAPL7140606P00595000</a></td><td class="yfnc_h" align="right"><b>18.55</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140606p00595000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">9.70</td><td class="yfnc_h" align="right">12.00</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">25</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613P00595000">AAPL140613P00595000</a></td><td class="yfnc_h" align="right"><b>13.10</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613p00595000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">2.50</b></span></td><td class="yfnc_h" align="right">12.50</td><td class="yfnc_h" align="right">12.95</td><td class="yfnc_h" align="right">18</td><td class="yfnc_h" align="right">168</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140613P00595000">AAPL7140613P00595000</a></td><td class="yfnc_h" align="right"><b>16.85</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140613p00595000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">12.20</td><td class="yfnc_h" align="right">14.85</td><td class="yfnc_h" align="right">13</td><td class="yfnc_h" align="right">13</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00595000">AAPL140621P00595000</a></td><td class="yfnc_h" align="right"><b>14.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00595000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.89</b></span></td><td class="yfnc_h" align="right">13.80</td><td class="yfnc_h" align="right">13.90</td><td class="yfnc_h" align="right">185</td><td class="yfnc_h" align="right">1,228</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621P00595000">AAPL7140621P00595000</a></td><td class="yfnc_h" align="right"><b>23.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621p00595000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">13.70</td><td class="yfnc_h" align="right">14.50</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">77</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=595.000000"><strong>595.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140627P00595000">AAPL140627P00595000</a></td><td class="yfnc_h" align="right"><b>15.07</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140627p00595000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.68</b></span></td><td class="yfnc_h" align="right">14.90</td><td class="yfnc_h" align="right">15.15</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">27</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=597.500000"><strong>597.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613P00597500">AAPL140613P00597500</a></td><td class="yfnc_h" align="right"><b>17.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613p00597500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">13.90</td><td class="yfnc_h" align="right">14.65</td><td class="yfnc_h" align="right">9</td><td class="yfnc_h" align="right">33</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=597.500000"><strong>597.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140627P00597500">AAPL140627P00597500</a></td><td class="yfnc_h" align="right"><b>25.10</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140627p00597500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">16.20</td><td class="yfnc_h" align="right">16.50</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">34</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606P00600000">AAPL140606P00600000</a></td><td class="yfnc_h" align="right"><b>13.02</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606p00600000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.98</b></span></td><td class="yfnc_h" align="right">12.80</td><td class="yfnc_h" align="right">13.40</td><td class="yfnc_h" align="right">29</td><td class="yfnc_h" align="right">153</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140606P00600000">AAPL7140606P00600000</a></td><td class="yfnc_h" align="right"><b>13.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140606p00600000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">9.90</b></span></td><td class="yfnc_h" align="right">12.00</td><td class="yfnc_h" align="right">15.10</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">24</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613P00600000">AAPL140613P00600000</a></td><td class="yfnc_h" align="right"><b>15.53</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613p00600000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">3.19</b></span></td><td class="yfnc_h" align="right">15.30</td><td class="yfnc_h" align="right">15.75</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">214</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140613P00600000">AAPL7140613P00600000</a></td><td class="yfnc_h" align="right"><b>24.82</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140613p00600000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">14.90</td><td class="yfnc_h" align="right">17.50</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">5</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00600000">AAPL140621P00600000</a></td><td class="yfnc_h" align="right"><b>16.75</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00600000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.95</b></span></td><td class="yfnc_h" align="right">16.45</td><td class="yfnc_h" align="right">16.65</td><td class="yfnc_h" align="right">218</td><td class="yfnc_h" align="right">2,099</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621P00600000">AAPL7140621P00600000</a></td><td class="yfnc_h" align="right"><b>22.80</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621p00600000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">16.45</td><td class="yfnc_h" align="right">17.30</td><td class="yfnc_h" align="right">10</td><td class="yfnc_h" align="right">71</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140627P00600000">AAPL140627P00600000</a></td><td class="yfnc_h" align="right"><b>20.20</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140627p00600000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">17.60</td><td class="yfnc_h" align="right">18.10</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=600.000000"><strong>600.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140627P00600000">AAPL7140627P00600000</a></td><td class="yfnc_h" align="right"><b>20.90</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140627p00600000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">16.95</td><td class="yfnc_h" align="right">19.50</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">2</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=602.500000"><strong>602.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613P00602500">AAPL140613P00602500</a></td><td class="yfnc_h" align="right"><b>19.37</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613p00602500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">16.80</td><td class="yfnc_h" align="right">17.50</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">23</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=602.500000"><strong>602.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140627P00602500">AAPL140627P00602500</a></td><td class="yfnc_h" align="right"><b>28.40</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140627p00602500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">19.10</td><td class="yfnc_h" align="right">19.60</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">3</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=605.000000"><strong>605.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606P00605000">AAPL140606P00605000</a></td><td class="yfnc_h" align="right"><b>16.55</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606p00605000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">0.70</b></span></td><td class="yfnc_h" align="right">16.10</td><td class="yfnc_h" align="right">16.35</td><td class="yfnc_h" align="right">17</td><td class="yfnc_h" align="right">695</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=605.000000"><strong>605.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140606P00605000">AAPL7140606P00605000</a></td><td class="yfnc_h" align="right"><b>20.75</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140606p00605000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">15.00</td><td class="yfnc_h" align="right">18.30</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">4</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=605.000000"><strong>605.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613P00605000">AAPL140613P00605000</a></td><td class="yfnc_h" align="right"><b>18.65</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613p00605000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">3.85</b></span></td><td class="yfnc_h" align="right">18.35</td><td class="yfnc_h" align="right">19.05</td><td class="yfnc_h" align="right">7</td><td class="yfnc_h" align="right">41</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=605.000000"><strong>605.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140613P00605000">AAPL7140613P00605000</a></td><td class="yfnc_h" align="right"><b>23.40</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140613p00605000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">17.10</td><td class="yfnc_h" align="right">20.00</td><td class="yfnc_h" align="right">11</td><td class="yfnc_h" align="right">11</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=605.000000"><strong>605.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00605000">AAPL140621P00605000</a></td><td class="yfnc_h" align="right"><b>19.85</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00605000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.10</b></span></td><td class="yfnc_h" align="right">19.55</td><td class="yfnc_h" align="right">19.70</td><td class="yfnc_h" align="right">118</td><td class="yfnc_h" align="right">468</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=605.000000"><strong>605.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621P00605000">AAPL7140621P00605000</a></td><td class="yfnc_h" align="right"><b>30.30</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621p00605000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">19.50</td><td class="yfnc_h" align="right">20.35</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">5</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=607.500000"><strong>607.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140613P00607500">AAPL7140613P00607500</a></td><td class="yfnc_h" align="right"><b>25.05</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140613p00607500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">19.15</td><td class="yfnc_h" align="right">21.75</td><td class="yfnc_h" align="right">12</td><td class="yfnc_h" align="right">12</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=607.500000"><strong>607.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140627P00607500">AAPL140627P00607500</a></td><td class="yfnc_h" align="right"><b>26.10</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140627p00607500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">22.20</td><td class="yfnc_h" align="right">22.85</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">2</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=610.000000"><strong>610.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606P00610000">AAPL140606P00610000</a></td><td class="yfnc_h" align="right"><b>20.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606p00610000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">10.10</b></span></td><td class="yfnc_h" align="right">19.70</td><td class="yfnc_h" align="right">20.00</td><td class="yfnc_h" align="right">34</td><td class="yfnc_h" align="right">73</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=610.000000"><strong>610.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140606P00610000">AAPL7140606P00610000</a></td><td class="yfnc_h" align="right"><b>24.10</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140606p00610000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">19.00</td><td class="yfnc_h" align="right">21.85</td><td class="yfnc_h" align="right">25</td><td class="yfnc_h" align="right">26</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=610.000000"><strong>610.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613P00610000">AAPL140613P00610000</a></td><td class="yfnc_h" align="right"><b>24.70</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613p00610000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">21.65</td><td class="yfnc_h" align="right">22.60</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">7</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=610.000000"><strong>610.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00610000">AAPL140621P00610000</a></td><td class="yfnc_h" align="right"><b>23.20</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00610000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.00</b></span></td><td class="yfnc_h" align="right">22.80</td><td class="yfnc_h" align="right">23.10</td><td class="yfnc_h" align="right">61</td><td class="yfnc_h" align="right">493</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=610.000000"><strong>610.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621P00610000">AAPL7140621P00610000</a></td><td class="yfnc_h" align="right"><b>27.80</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621p00610000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">22.75</td><td class="yfnc_h" align="right">23.65</td><td class="yfnc_h" align="right">24</td><td class="yfnc_h" align="right">28</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=612.500000"><strong>612.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613P00612500">AAPL140613P00612500</a></td><td class="yfnc_h" align="right"><b>34.05</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613p00612500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">23.40</td><td class="yfnc_h" align="right">24.35</td><td class="yfnc_h" align="right">4</td><td class="yfnc_h" align="right">7</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=612.500000"><strong>612.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140613P00612500">AAPL7140613P00612500</a></td><td class="yfnc_h" align="right"><b>26.65</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140613p00612500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">22.35</td><td class="yfnc_h" align="right">25.75</td><td class="yfnc_h" align="right">10</td><td class="yfnc_h" align="right">10</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=612.500000"><strong>612.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140627P00612500">AAPL140627P00612500</a></td><td class="yfnc_h" align="right"><b>26.20</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140627p00612500"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">8.45</b></span></td><td class="yfnc_h" align="right">25.65</td><td class="yfnc_h" align="right">26.30</td><td class="yfnc_h" align="right">25</td><td class="yfnc_h" align="right">25</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=615.000000"><strong>615.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606P00615000">AAPL140606P00615000</a></td><td class="yfnc_h" align="right"><b>23.85</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606p00615000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">3.20</b></span></td><td class="yfnc_h" align="right">23.70</td><td class="yfnc_h" align="right">24.05</td><td class="yfnc_h" align="right">34</td><td class="yfnc_h" align="right">35</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=615.000000"><strong>615.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613P00615000">AAPL140613P00615000</a></td><td class="yfnc_h" align="right"><b>34.30</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613p00615000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">25.30</td><td class="yfnc_h" align="right">26.40</td><td class="yfnc_h" align="right">4</td><td class="yfnc_h" align="right">6</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=615.000000"><strong>615.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00615000">AAPL140621P00615000</a></td><td class="yfnc_h" align="right"><b>37.45</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00615000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">26.50</td><td class="yfnc_h" align="right">26.75</td><td class="yfnc_h" align="right">13</td><td class="yfnc_h" align="right">184</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=615.000000"><strong>615.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621P00615000">AAPL7140621P00615000</a></td><td class="yfnc_h" align="right"><b>82.30</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621p00615000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">26.40</td><td class="yfnc_h" align="right">27.15</td><td class="yfnc_h" align="right">20</td><td class="yfnc_h" align="right">10</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=617.500000"><strong>617.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613P00617500">AAPL140613P00617500</a></td><td class="yfnc_h" align="right"><b>37.45</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613p00617500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">27.25</td><td class="yfnc_h" align="right">28.25</td><td class="yfnc_h" align="right">4</td><td class="yfnc_h" align="right">17</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=617.500000"><strong>617.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140627P00617500">AAPL7140627P00617500</a></td><td class="yfnc_h" align="right"><b>39.68</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140627p00617500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">27.90</td><td class="yfnc_h" align="right">31.25</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">3</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=620.000000"><strong>620.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606P00620000">AAPL140606P00620000</a></td><td class="yfnc_h" align="right"><b>28.70</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606p00620000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">10.05</b></span></td><td class="yfnc_h" align="right">27.65</td><td class="yfnc_h" align="right">28.75</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">5</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=620.000000"><strong>620.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140606P00620000">AAPL7140606P00620000</a></td><td class="yfnc_h" align="right"><b>32.56</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140606p00620000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">26.60</td><td class="yfnc_h" align="right">29.95</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">4</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=620.000000"><strong>620.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613P00620000">AAPL140613P00620000</a></td><td class="yfnc_h" align="right"><b>32.30</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613p00620000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">29.20</td><td class="yfnc_h" align="right">30.65</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">7</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=620.000000"><strong>620.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00620000">AAPL140621P00620000</a></td><td class="yfnc_h" align="right"><b>33.18</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00620000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">30.30</td><td class="yfnc_h" align="right">31.00</td><td class="yfnc_h" align="right">20</td><td class="yfnc_h" align="right">123</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=620.000000"><strong>620.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140627P00620000">AAPL7140627P00620000</a></td><td class="yfnc_h" align="right"><b>42.87</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140627p00620000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">29.90</td><td class="yfnc_h" align="right">33.10</td><td class="yfnc_h" align="right">3</td><td class="yfnc_h" align="right">3</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=625.000000"><strong>625.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606P00625000">AAPL140606P00625000</a></td><td class="yfnc_h" align="right"><b>43.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606p00625000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">32.10</td><td class="yfnc_h" align="right">33.15</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">33</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=625.000000"><strong>625.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613P00625000">AAPL140613P00625000</a></td><td class="yfnc_h" align="right"><b>37.90</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613p00625000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">33.40</td><td class="yfnc_h" align="right">34.50</td><td class="yfnc_h" align="right">20</td><td class="yfnc_h" align="right">20</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=625.000000"><strong>625.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00625000">AAPL140621P00625000</a></td><td class="yfnc_h" align="right"><b>37.30</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00625000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">34.10</td><td class="yfnc_h" align="right">35.10</td><td class="yfnc_h" align="right">21</td><td class="yfnc_h" align="right">142</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=625.000000"><strong>625.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621P00625000">AAPL7140621P00625000</a></td><td class="yfnc_h" align="right"><b>91.40</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621p00625000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">33.75</td><td class="yfnc_h" align="right">36.40</td><td class="yfnc_h" align="right">20</td><td class="yfnc_h" align="right">10</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=627.500000"><strong>627.50</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140627P00627500">AAPL140627P00627500</a></td><td class="yfnc_h" align="right"><b>43.55</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140627p00627500"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">36.80</td><td class="yfnc_h" align="right">38.00</td><td class="yfnc_h" align="right">10</td><td class="yfnc_h" align="right">10</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=630.000000"><strong>630.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606P00630000">AAPL140606P00630000</a></td><td class="yfnc_h" align="right"><b>41.20</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606p00630000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">36.35</td><td class="yfnc_h" align="right">38.10</td><td class="yfnc_h" align="right">14</td><td class="yfnc_h" align="right">14</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=630.000000"><strong>630.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613P00630000">AAPL140613P00630000</a></td><td class="yfnc_h" align="right"><b>38.70</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613p00630000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">7.00</b></span></td><td class="yfnc_h" align="right">37.75</td><td class="yfnc_h" align="right">38.95</td><td class="yfnc_h" align="right">25</td><td class="yfnc_h" align="right">10</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=630.000000"><strong>630.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140613P00630000">AAPL7140613P00630000</a></td><td class="yfnc_h" align="right"><b>41.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140613p00630000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">36.95</td><td class="yfnc_h" align="right">39.75</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=630.000000"><strong>630.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00630000">AAPL140621P00630000</a></td><td class="yfnc_h" align="right"><b>39.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00630000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">10.85</b></span></td><td class="yfnc_h" align="right">38.35</td><td class="yfnc_h" align="right">39.35</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">236</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=630.000000"><strong>630.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621P00630000">AAPL7140621P00630000</a></td><td class="yfnc_h" align="right"><b>38.95</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621p00630000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">38.00</td><td class="yfnc_h" align="right">40.65</td><td class="yfnc_h" align="right">5</td><td class="yfnc_h" align="right">5</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=630.000000"><strong>630.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140627P00630000">AAPL140627P00630000</a></td><td class="yfnc_h" align="right"><b>41.85</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140627p00630000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">39.05</td><td class="yfnc_h" align="right">40.15</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=635.000000"><strong>635.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140606P00635000">AAPL140606P00635000</a></td><td class="yfnc_h" align="right"><b>46.80</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140606p00635000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">41.40</td><td class="yfnc_h" align="right">42.75</td><td class="yfnc_h" align="right">4</td><td class="yfnc_h" align="right">4</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=635.000000"><strong>635.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140613P00635000">AAPL140613P00635000</a></td><td class="yfnc_h" align="right"><b>45.30</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140613p00635000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">42.25</td><td class="yfnc_h" align="right">43.40</td><td class="yfnc_h" align="right">4</td><td class="yfnc_h" align="right">8</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=635.000000"><strong>635.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00635000">AAPL140621P00635000</a></td><td class="yfnc_h" align="right"><b>45.60</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00635000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">42.75</td><td class="yfnc_h" align="right">43.90</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">124</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=635.000000"><strong>635.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL7140621P00635000">AAPL7140621P00635000</a></td><td class="yfnc_h" align="right"><b>47.20</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl7140621p00635000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">42.10</td><td class="yfnc_h" align="right">45.00</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=640.000000"><strong>640.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00640000">AAPL140621P00640000</a></td><td class="yfnc_h" align="right"><b>48.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00640000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">1.50</b></span></td><td class="yfnc_h" align="right">47.30</td><td class="yfnc_h" align="right">48.60</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">76</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=645.000000"><strong>645.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00645000">AAPL140621P00645000</a></td><td class="yfnc_h" align="right"><b>54.50</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00645000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">51.95</td><td class="yfnc_h" align="right">53.10</td><td class="yfnc_h" align="right">23</td><td class="yfnc_h" align="right">78</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=650.000000"><strong>650.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00650000">AAPL140621P00650000</a></td><td class="yfnc_h" align="right"><b>58.00</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00650000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">8.90</b></span></td><td class="yfnc_h" align="right">56.70</td><td class="yfnc_h" align="right">57.85</td><td class="yfnc_h" align="right">2</td><td class="yfnc_h" align="right">144</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=655.000000"><strong>655.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00655000">AAPL140621P00655000</a></td><td class="yfnc_h" align="right"><b>60.80</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00655000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">61.50</td><td class="yfnc_h" align="right">62.70</td><td class="yfnc_h" align="right">23</td><td class="yfnc_h" align="right">51</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=660.000000"><strong>660.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00660000">AAPL140621P00660000</a></td><td class="yfnc_h" align="right"><b>69.80</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00660000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">66.35</td><td class="yfnc_h" align="right">67.55</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=665.000000"><strong>665.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00665000">AAPL140621P00665000</a></td><td class="yfnc_h" align="right"><b>69.25</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00665000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">71.05</td><td class="yfnc_h" align="right">72.40</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=670.000000"><strong>670.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00670000">AAPL140621P00670000</a></td><td class="yfnc_h" align="right"><b>78.75</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00670000"><img width="10" height="14" style="margin-right:-2px;" border="0" src="http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png" class="neg_arrow" alt="Down"> <b style="color:#cc0000;">9.77</b></span></td><td class="yfnc_h" align="right">76.10</td><td class="yfnc_h" align="right">77.40</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">5</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=680.000000"><strong>680.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00680000">AAPL140621P00680000</a></td><td class="yfnc_h" align="right"><b>81.60</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00680000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">86.00</td><td class="yfnc_h" align="right">87.25</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=685.000000"><strong>685.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00685000">AAPL140621P00685000</a></td><td class="yfnc_h" align="right"><b>99.75</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00685000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">90.80</td><td class="yfnc_h" align="right">92.30</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=700.000000"><strong>700.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00700000">AAPL140621P00700000</a></td><td class="yfnc_h" align="right"><b>138.05</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00700000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">105.55</td><td class="yfnc_h" align="right">107.30</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">2</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=740.000000"><strong>740.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00740000">AAPL140621P00740000</a></td><td class="yfnc_h" align="right"><b>155.70</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00740000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">145.80</td><td class="yfnc_h" align="right">147.25</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=750.000000"><strong>750.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00750000">AAPL140621P00750000</a></td><td class="yfnc_h" align="right"><b>159.65</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00750000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">155.75</td><td class="yfnc_h" align="right">157.20</td><td class="yfnc_h" align="right">4</td><td class="yfnc_h" align="right">4</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=755.000000"><strong>755.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00755000">AAPL140621P00755000</a></td><td class="yfnc_h" align="right"><b>168.60</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00755000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">160.75</td><td class="yfnc_h" align="right">162.25</td><td class="yfnc_h" align="right">1</td><td class="yfnc_h" align="right">1</td></tr><tr><td class="yfnc_h" nowrap><a href="/q/op?s=AAPL&k=760.000000"><strong>760.00</strong></a></td><td class="yfnc_h"><a href="/q?s=AAPL140621P00760000">AAPL140621P00760000</a></td><td class="yfnc_h" align="right"><b>173.60</b></td><td class="yfnc_h" align="right"><span id="yfs_c10_aapl140621p00760000"> <b style="color:#000000;">0.00</b></span></td><td class="yfnc_h" align="right">165.75</td><td class="yfnc_h" align="right">167.20</td><td class="yfnc_h" align="right">8</td><td class="yfnc_h" align="right">8</td></tr></table></td></tr></table><table border="0" cellpadding="2" cellspacing="0"><tr><td width="1%"><table border="0" cellpadding="1" cellspacing="0" width="10" class="yfnc_d"><tr><td><table border="0" cellpadding="1" cellspacing="0" width="100%"><tr><td class="yfnc_h"> </td></tr></table></td></tr></table></td><td><small>Highlighted options are in-the-money.</small></td></tr></table><p style="text-align:center"><a href="/q/os?s=AAPL&m=2014-06-21"><strong>Expand to Straddle View...</strong></a></p><p class="yfi_disclaimer">Currency in USD.</p></td><td width="15"></td><td width="1%" class="skycell"><!--ADS:LOCATION=SKY--><div style="min-height:620px; _height:620px; width:160px;margin:0pt auto;"><iframe src="https://ca.adserver.yahoo.com/a?f=1184585072&p=cafinance&l=SKY&c=h&at=content%3d'no_expandable'&site-country=us&rs=guid:rTP7AzIwNi5Ye_pbUo7O_gAlMTA4LlNyw4___xMA;spid:28951412;ypos:SKY;ypos:1400030096.781443" width=160 height=600 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no></iframe><!--http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3NWRidGxhaChnaWQkclRQN0F6SXdOaTVZZV9wYlVvN09fZ0FsTVRBNExsTnl3NF9fX3hNQSxzdCQxNDAwMDMwMDk2NzIyNDMxLHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkMzc4NTU0NjU1MSx2JDIuMCxhaWQkVEY5eW4yS0xjMjQtLGN0JDI1LHlieCRXMC5kd2ZDcWVkM3RPT1Q3enJfMExRLGJpJDE5NzM0NTc1NTEsbW1lJDgzMDE3MzE3Njg0Njg3ODgzNjMsciQwLHlvbyQxLGFncCQyOTg4MjIxMDUxLGFwJFNLWSkp/0/*--><!--QYZ 1973457551,3785546551,98.139.115.231;;SKY;28951412;1;--><script language=javascript>
+if(window.xzq_d==null)window.xzq_d=new Object();
+window.xzq_d['TF9yn2KLc24-']='(as$12rpbnkn1,aid$TF9yn2KLc24-,bi$1973457551,cr$3785546551,ct$25,at$H,eob$gd1_match_id=-1:ypos=SKY)';
+</script><noscript><img width=1 height=1 alt="" src="http://csc.beap.bc.yahoo.com/yi?bv=1.0.0&bs=(134t1g972(gid$rTP7AzIwNi5Ye_pbUo7O_gAlMTA4LlNyw4___xMA,st$1400030096722431,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3&al=(as$12rpbnkn1,aid$TF9yn2KLc24-,bi$1973457551,cr$3785546551,ct$25,at$H,eob$gd1_match_id=-1:ypos=SKY)"></noscript></div></td></tr></table> <div id="yfi_media_net" style="width:475px;height:200px;"></div><script id="mNCC" type="text/javascript">
+ medianet_width='475';
+ medianet_height= '200';
+ medianet_crid='625102783';
+ medianet_divid = 'yfi_media_net';
+ </script><script type="text/javascript">
+ ll_js.push({
+ 'file':'//mycdn.media.net/dmedianet.js?cid=8CUJ144F7'
+ });
+ </script></div> <div class="yfi_ad_s"></div></div><div class="footer_copyright"><div class="yfi_doc"><div id="footer" style="clear:both;width:100% !important;border:none;"><hr noshade size="1"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td class="footer_legal"><!--ADS:LOCATION=FOOT--><!-- APT Vendor: Yahoo, Format: Standard Graphical -->
+<font size=-2 face=arial><a href=http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3a2w4amZrMChnaWQkclRQN0F6SXdOaTVZZV9wYlVvN09fZ0FsTVRBNExsTnl3NF9fX3hNQSxzdCQxNDAwMDMwMDk2NzIyNDMxLHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkMzI3OTQxNjA1MSx2JDIuMCxhaWQkY3h0em4yS0xjMjQtLGN0JDI1LHlieCRXMC5kd2ZDcWVkM3RPT1Q3enJfMExRLGJpJDE2OTY2NDcwNTEsbW1lJDcxMjU1ODUwMzkyMjkyODQ2NDMsciQwLHJkJDEwb3Nnc2owdSx5b28kMSxhZ3AkMjQ2MzU0NzA1MSxhcCRGT09UQykp/0/*http://privacy.yahoo.com>Privacy</a> - <a href="http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3a3VzdHJmZyhnaWQkclRQN0F6SXdOaTVZZV9wYlVvN09fZ0FsTVRBNExsTnl3NF9fX3hNQSxzdCQxNDAwMDMwMDk2NzIyNDMxLHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkMzI3OTQxNjA1MSx2JDIuMCxhaWQkY3h0em4yS0xjMjQtLGN0JDI1LHlieCRXMC5kd2ZDcWVkM3RPT1Q3enJfMExRLGJpJDE2OTY2NDcwNTEsbW1lJDcxMjU1ODUwMzkyMjkyODQ2NDMsciQxLHJkJDExMnNqN2FzZyx5b28kMSxhZ3AkMjQ2MzU0NzA1MSxhcCRGT09UQykp/0/*http://info.yahoo.com/relevantads/">About Our Ads</a> - <a href=http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3a3VrYW9wZShnaWQkclRQN0F6SXdOaTVZZV9wYlVvN09fZ0FsTVRBNExsTnl3NF9fX3hNQSxzdCQxNDAwMDMwMDk2NzIyNDMxLHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkMzI3OTQxNjA1MSx2JDIuMCxhaWQkY3h0em4yS0xjMjQtLGN0JDI1LHlieCRXMC5kd2ZDcWVkM3RPT1Q3enJfMExRLGJpJDE2OTY2NDcwNTEsbW1lJDcxMjU1ODUwMzkyMjkyODQ2NDMsciQyLHJkJDExMThwcjR0OCx5b28kMSxhZ3AkMjQ2MzU0NzA1MSxhcCRGT09UQykp/0/*http://docs.yahoo.com/info/terms/>Terms</a> - <a href=http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3azNtZHM5MyhnaWQkclRQN0F6SXdOaTVZZV9wYlVvN09fZ0FsTVRBNExsTnl3NF9fX3hNQSxzdCQxNDAwMDMwMDk2NzIyNDMxLHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkMzI3OTQxNjA1MSx2JDIuMCxhaWQkY3h0em4yS0xjMjQtLGN0JDI1LHlieCRXMC5kd2ZDcWVkM3RPT1Q3enJfMExRLGJpJDE2OTY2NDcwNTEsbW1lJDcxMjU1ODUwMzkyMjkyODQ2NDMsciQzLHJkJDEybnU1aTVocCx5b28kMSxhZ3AkMjQ2MzU0NzA1MSxhcCRGT09UQykp/0/*http://feedback.help.yahoo.com/feedback.php?.src=FINANCE&.done=http://finance.yahoo.com>Send Feedback</a> - <font size=-1>Yahoo! - ABC News Network</font></font><!--QYZ 1696647051,3279416051,98.139.115.231;;FOOTC;28951412;1;--><script language=javascript>
+if(window.xzq_d==null)window.xzq_d=new Object();
+window.xzq_d['cxtzn2KLc24-']='(as$12rsu6aq8,aid$cxtzn2KLc24-,bi$1696647051,cr$3279416051,ct$25,at$H,eob$gd1_match_id=-1:ypos=PP.FOOT-FOOTC)';
+</script><noscript><img width=1 height=1 alt="" src="http://csc.beap.bc.yahoo.com/yi?bv=1.0.0&bs=(134t1g972(gid$rTP7AzIwNi5Ye_pbUo7O_gAlMTA4LlNyw4___xMA,st$1400030096722431,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3&al=(as$12rsu6aq8,aid$cxtzn2KLc24-,bi$1696647051,cr$3279416051,ct$25,at$H,eob$gd1_match_id=-1:ypos=PP.FOOT-FOOTC)"></noscript><!-- SpaceID=28951412 loc=FSRVY noad --><!-- fac-gd2-noad --><!-- gd2-status-2 --><!--QYZ CMS_NONE_SELECTED,,98.139.115.231;;FSRVY;28951412;2;--><script language=javascript>
+if(window.xzq_d==null)window.xzq_d=new Object();
+window.xzq_d['VDZzn2KLc24-']='(as$1255jbpd1,aid$VDZzn2KLc24-,cr$-1,ct$25,at$H,eob$gd1_match_id=-1:ypos=FSRVY)';
+</script><noscript><img width=1 height=1 alt="" src="http://csc.beap.bc.yahoo.com/yi?bv=1.0.0&bs=(134t1g972(gid$rTP7AzIwNi5Ye_pbUo7O_gAlMTA4LlNyw4___xMA,st$1400030096722431,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3&al=(as$1255jbpd1,aid$VDZzn2KLc24-,cr$-1,ct$25,at$H,eob$gd1_match_id=-1:ypos=FSRVY)"></noscript><!-- APT Vendor: Right Media, Format: Standard Graphical -->
+<!-- BEGIN STANDARD TAG - 1 x 1 - SIP #272 Y! C1 SIP - Mail Apt: SIP #272 Y! C1 SIP - Mail Apt - DO NOT MODIFY --> <IFRAME FRAMEBORDER=0 MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=NO WIDTH=1 HEIGHT=1 SRC="https://ads.yahoo.com/st?ad_type=iframe&ad_size=1x1§ion=2916325"></IFRAME>
+<!-- END TAG -->
+<!-- http://clicks.beap.bc.yahoo.com/yc/YnY9MS4wLjAmYnM9KDE3NTFmMzNrbihnaWQkclRQN0F6SXdOaTVZZV9wYlVvN09fZ0FsTVRBNExsTnl3NF9fX3hNQSxzdCQxNDAwMDMwMDk2NzIyNDMxLHNpJDQ0NTEwNTEsc3AkMjg5NTE0MTIsY3IkMzk4MDY4OTA1MSx2JDIuMCxhaWQkTlZGem4yS0xjMjQtLGN0JDI1LHlieCRXMC5kd2ZDcWVkM3RPT1Q3enJfMExRLGJpJDIwNzkxMzQwNTEsbW1lJDg3NTkyNzI0ODcwMjg0MTMwMzYsciQwLHlvbyQxLGFncCQzMTY2OTY1NTUxLGFwJFNJUCkp/0/* --><!--QYZ 2079134051,3980689051,98.139.115.231;;SIP;28951412;1;--><script language=javascript>
+if(window.xzq_d==null)window.xzq_d=new Object();
+window.xzq_d['NVFzn2KLc24-']='(as$12rk7jntv,aid$NVFzn2KLc24-,bi$2079134051,cr$3980689051,ct$25,at$H,eob$gd1_match_id=-1:ypos=SIP)';
+</script><noscript><img width=1 height=1 alt="" src="http://csc.beap.bc.yahoo.com/yi?bv=1.0.0&bs=(134t1g972(gid$rTP7AzIwNi5Ye_pbUo7O_gAlMTA4LlNyw4___xMA,st$1400030096722431,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3&al=(as$12rk7jntv,aid$NVFzn2KLc24-,bi$2079134051,cr$3980689051,ct$25,at$H,eob$gd1_match_id=-1:ypos=SIP)"></noscript><!-- SpaceID=28951412 loc=FOOT2 noad --><!-- fac-gd2-noad --><!-- gd2-status-2 --><!--QYZ CMS_NONE_AVAIL,,98.139.115.231;;FOOT2;28951412;2;--><script language=javascript>
+if(window.xzq_d==null)window.xzq_d=new Object();
+window.xzq_d['Fmxzn2KLc24-']='(as$1253ml0p2,aid$Fmxzn2KLc24-,cr$-1,ct$25,at$H,eob$gd1_match_id=-1:ypos=FOOT2)';
+</script><noscript><img width=1 height=1 alt="" src="http://csc.beap.bc.yahoo.com/yi?bv=1.0.0&bs=(134t1g972(gid$rTP7AzIwNi5Ye_pbUo7O_gAlMTA4LlNyw4___xMA,st$1400030096722431,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3&al=(as$1253ml0p2,aid$Fmxzn2KLc24-,cr$-1,ct$25,at$H,eob$gd1_match_id=-1:ypos=FOOT2)"></noscript></td></tr><tr><td><div class="footer_legal"></div><div class="footer_disclaimer"><p>Quotes are <strong>real-time</strong> for NASDAQ, NYSE, and NYSE MKT. See also delay times for <a href="http://help.yahoo.com/l/us/yahoo/finance/quotes/fitadelay.html">other exchanges</a>. All information provided "as is" for informational purposes only, not intended for trading purposes or advice. Neither Yahoo! nor any of independent providers is liable for any informational errors, incompleteness, or delays, or for any actions taken in reliance on information contained herein. By accessing the Yahoo! site, you agree not to redistribute the information found therein.</p><p>Fundamental company data provided by <a href="http://www.capitaliq.com">Capital IQ</a>. Historical chart data and daily updates provided by <a href="http://www.csidata.com">Commodity Systems, Inc. (CSI)</a>. International historical chart data, daily updates, fund summary, fund performance, dividend data and Morningstar Index data provided by <a href="http://www.morningstar.com/">Morningstar, Inc.</a></p></div></td></tr></table></div></div></div><!-- SpaceID=28951412 loc=UMU noad --><!-- fac-gd2-noad --><!-- gd2-status-2 --><!--QYZ CMS_NONE_AVAIL,,98.139.115.231;;UMU;28951412;2;--><script language=javascript>
+if(window.xzq_d==null)window.xzq_d=new Object();
+window.xzq_d['kgBzn2KLc24-']='(as$125hm4n3n,aid$kgBzn2KLc24-,cr$-1,ct$25,at$H,eob$gd1_match_id=-1:ypos=UMU)';
+</script><noscript><img width=1 height=1 alt="" src="http://csc.beap.bc.yahoo.com/yi?bv=1.0.0&bs=(134t1g972(gid$rTP7AzIwNi5Ye_pbUo7O_gAlMTA4LlNyw4___xMA,st$1400030096722431,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3&al=(as$125hm4n3n,aid$kgBzn2KLc24-,cr$-1,ct$25,at$H,eob$gd1_match_id=-1:ypos=UMU)"></noscript><script type="text/javascript">
+ ( function() {
+ var nav = document.getElementById("yfi_investing_nav");
+ if (nav) {
+ var content = document.getElementById("rightcol");
+ if ( content && nav.offsetHeight < content.offsetHeight) {
+ nav.style.height = content.offsetHeight + "px";
+ }
+ }
+ }());
+ </script><div id="spaceid" style="display:none;">28951412</div><script type="text/javascript">
+ if(typeof YAHOO == "undefined"){YAHOO={};}
+ if(typeof YAHOO.Finance == "undefined"){YAHOO.Finance={};}
+ if(typeof YAHOO.Finance.SymbolSuggestConfig == "undefined"){YAHOO.Finance.SymbolSuggestConfig=[];}
+
+ YAHOO.Finance.SymbolSuggestConfig.push({
+ dsServer:'http://d.yimg.com/aq/autoc',
+ dsRegion:'US',
+ dsLang:'en-US',
+ dsFooter:'<div class="moreresults"><a class="[[tickdquote]]" href="http://finance.yahoo.com/lookup?s=[[link]]">Show all results for [[tickdquote]]</a></div><div class="tip"><em>Tip:</em> Use comma (,) to separate multiple quotes. <a href="http://help.yahoo.com/l/us/yahoo/finance/quotes/quotelookup.html">Learn more...</a></div>',
+ acInputId:'pageTicker',
+ acInputFormId:'quote2',
+ acContainerId:'quote2Container',
+ acModId:'optionsget',
+ acInputFocus:'0'
+ });
+ </script></body><div id="spaceid" style="display:none;">28951412</div><script type="text/javascript">
+ if(typeof YAHOO == "undefined"){YAHOO={};}
+ if(typeof YAHOO.Finance == "undefined"){YAHOO.Finance={};}
+ if(typeof YAHOO.Finance.SymbolSuggestConfig == "undefined"){YAHOO.Finance.SymbolSuggestConfig=[];}
+
+ YAHOO.Finance.SymbolSuggestConfig.push({
+ dsServer:'http://d.yimg.com/aq/autoc',
+ dsRegion:'US',
+ dsLang:'en-US',
+ dsFooter:'<div class="moreresults"><a class="[[tickdquote]]" href="http://finance.yahoo.com/lookup?s=[[link]]">Show all results for [[tickdquote]]</a></div><div class="tip"><em>Tip:</em> Use comma (,) to separate multiple quotes. <a href="http://help.yahoo.com/l/us/yahoo/finance/quotes/quotelookup.html">Learn more...</a></div>',
+ acInputId:'txtQuotes',
+ acInputFormId:'quote',
+ acContainerId:'quoteContainer',
+ acModId:'mediaquotessearch',
+ acInputFocus:'0'
+ });
+ </script><script src="http://l.yimg.com/zz/combo?os/mit/td/stencil-0.1.150/stencil/stencil-min.js&os/mit/td/mjata-0.4.2/mjata-util/mjata-util-min.js&os/mit/td/stencil-0.1.150/stencil-source/stencil-source-min.js&os/mit/td/stencil-0.1.150/stencil-tooltip/stencil-tooltip-min.js"></script><script type="text/javascript" src="http://l1.yimg.com/bm/combo?fi/common/p/d/static/js/2.0.333292/2.0.0/mini/ylc_1.9.js&fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yfi_loader.js&fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yfi_symbol_suggest.js&fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yfi_init_symbol_suggest.js&fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yfi_nav_topnav_init.js&fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yfi_nav_topnav.js&fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yfi_nav_portfolio.js&fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yfi_fb2_expandables.js&fi/common/p/d/static/js/2.0.333292/yui_2.8.0/build/get/2.0.0/mini/get.js&fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yfi_lazy_load.js&fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yfs_concat.js&fi/common/p/d/static/js/2.0.333292/translations/2.0.0/mini/yfs_l10n_en-US.js&fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yfi_related_videos.js&fi/common/p/d/static/js/2.0.333292/2.0.0/mini/yfi_follow_quote.js"></script><span id="yfs_params_vcr" style="display:none">{"yrb_token" : "YFT_MARKET_CLOSED", "tt" : "1400030096", "s" : "aapl", "k" : "a00,a50,b00,b60,c10,c63,c64,c85,c86,g00,g53,h00,h53,l10,l84,l85,l86,p20,p43,p44,t10,t53,t54,v00,v53", "o" : "aapl140606c00490000,aapl140606c00492500,aapl140606c00495000,aapl140606c00497500,aapl140606c00500000,aapl140606c00502500,aapl140606c00505000,aapl140606c00507500,aapl140606c00510000,aapl140606c00512500,aapl140606c00515000,aapl140606c00517500,aapl140606c00520000,aapl140606c00522500,aapl140606c00525000,aapl140606c00527500,aapl140606c00530000,aapl140606c00532500,aapl140606c00535000,aapl140606c00537500,aapl140606c00540000,aapl140606c00542500,aapl140606c00545000,aapl140606c00547500,aapl140606c00550000,aapl140606c00552500,aapl140606c00555000,aapl140606c00557500,aapl140606c00560000,aapl140606c00562500,aapl140606c00565000,aapl140606c00570000,aapl140606c00575000,aapl140606c00580000,aapl140606c00585000,aapl140606c00590000,aapl140606c00595000,aapl140606c00600000,aapl140606c00605000,aapl140606c00610000,aapl140606c00615000,aapl140606c00620000,aapl140606c00625000,aapl140606c00630000,aapl140606c00635000,aapl140606c00640000,aapl140606c00645000,aapl140606c00650000,aapl140606p00490000,aapl140606p00492500,aapl140606p00495000,aapl140606p00497500,aapl140606p00500000,aapl140606p00502500,aapl140606p00505000,aapl140606p00507500,aapl140606p00510000,aapl140606p00512500,aapl140606p00515000,aapl140606p00517500,aapl140606p00520000,aapl140606p00522500,aapl140606p00525000,aapl140606p00527500,aapl140606p00530000,aapl140606p00532500,aapl140606p00535000,aapl140606p00537500,aapl140606p00540000,aapl140606p00542500,aapl140606p00545000,aapl140606p00547500,aapl140606p00550000,aapl140606p00552500,aapl140606p00555000,aapl140606p00557500,aapl140606p00560000,aapl140606p00562500,aapl140606p00565000,aapl140606p00570000,aapl140606p00575000,aapl140606p00580000,aapl140606p00585000,aapl140606p00590000,aapl140606p00595000,aapl140606p00600000,aapl140606p00605000,aapl140606p00610000,aapl140606p00615000,aapl140606p00620000,aapl140606p00625000,aapl140606p00630000,aapl140606p00635000,aapl140606p00640000,aapl140606p00645000,aapl140606p00650000,aapl140613c00500000,aapl140613c00510000,aapl140613c00515000,aapl140613c00520000,aapl140613c00525000,aapl140613c00530000,aapl140613c00535000,aapl140613c00540000,aapl140613c00545000,aapl140613c00550000,aapl140613c00555000,aapl140613c00560000,aapl140613c00562500,aapl140613c00565000,aapl140613c00567500,aapl140613c00570000,aapl140613c00572500,aapl140613c00575000,aapl140613c00577500,aapl140613c00580000,aapl140613c00582500,aapl140613c00585000,aapl140613c00587500,aapl140613c00590000,aapl140613c00592500,aapl140613c00595000,aapl140613c00597500,aapl140613c00600000,aapl140613c00602500,aapl140613c00605000,aapl140613c00607500,aapl140613c00610000,aapl140613c00612500,aapl140613c00615000,aapl140613c00617500,aapl140613c00620000,aapl140613c00622500,aapl140613c00625000,aapl140613c00627500,aapl140613c00630000,aapl140613c00632500,aapl140613c00635000,aapl140613c00640000,aapl140613c00645000,aapl140613c00650000,aapl140613p00500000,aapl140613p00510000,aapl140613p00515000,aapl140613p00520000,aapl140613p00525000,aapl140613p00530000,aapl140613p00535000,aapl140613p00540000,aapl140613p00545000,aapl140613p00550000,aapl140613p00555000,aapl140613p00560000,aapl140613p00562500,aapl140613p00565000,aapl140613p00567500,aapl140613p00570000,aapl140613p00572500,aapl140613p00575000,aapl140613p00577500,aapl140613p00580000,aapl140613p00582500,aapl140613p00585000,aapl140613p00587500,aapl140613p00590000,aapl140613p00592500,aapl140613p00595000,aapl140613p00597500,aapl140613p00600000,aapl140613p00602500,aapl140613p00605000,aapl140613p00607500,aapl140613p00610000,aapl140613p00612500,aapl140613p00615000,aapl140613p00617500,aapl140613p00620000,aapl140613p00622500,aapl140613p00625000,aapl140613p00627500,aapl140613p00630000,aapl140613p00632500,aapl140613p00635000,aapl140613p00640000,aapl140613p00645000,aapl140613p00650000,aapl140621c00265000,aapl140621c00270000,aapl140621c00275000,aapl140621c00280000,aapl140621c00285000,aapl140621c00290000,aapl140621c00295000,aapl140621c00300000,aapl140621c00305000,aapl140621c00310000,aapl140621c00315000,aapl140621c00320000,aapl140621c00325000,aapl140621c00330000,aapl140621c00335000,aapl140621c00340000,aapl140621c00345000,aapl140621c00350000,aapl140621c00355000,aapl140621c00360000,aapl140621c00365000,aapl140621c00370000,aapl140621c00375000,aapl140621c00380000,aapl140621c00385000,aapl140621c00390000,aapl140621c00395000,aapl140621c00400000,aapl140621c00405000,aapl140621c00410000,aapl140621c00415000,aapl140621c00420000,aapl140621c00425000,aapl140621c00430000,aapl140621c00435000,aapl140621c00440000,aapl140621c00445000,aapl140621c00450000,aapl140621c00455000,aapl140621c00460000,aapl140621c00465000,aapl140621c00470000,aapl140621c00475000,aapl140621c00480000,aapl140621c00485000,aapl140621c00490000,aapl140621c00495000,aapl140621c00500000,aapl140621c00505000,aapl140621c00510000,aapl140621c00515000,aapl140621c00520000,aapl140621c00525000,aapl140621c00530000,aapl140621c00535000,aapl140621c00540000,aapl140621c00545000,aapl140621c00550000,aapl140621c00555000,aapl140621c00560000,aapl140621c00565000,aapl140621c00570000,aapl140621c00575000,aapl140621c00580000,aapl140621c00585000,aapl140621c00590000,aapl140621c00595000,aapl140621c00600000,aapl140621c00605000,aapl140621c00610000,aapl140621c00615000,aapl140621c00620000,aapl140621c00625000,aapl140621c00630000,aapl140621c00635000,aapl140621c00640000,aapl140621c00645000,aapl140621c00650000,aapl140621c00655000,aapl140621c00660000,aapl140621c00665000,aapl140621c00670000,aapl140621c00675000,aapl140621c00680000,aapl140621c00685000,aapl140621c00690000,aapl140621c00695000,aapl140621c00700000,aapl140621c00705000,aapl140621c00710000,aapl140621c00715000,aapl140621c00720000,aapl140621c00725000,aapl140621c00730000,aapl140621c00735000,aapl140621c00740000,aapl140621c00745000,aapl140621c00750000,aapl140621c00755000,aapl140621c00760000,aapl140621c00765000,aapl140621c00770000,aapl140621c00775000,aapl140621c00780000,aapl140621c00785000,aapl140621p00265000,aapl140621p00270000,aapl140621p00275000,aapl140621p00280000,aapl140621p00285000,aapl140621p00290000,aapl140621p00295000,aapl140621p00300000,aapl140621p00305000,aapl140621p00310000,aapl140621p00315000,aapl140621p00320000,aapl140621p00325000,aapl140621p00330000,aapl140621p00335000,aapl140621p00340000,aapl140621p00345000,aapl140621p00350000,aapl140621p00355000,aapl140621p00360000,aapl140621p00365000,aapl140621p00370000,aapl140621p00375000,aapl140621p00380000,aapl140621p00385000,aapl140621p00390000,aapl140621p00395000,aapl140621p00400000,aapl140621p00405000,aapl140621p00410000,aapl140621p00415000,aapl140621p00420000,aapl140621p00425000,aapl140621p00430000,aapl140621p00435000,aapl140621p00440000,aapl140621p00445000,aapl140621p00450000,aapl140621p00455000,aapl140621p00460000,aapl140621p00465000,aapl140621p00470000,aapl140621p00475000,aapl140621p00480000,aapl140621p00485000,aapl140621p00490000,aapl140621p00495000,aapl140621p00500000,aapl140621p00505000,aapl140621p00510000,aapl140621p00515000,aapl140621p00520000,aapl140621p00525000,aapl140621p00530000,aapl140621p00535000,aapl140621p00540000,aapl140621p00545000,aapl140621p00550000,aapl140621p00555000,aapl140621p00560000,aapl140621p00565000,aapl140621p00570000,aapl140621p00575000,aapl140621p00580000,aapl140621p00585000,aapl140621p00590000,aapl140621p00595000,aapl140621p00600000,aapl140621p00605000,aapl140621p00610000,aapl140621p00615000,aapl140621p00620000,aapl140621p00625000,aapl140621p00630000,aapl140621p00635000,aapl140621p00640000,aapl140621p00645000,aapl140621p00650000,aapl140621p00655000,aapl140621p00660000,aapl140621p00665000,aapl140621p00670000,aapl140621p00675000,aapl140621p00680000,aapl140621p00685000,aapl140621p00690000,aapl140621p00695000,aapl140621p00700000,aapl140621p00705000,aapl140621p00710000,aapl140621p00715000,aapl140621p00720000,aapl140621p00725000,aapl140621p00730000,aapl140621p00735000,aapl140621p00740000,aapl140621p00745000,aapl140621p00750000,aapl140621p00755000,aapl140621p00760000,aapl140621p00765000,aapl140621p00770000,aapl140621p00775000,aapl140621p00780000,aapl140621p00785000,aapl140627c00530000,aapl140627c00540000,aapl140627c00545000,aapl140627c00550000,aapl140627c00555000,aapl140627c00557500,aapl140627c00560000,aapl140627c00562500,aapl140627c00565000,aapl140627c00567500,aapl140627c00570000,aapl140627c00572500,aapl140627c00575000,aapl140627c00577500,aapl140627c00580000,aapl140627c00582500,aapl140627c00585000,aapl140627c00587500,aapl140627c00590000,aapl140627c00592500,aapl140627c00595000,aapl140627c00597500,aapl140627c00600000,aapl140627c00602500,aapl140627c00605000,aapl140627c00607500,aapl140627c00610000,aapl140627c00612500,aapl140627c00615000,aapl140627c00617500,aapl140627c00620000,aapl140627c00622500,aapl140627c00625000,aapl140627c00627500,aapl140627c00630000,aapl140627c00635000,aapl140627c00640000,aapl140627c00645000,aapl140627c00650000,aapl140627p00530000,aapl140627p00540000,aapl140627p00545000,aapl140627p00550000,aapl140627p00555000,aapl140627p00557500,aapl140627p00560000,aapl140627p00562500,aapl140627p00565000,aapl140627p00567500,aapl140627p00570000,aapl140627p00572500,aapl140627p00575000,aapl140627p00577500,aapl140627p00580000,aapl140627p00582500,aapl140627p00585000,aapl140627p00587500,aapl140627p00590000,aapl140627p00592500,aapl140627p00595000,aapl140627p00597500,aapl140627p00600000,aapl140627p00602500,aapl140627p00605000,aapl140627p00607500,aapl140627p00610000,aapl140627p00612500,aapl140627p00615000,aapl140627p00617500,aapl140627p00620000,aapl140627p00622500,aapl140627p00625000,aapl140627p00627500,aapl140627p00630000,aapl140627p00635000,aapl140627p00640000,aapl140627p00645000,aapl140627p00650000,aapl7140606c00490000,aapl7140606c00492500,aapl7140606c00495000,aapl7140606c00497500,aapl7140606c00500000,aapl7140606c00502500,aapl7140606c00505000,aapl7140606c00507500,aapl7140606c00510000,aapl7140606c00512500,aapl7140606c00515000,aapl7140606c00517500,aapl7140606c00520000,aapl7140606c00522500,aapl7140606c00525000,aapl7140606c00527500,aapl7140606c00530000,aapl7140606c00532500,aapl7140606c00535000,aapl7140606c00537500,aapl7140606c00540000,aapl7140606c00542500,aapl7140606c00545000,aapl7140606c00547500,aapl7140606c00550000,aapl7140606c00552500,aapl7140606c00555000,aapl7140606c00557500,aapl7140606c00560000,aapl7140606c00562500,aapl7140606c00565000,aapl7140606c00570000,aapl7140606c00575000,aapl7140606c00580000,aapl7140606c00585000,aapl7140606c00590000,aapl7140606c00595000,aapl7140606c00600000,aapl7140606c00605000,aapl7140606c00610000,aapl7140606c00615000,aapl7140606c00620000,aapl7140606c00625000,aapl7140606c00630000,aapl7140606c00635000,aapl7140606c00640000,aapl7140606c00645000,aapl7140606c00650000,aapl7140606p00490000,aapl7140606p00492500,aapl7140606p00495000,aapl7140606p00497500,aapl7140606p00500000,aapl7140606p00502500,aapl7140606p00505000,aapl7140606p00507500,aapl7140606p00510000,aapl7140606p00512500,aapl7140606p00515000,aapl7140606p00517500,aapl7140606p00520000,aapl7140606p00522500,aapl7140606p00525000,aapl7140606p00527500,aapl7140606p00530000,aapl7140606p00532500,aapl7140606p00535000,aapl7140606p00537500,aapl7140606p00540000,aapl7140606p00542500,aapl7140606p00545000,aapl7140606p00547500,aapl7140606p00550000,aapl7140606p00552500,aapl7140606p00555000,aapl7140606p00557500,aapl7140606p00560000,aapl7140606p00562500,aapl7140606p00565000,aapl7140606p00570000,aapl7140606p00575000,aapl7140606p00580000,aapl7140606p00585000,aapl7140606p00590000,aapl7140606p00595000,aapl7140606p00600000,aapl7140606p00605000,aapl7140606p00610000,aapl7140606p00615000,aapl7140606p00620000,aapl7140606p00625000,aapl7140606p00630000,aapl7140606p00635000,aapl7140606p00640000,aapl7140606p00645000,aapl7140606p00650000,aapl7140613c00500000,aapl7140613c00510000,aapl7140613c00515000,aapl7140613c00520000,aapl7140613c00525000,aapl7140613c00530000,aapl7140613c00535000,aapl7140613c00540000,aapl7140613c00545000,aapl7140613c00550000,aapl7140613c00555000,aapl7140613c00560000,aapl7140613c00562500,aapl7140613c00565000,aapl7140613c00567500,aapl7140613c00570000,aapl7140613c00572500,aapl7140613c00575000,aapl7140613c00577500,aapl7140613c00580000,aapl7140613c00582500,aapl7140613c00585000,aapl7140613c00587500,aapl7140613c00590000,aapl7140613c00592500,aapl7140613c00595000,aapl7140613c00597500,aapl7140613c00600000,aapl7140613c00602500,aapl7140613c00605000,aapl7140613c00607500,aapl7140613c00610000,aapl7140613c00612500,aapl7140613c00615000,aapl7140613c00617500,aapl7140613c00620000,aapl7140613c00622500,aapl7140613c00625000,aapl7140613c00627500,aapl7140613c00630000,aapl7140613c00632500,aapl7140613c00635000,aapl7140613c00640000,aapl7140613c00645000,aapl7140613c00650000,aapl7140613p00500000,aapl7140613p00510000,aapl7140613p00515000,aapl7140613p00520000,aapl7140613p00525000,aapl7140613p00530000,aapl7140613p00535000,aapl7140613p00540000,aapl7140613p00545000,aapl7140613p00550000,aapl7140613p00555000,aapl7140613p00560000,aapl7140613p00562500,aapl7140613p00565000,aapl7140613p00567500,aapl7140613p00570000,aapl7140613p00572500,aapl7140613p00575000,aapl7140613p00577500,aapl7140613p00580000,aapl7140613p00582500,aapl7140613p00585000,aapl7140613p00587500,aapl7140613p00590000,aapl7140613p00592500,aapl7140613p00595000,aapl7140613p00597500,aapl7140613p00600000,aapl7140613p00602500,aapl7140613p00605000,aapl7140613p00607500,aapl7140613p00610000,aapl7140613p00612500,aapl7140613p00615000,aapl7140613p00617500,aapl7140613p00620000,aapl7140613p00622500,aapl7140613p00625000,aapl7140613p00627500,aapl7140613p00630000,aapl7140613p00632500,aapl7140613p00635000,aapl7140613p00640000,aapl7140613p00645000,aapl7140613p00650000,aapl7140621c00420000,aapl7140621c00425000,aapl7140621c00430000,aapl7140621c00435000,aapl7140621c00440000,aapl7140621c00445000,aapl7140621c00450000,aapl7140621c00455000,aapl7140621c00460000,aapl7140621c00465000,aapl7140621c00470000,aapl7140621c00475000,aapl7140621c00480000,aapl7140621c00485000,aapl7140621c00490000,aapl7140621c00495000,aapl7140621c00500000,aapl7140621c00505000,aapl7140621c00510000,aapl7140621c00515000,aapl7140621c00520000,aapl7140621c00525000,aapl7140621c00530000,aapl7140621c00535000,aapl7140621c00540000,aapl7140621c00545000,aapl7140621c00550000,aapl7140621c00555000,aapl7140621c00560000,aapl7140621c00565000,aapl7140621c00570000,aapl7140621c00575000,aapl7140621c00580000,aapl7140621c00585000,aapl7140621c00590000,aapl7140621c00595000,aapl7140621c00600000,aapl7140621c00605000,aapl7140621c00610000,aapl7140621c00615000,aapl7140621c00620000,aapl7140621c00625000,aapl7140621c00630000,aapl7140621c00635000,aapl7140621p00420000,aapl7140621p00425000,aapl7140621p00430000,aapl7140621p00435000,aapl7140621p00440000,aapl7140621p00445000,aapl7140621p00450000,aapl7140621p00455000,aapl7140621p00460000,aapl7140621p00465000,aapl7140621p00470000,aapl7140621p00475000,aapl7140621p00480000,aapl7140621p00485000,aapl7140621p00490000,aapl7140621p00495000,aapl7140621p00500000,aapl7140621p00505000,aapl7140621p00510000,aapl7140621p00515000,aapl7140621p00520000,aapl7140621p00525000,aapl7140621p00530000,aapl7140621p00535000,aapl7140621p00540000,aapl7140621p00545000,aapl7140621p00550000,aapl7140621p00555000,aapl7140621p00560000,aapl7140621p00565000,aapl7140621p00570000,aapl7140621p00575000,aapl7140621p00580000,aapl7140621p00585000,aapl7140621p00590000,aapl7140621p00595000,aapl7140621p00600000,aapl7140621p00605000,aapl7140621p00610000,aapl7140621p00615000,aapl7140621p00620000,aapl7140621p00625000,aapl7140621p00630000,aapl7140621p00635000,aapl7140627c00530000,aapl7140627c00540000,aapl7140627c00545000,aapl7140627c00550000,aapl7140627c00555000,aapl7140627c00557500,aapl7140627c00560000,aapl7140627c00562500,aapl7140627c00565000,aapl7140627c00567500,aapl7140627c00570000,aapl7140627c00572500,aapl7140627c00575000,aapl7140627c00577500,aapl7140627c00580000,aapl7140627c00582500,aapl7140627c00585000,aapl7140627c00587500,aapl7140627c00590000,aapl7140627c00592500,aapl7140627c00595000,aapl7140627c00597500,aapl7140627c00600000,aapl7140627c00602500,aapl7140627c00605000,aapl7140627c00607500,aapl7140627c00610000,aapl7140627c00612500,aapl7140627c00615000,aapl7140627c00617500,aapl7140627c00620000,aapl7140627c00622500,aapl7140627c00625000,aapl7140627c00627500,aapl7140627c00630000,aapl7140627c00635000,aapl7140627c00640000,aapl7140627c00645000,aapl7140627c00650000,aapl7140627p00530000,aapl7140627p00540000,aapl7140627p00545000,aapl7140627p00550000,aapl7140627p00555000,aapl7140627p00557500,aapl7140627p00560000,aapl7140627p00562500,aapl7140627p00565000,aapl7140627p00567500,aapl7140627p00570000,aapl7140627p00572500,aapl7140627p00575000,aapl7140627p00577500,aapl7140627p00580000,aapl7140627p00582500,aapl7140627p00585000,aapl7140627p00587500,aapl7140627p00590000,aapl7140627p00592500,aapl7140627p00595000,aapl7140627p00597500,aapl7140627p00600000,aapl7140627p00602500,aapl7140627p00605000,aapl7140627p00607500,aapl7140627p00610000,aapl7140627p00612500,aapl7140627p00615000,aapl7140627p00617500,aapl7140627p00620000,aapl7140627p00622500,aapl7140627p00625000,aapl7140627p00627500,aapl7140627p00630000,aapl7140627p00635000,aapl7140627p00640000,aapl7140627p00645000,aapl7140627p00650000,^dji,^ixic", "j" : "a00,b00,c10,l10,p20,t10,v00", "version" : "1.0", "market" : {"NAME" : "U.S.", "ID" : "us_market", "TZ" : "EDT", "TZOFFSET" : "-14400", "open" : "", "close" : "", "flags" : {}} , "market_status_yrb" : "YFT_MARKET_CLOSED" , "portfolio" : { "fd" : { "txns" : [ ]},"dd" : "","pc" : "","pcs" : ""}, "STREAMER_SERVER" : "//streamerapi.finance.yahoo.com", "DOC_DOMAIN" : "finance.yahoo.com", "localize" : "0" , "throttleInterval" : "1000" , "arrowAsChangeSign" : "true" , "up_arrow_icon" : "http://l.yimg.com/a/i/us/fi/03rd/up_g.gif" , "down_arrow_icon" : "http://l.yimg.com/a/i/us/fi/03rd/down_r.gif" , "up_color" : "green" , "down_color" : "red" , "pass_market_id" : "0" , "mu" : "1" , "lang" : "en-US" , "region" : "US" }</span><span style="display:none" id="yfs_enable_chrome">1</span><input type="hidden" id=".yficrumb" name=".yficrumb" value=""><script type="text/javascript">
+ YAHOO.util.Event.addListener(window, "load", function(){YAHOO.Finance.Streaming.init();});
+ </script><script type="text/javascript">
+ ll_js.push({
+ 'file':'http://l.yimg.com/ss/rapid-3.11.js',
+ 'success_callback' : function(){
+ if(window.RAPID_ULT) {
+ var conf = {
+ compr_type:'deflate',
+ tracked_mods:window.RAPID_ULT.tracked_mods,
+ keys:window.RAPID_ULT.page_params,
+ spaceid:28951412,
+ client_only:0,
+ webworker_file:"\/__rapid-worker-1.1.js",
+ nofollow_class:'rapid-nf',
+ test_id:'512031',
+ ywa: {
+ project_id:1000911397279,
+ document_group:"",
+ document_name:'AAPL',
+ host:'y.analytics.yahoo.com'
+ }
+ };
+ YAHOO.i13n.YWA_CF_MAP = {"_p":20,"ad":58,"authfb":11,"bpos":24,"camp":54,"cat":25,"code":55,"cpos":21,"ct":23,"dcl":26,"dir":108,"domContentLoadedEventEnd":44,"elm":56,"elmt":57,"f":40,"ft":51,"grpt":109,"ilc":39,"itc":111,"loadEventEnd":45,"ltxt":17,"mpos":110,"mrkt":12,"pcp":67,"pct":48,"pd":46,"pkgt":22,"pos":20,"prov":114,"pst":68,"pstcat":47,"pt":13,"rescode":27,"responseEnd":43,"responseStart":41,"rspns":107,"sca":53,"sec":18,"site":42,"slk":19,"sort":28,"t1":121,"t2":122,"t3":123,"t4":124,"t5":125,"t6":126,"t7":127,"t8":128,"t9":129,"tar":113,"test":14,"v":52,"ver":49,"x":50};
+ YAHOO.i13n.YWA_ACTION_MAP = {"click":12,"drag":21,"drop":106,"error":99,"hover":17,"hswipe":19,"hvr":115,"key":13,"rchvw":100,"scrl":104,"scrolldown":16,"scrollup":15,"secview":18,"secvw":116,"svct":14,"swp":103};
+ YAHOO.i13n.YWA_OUTCOME_MAP = {"abuse":51,"close":34,"cmmt":128,"cnct":127,"comment":49,"connect":36,"cueauthview":43,"cueconnectview":46,"cuedcl":61,"cuehpset":50,"cueinfoview":45,"cueloadview":44,"cueswipeview":42,"cuetop":48,"dclent":101,"dclitm":102,"drop":22,"dtctloc":118,"end":31,"entitydeclaration":40,"exprt":122,"favorite":56,"fetch":30,"filter":35,"flagcat":131,"flagitm":129,"follow":52,"hpset":27,"imprt":123,"insert":28,"itemdeclaration":37,"lgn":125,"lgo":126,"login":33,"msgview":47,"navigate":25,"open":29,"pa":111,"pgnt":113,"pl":112,"prnt":124,"reauthfb":24,"reply":54,"retweet":55,"rmct":32,"rmloc":120,"rmsvct":117,"sbmt":114,"setlayout":38,"sh":107,"share":23,"slct":121,"slctfltr":133,"slctloc":119,"sort":39,"srch":134,"svct":109,"top":26,"undo":41,"unflagcat":132,"unflagitm":130,"unfollow":53,"unsvct":110};
+ window.ins = new YAHOO.i13n.Rapid(conf); //Making ins a global variable because it might be needed by other module js
+ }
+ }
+ });
+ </script><!--
+ Begin : Page level configs for rapid
+ Configuring modules for a page in one place because having a lot of inline scripts will not be good for performance
+ --><script type="text/javascript">
+ window.RAPID_ULT ={
+ tracked_mods:{
+ 'navigation':'Navigation',
+ 'searchQuotes':'Quote Bar',
+ 'marketindices' : 'Market Indices',
+ 'yfi_investing_nav' : 'Left nav',
+ 'yfi_rt_quote_summary' : 'Quote Summary Bar',
+ 'yfncsumtab' : 'Options table',
+ 'yfi_ft' : 'Footer'
+ },
+ page_params:{
+ 'pstcat' : 'Quotes',
+ 'pt' : 'Quote Leaf Pages',
+ 'pstth' : 'Quotes Options Page'
+ }
+ }
+ </script></html><!--c14.finance.gq1.yahoo.com-->
+<!-- xslt3.finance.gq1.yahoo.com uncompressed/chunked Wed May 14 01:14:56 UTC 2014 -->
+<script language=javascript>
+(function(){window.xzq_p=function(R){M=R};window.xzq_svr=function(R){J=R};function F(S){var T=document;if(T.xzq_i==null){T.xzq_i=new Array();T.xzq_i.c=0}var R=T.xzq_i;R[++R.c]=new Image();R[R.c].src=S}window.xzq_sr=function(){var S=window;var Y=S.xzq_d;if(Y==null){return }if(J==null){return }var T=J+M;if(T.length>P){C();return }var X="";var U=0;var W=Math.random();var V=(Y.hasOwnProperty!=null);var R;for(R in Y){if(typeof Y[R]=="string"){if(V&&!Y.hasOwnProperty(R)){continue}if(T.length+X.length+Y[R].length<=P){X+=Y[R]}else{if(T.length+Y[R].length>P){}else{U++;N(T,X,U,W);X=Y[R]}}}}if(U){U++}N(T,X,U,W);C()};function N(R,U,S,T){if(U.length>0){R+="&al="}F(R+U+"&s="+S+"&r="+T)}function C(){window.xzq_d=null;M=null;J=null}function K(R){xzq_sr()}function B(R){xzq_sr()}function L(U,V,W){if(W){var R=W.toString();var T=U;var Y=R.match(new RegExp("\\\\(([^\\\\)]*)\\\\)"));Y=(Y[1].length>0?Y[1]:"e");T=T.replace(new RegExp("\\\\([^\\\\)]*\\\\)","g"),"("+Y+")");if(R.indexOf(T)<0){var X=R.indexOf("{");if(X>0){R=R.substring(X,R.length)}else{return W}R=R.replace(new RegExp("([^a-zA-Z0-9$_])this([^a-zA-Z0-9$_])","g"),"$1xzq_this$2");var Z=T+";var rv = f( "+Y+",this);";var S="{var a0 = '"+Y+"';var ofb = '"+escape(R)+"' ;var f = new Function( a0, 'xzq_this', unescape(ofb));"+Z+"return rv;}";return new Function(Y,S)}else{return W}}return V}window.xzq_eh=function(){if(E||I){this.onload=L("xzq_onload(e)",K,this.onload,0);if(E&&typeof (this.onbeforeunload)!=O){this.onbeforeunload=L("xzq_dobeforeunload(e)",B,this.onbeforeunload,0)}}};window.xzq_s=function(){setTimeout("xzq_sr()",1)};var J=null;var M=null;var Q=navigator.appName;var H=navigator.appVersion;var G=navigator.userAgent;var A=parseInt(H);var D=Q.indexOf("Microsoft");var E=D!=-1&&A>=4;var I=(Q.indexOf("Netscape")!=-1||Q.indexOf("Opera")!=-1)&&A>=4;var O="undefined";var P=2000})();
+</script><script language=javascript>
+if(window.xzq_svr)xzq_svr('http://csc.beap.bc.yahoo.com/');
+if(window.xzq_p)xzq_p('yi?bv=1.0.0&bs=(134t1g972(gid$rTP7AzIwNi5Ye_pbUo7O_gAlMTA4LlNyw4___xMA,st$1400030096722431,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3');
+if(window.xzq_s)xzq_s();
+</script><noscript><img width=1 height=1 alt="" src="http://csc.beap.bc.yahoo.com/yi?bv=1.0.0&bs=(134t1g972(gid$rTP7AzIwNi5Ye_pbUo7O_gAlMTA4LlNyw4___xMA,st$1400030096722431,si$4451051,sp$28951412,pv$1,v$2.0))&t=J_3-D_3"></noscript>
+<!-- c14.finance.gq1.yahoo.com compressed/chunked Wed May 14 01:14:55 UTC 2014 -->
diff --git a/pandas/io/tests/test_data.py b/pandas/io/tests/test_data.py
index cf7c906a273b1..c13553d14b861 100644
--- a/pandas/io/tests/test_data.py
+++ b/pandas/io/tests/test_data.py
@@ -3,11 +3,12 @@
import warnings
import nose
from nose.tools import assert_equal
-from datetime import datetime
+from datetime import datetime, date
+import os
import numpy as np
import pandas as pd
-from pandas import DataFrame
+from pandas import DataFrame, Timestamp
from pandas.io import data as web
from pandas.io.data import DataReader, SymbolWarning, RemoteDataError
from pandas.util.testing import (assert_series_equal, assert_produces_warning,
@@ -242,6 +243,12 @@ def setUpClass(cls):
year = year + 1
month = 1
cls.expiry = datetime(year, month, 1)
+ cls.dirpath = tm.get_data_path()
+ cls.html1 = os.path.join(cls.dirpath, 'yahoo_options1.html')
+ cls.html2 = os.path.join(cls.dirpath, 'yahoo_options2.html')
+ cls.root1 = cls.aapl._parse_url(cls.html1)
+ cls.root2 = cls.aapl._parse_url(cls.html2)
+
@classmethod
def tearDownClass(cls):
@@ -251,29 +258,31 @@ def tearDownClass(cls):
@network
def test_get_options_data(self):
try:
- calls, puts = self.aapl.get_options_data(expiry=self.expiry)
+ options = self.aapl.get_options_data(expiry=self.expiry)
except RemoteDataError as e:
nose.SkipTest(e)
else:
- assert len(calls)>1
- assert len(puts)>1
+ assert len(options)>1
+
def test_get_options_data(self):
# regression test GH6105
- self.assertRaises(ValueError,self.aapl.get_options_data,month=3)
- self.assertRaises(ValueError,self.aapl.get_options_data,year=1992)
+ self.assertRaises(ValueError, self.aapl.get_options_data, month=3)
+ self.assertRaises(ValueError, self.aapl.get_options_data, year=1992)
@network
def test_get_near_stock_price(self):
try:
- calls, puts = self.aapl.get_near_stock_price(call=True, put=True,
+ options = self.aapl.get_near_stock_price(call=True, put=True,
expiry=self.expiry)
except RemoteDataError as e:
nose.SkipTest(e)
else:
- self.assertEqual(len(calls), 5)
- self.assertEqual(len(puts), 5)
+ assert len(options)> 1
+
+ self.assertTrue(len(options) > 1)
+
@network
def test_get_call_data(self):
@@ -293,6 +302,52 @@ def test_get_put_data(self):
else:
assert len(puts)>1
+ @network
+ def test_get_expiry_months(self):
+ try:
+ dates = self.aapl._get_expiry_months()
+ except RemoteDataError:
+ raise nose.SkipTest("RemoteDataError thrown no dates found")
+ self.assertTrue(len(dates) > 1)
+
+ @network
+ def test_get_all_data(self):
+ try:
+ data = self.aapl.get_all_data(put=True)
+ except RemoteDataError:
+ raise nose.SkipTest("RemoteDataError thrown")
+
+ self.assertTrue(len(data) > 1)
+
+ @network
+ def test_get_all_data_calls_only(self):
+ try:
+ data = self.aapl.get_all_data(call=True, put=False)
+ except RemoteDataError:
+ raise nose.SkipTest("RemoteDataError thrown")
+
+ self.assertTrue(len(data) > 1)
+
+ def test_sample_page_price_quote_time1(self):
+ #Tests the weekend quote time format
+ price, quote_time = self.aapl._get_underlying_price(self.root1)
+ self.assertIsInstance(price, (int, float, complex))
+ self.assertIsInstance(quote_time, (datetime, Timestamp))
+
+ def test_sample_page_price_quote_time2(self):
+ #Tests the weekday quote time format
+ price, quote_time = self.aapl._get_underlying_price(self.root2)
+ self.assertIsInstance(price, (int, float, complex))
+ self.assertIsInstance(quote_time, (datetime, Timestamp))
+
+ def test_sample_page_chg_float(self):
+ #Tests that numeric columns with comma's are appropriately dealt with
+ tables = self.root1.xpath('.//table')
+ data = web._parse_options_data(tables[self.aapl._TABLE_LOC['puts']])
+ option_data = self.aapl._process_data(data)
+ self.assertEqual(option_data['Chg'].dtype, 'float64')
+
+
class TestOptionsWarnings(tm.TestCase):
@classmethod
@@ -327,7 +382,7 @@ def test_get_options_data_warning(self):
def test_get_near_stock_price_warning(self):
with assert_produces_warning():
try:
- calls_near, puts_near = self.aapl.get_near_stock_price(call=True,
+ options_near = self.aapl.get_near_stock_price(call=True,
put=True,
month=self.month,
year=self.year)
| ... a ticker.
Also added a few helper functions. These functions could be applied to refactor some of the other methods.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5602 | 2013-11-27T20:55:58Z | 2014-06-17T14:44:30Z | 2014-06-17T14:44:30Z | 2014-06-17T15:56:36Z |
TST/API: test the list of NA values in the csv parser. add N/A, #NA as independent default values (GH5521) | diff --git a/doc/source/io.rst b/doc/source/io.rst
index 0f34e94084878..a6f022d85272e 100644
--- a/doc/source/io.rst
+++ b/doc/source/io.rst
@@ -564,7 +564,7 @@ the corresponding equivalent values will also imply a missing value (in this cas
``[5.0,5]`` are recognized as ``NaN``.
To completely override the default values that are recognized as missing, specify ``keep_default_na=False``.
-The default ``NaN`` recognized values are ``['-1.#IND', '1.#QNAN', '1.#IND', '-1.#QNAN', '#N/A N/A', 'NA',
+The default ``NaN`` recognized values are ``['-1.#IND', '1.#QNAN', '1.#IND', '-1.#QNAN', '#N/A','N/A', 'NA',
'#NA', 'NULL', 'NaN', 'nan']``.
.. code-block:: python
diff --git a/doc/source/release.rst b/doc/source/release.rst
index cb17e7b3d4b23..35e00d9ed9850 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -126,7 +126,7 @@ Improvements to existing features
(:issue:`4039`) with improved validation for all (:issue:`4039`,
:issue:`4794`)
- A Series of dtype ``timedelta64[ns]`` can now be divided/multiplied
- by an integer series (:issue`4521`)
+ by an integer series (:issue:`4521`)
- A Series of dtype ``timedelta64[ns]`` can now be divided by another
``timedelta64[ns]`` object to yield a ``float64`` dtyped Series. This
is frequency conversion; astyping is also supported.
@@ -409,6 +409,8 @@ API Changes
- raise/warn ``SettingWithCopyError/Warning`` exception/warning when setting of a
copy thru chained assignment is detected, settable via option ``mode.chained_assignment``
+ - test the list of ``NA`` values in the csv parser. add ``N/A``, ``#NA`` as independent default
+ na values (:issue:`5521`)
Internal Refactoring
~~~~~~~~~~~~~~~~~~~~
diff --git a/pandas/io/parsers.py b/pandas/io/parsers.py
index c10cb84de34fd..e62ecd5a541df 100644
--- a/pandas/io/parsers.py
+++ b/pandas/io/parsers.py
@@ -438,7 +438,7 @@ def read_fwf(filepath_or_buffer, colspecs='infer', widths=None, **kwds):
# no longer excluding inf representations
# '1.#INF','-1.#INF', '1.#INF000000',
_NA_VALUES = set(['-1.#IND', '1.#QNAN', '1.#IND', '-1.#QNAN',
- '#N/A N/A', 'NA', '#NA', 'NULL', 'NaN',
+ '#N/A','N/A', 'NA', '#NA', 'NULL', 'NaN',
'nan', ''])
diff --git a/pandas/io/tests/test_parsers.py b/pandas/io/tests/test_parsers.py
index 84736f16e7cba..37d3c6c55ba65 100644
--- a/pandas/io/tests/test_parsers.py
+++ b/pandas/io/tests/test_parsers.py
@@ -683,6 +683,31 @@ def test_non_string_na_values(self):
tm.assert_frame_equal(result6,good_compare)
tm.assert_frame_equal(result7,good_compare)
+ def test_default_na_values(self):
+ _NA_VALUES = set(['-1.#IND', '1.#QNAN', '1.#IND', '-1.#QNAN',
+ '#N/A','N/A', 'NA', '#NA', 'NULL', 'NaN',
+ 'nan', ''])
+
+ nv = len(_NA_VALUES)
+ def f(i, v):
+ if i == 0:
+ buf = ''
+ elif i > 0:
+ buf = ''.join([','] * i)
+
+ buf = "{0}{1}".format(buf,v)
+
+ if i < nv-1:
+ buf = "{0}{1}".format(buf,''.join([','] * (nv-i-1)))
+
+ return buf
+
+ data = StringIO('\n'.join([ f(i, v) for i, v in enumerate(_NA_VALUES) ]))
+
+ expected = DataFrame(np.nan,columns=range(nv),index=range(nv))
+ df = self.read_csv(data, header=None)
+ tm.assert_frame_equal(df, expected)
+
def test_custom_na_values(self):
data = """A,B,C
ignore,this,row
| closes #5521
| https://api.github.com/repos/pandas-dev/pandas/pulls/5601 | 2013-11-27T19:18:20Z | 2013-11-27T19:56:34Z | 2013-11-27T19:56:34Z | 2014-06-24T17:42:26Z |
BUG: replace with a scalar works like a list of to_replace for compat with 0.12 (GH5319) | diff --git a/pandas/core/generic.py b/pandas/core/generic.py
index 5ab5e9063a2c5..09d7c1ae9a415 100644
--- a/pandas/core/generic.py
+++ b/pandas/core/generic.py
@@ -41,6 +41,10 @@ def is_dictlike(x):
def _single_replace(self, to_replace, method, inplace, limit):
+ if self.ndim != 1:
+ raise TypeError('cannot replace {0} with method {1} on a {2}'.format(to_replace,
+ method,type(self).__name__))
+
orig_dtype = self.dtype
result = self if inplace else self.copy()
fill_f = com._get_fill_func(method)
@@ -2033,6 +2037,11 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
self._consolidate_inplace()
if value is None:
+ # passing a single value that is scalar like
+ # when value is None (GH5319), for compat
+ if not is_dictlike(to_replace) and not is_dictlike(regex):
+ to_replace = [ to_replace ]
+
if isinstance(to_replace, (tuple, list)):
return _single_replace(self, to_replace, method, inplace,
limit)
diff --git a/pandas/tests/test_frame.py b/pandas/tests/test_frame.py
index 280b0476efe98..00e907aeb9986 100644
--- a/pandas/tests/test_frame.py
+++ b/pandas/tests/test_frame.py
@@ -6975,6 +6975,7 @@ def test_replace_inplace(self):
assert_frame_equal(tsframe, self.tsframe.fillna(0))
self.assertRaises(TypeError, self.tsframe.replace, nan, inplace=True)
+ self.assertRaises(TypeError, self.tsframe.replace, nan)
# mixed type
self.mixed_frame['foo'][5:20] = nan
diff --git a/pandas/tests/test_series.py b/pandas/tests/test_series.py
index 5a6f790d5851e..72bb4e66b6fec 100644
--- a/pandas/tests/test_series.py
+++ b/pandas/tests/test_series.py
@@ -5140,6 +5140,18 @@ def test_replace(self):
result = ser.replace([0, 1, 2, 3, 4], [4, 3, 2, 1, 0])
assert_series_equal(result, Series([4, 3, 2, 1, 0]))
+ # API change from 0.12?
+ # GH 5319
+ ser = Series([0, np.nan, 2, 3, 4])
+ expected = ser.ffill()
+ result = ser.replace([np.nan])
+ assert_series_equal(result, expected)
+
+ ser = Series([0, np.nan, 2, 3, 4])
+ expected = ser.ffill()
+ result = ser.replace(np.nan)
+ assert_series_equal(result, expected)
+
def test_replace_with_single_list(self):
ser = Series([0, 1, 2, 3, 4])
result = ser.replace([1,2,3])
| closes #5319
Essentitally this is `ffill`
```
In [1]: Series([1,np.nan,2]).replace([np.nan])
Out[1]:
0 1
1 1
2 2
dtype: float64
In [2]: Series([1,np.nan,2]).replace(np.nan)
Out[2]:
0 1
1 1
2 2
dtype: float64
```
A bit confusing on a Frame, so raise an error
```
In [3]: DataFrame(randn(5,2)).replace(np.nan)
TypeError: cannot replace [nan] with method pad on a DataFrame
```
This was the exception before this PR on a Frame
```
TypeError: If "to_replace" and "value" are both None and "to_replace" is not a list, then regex must be a mapping
```
| https://api.github.com/repos/pandas-dev/pandas/pulls/5600 | 2013-11-27T17:50:11Z | 2013-12-01T20:00:10Z | 2013-12-01T20:00:10Z | 2014-06-14T11:01:36Z |
DOC: limit code snippet output to max_rows=15 | diff --git a/doc/source/10min.rst b/doc/source/10min.rst
index 85aafd6787f16..90198fa48bcb4 100644
--- a/doc/source/10min.rst
+++ b/doc/source/10min.rst
@@ -13,6 +13,7 @@
import pandas as pd
np.set_printoptions(precision=4, suppress=True)
options.display.mpl_style='default'
+ options.display.max_rows=15
#### portions of this were borrowed from the
#### Pandas cheatsheet
diff --git a/doc/source/basics.rst b/doc/source/basics.rst
index 99cb0e8f67b09..a1724710e585e 100644
--- a/doc/source/basics.rst
+++ b/doc/source/basics.rst
@@ -9,6 +9,7 @@
randn = np.random.randn
np.set_printoptions(precision=4, suppress=True)
from pandas.compat import lrange
+ options.display.max_rows=15
==============================
Essential Basic Functionality
diff --git a/doc/source/comparison_with_r.rst b/doc/source/comparison_with_r.rst
index ef609aaa7d70c..c05ec01df6bcc 100644
--- a/doc/source/comparison_with_r.rst
+++ b/doc/source/comparison_with_r.rst
@@ -1,6 +1,12 @@
.. currentmodule:: pandas
.. _compare_with_r:
+.. ipython:: python
+ :suppress:
+
+ from pandas import *
+ options.display.max_rows=15
+
Comparison with R / R libraries
*******************************
diff --git a/doc/source/computation.rst b/doc/source/computation.rst
index 85c6b88d740da..66e0d457e33b6 100644
--- a/doc/source/computation.rst
+++ b/doc/source/computation.rst
@@ -13,6 +13,7 @@
import matplotlib.pyplot as plt
plt.close('all')
options.display.mpl_style='default'
+ options.display.max_rows=15
Computational tools
===================
diff --git a/doc/source/cookbook.rst b/doc/source/cookbook.rst
index 12891b030deb9..2bc76283bbedd 100644
--- a/doc/source/cookbook.rst
+++ b/doc/source/cookbook.rst
@@ -10,6 +10,7 @@
import os
np.random.seed(123456)
from pandas import *
+ options.display.max_rows=15
import pandas as pd
randn = np.random.randn
randint = np.random.randint
diff --git a/doc/source/dsintro.rst b/doc/source/dsintro.rst
index 828797deff5cf..3cc93d2f3e122 100644
--- a/doc/source/dsintro.rst
+++ b/doc/source/dsintro.rst
@@ -1,14 +1,6 @@
.. currentmodule:: pandas
.. _dsintro:
-************************
-Intro to Data Structures
-************************
-
-We'll start with a quick, non-comprehensive overview of the fundamental data
-structures in pandas to get you started. The fundamental behavior about data
-types, indexing, and axis labeling / alignment apply across all of the
-objects. To get started, import numpy and load pandas into your namespace:
.. ipython:: python
:suppress:
@@ -18,6 +10,17 @@ objects. To get started, import numpy and load pandas into your namespace:
randn = np.random.randn
np.set_printoptions(precision=4, suppress=True)
set_option('display.precision', 4, 'display.max_columns', 8)
+ options.display.max_rows=15
+
+
+************************
+Intro to Data Structures
+************************
+
+We'll start with a quick, non-comprehensive overview of the fundamental data
+structures in pandas to get you started. The fundamental behavior about data
+types, indexing, and axis labeling / alignment apply across all of the
+objects. To get started, import numpy and load pandas into your namespace:
.. ipython:: python
diff --git a/doc/source/enhancingperf.rst b/doc/source/enhancingperf.rst
index 4e9e62a2f0e3e..2f31e1920ae0a 100644
--- a/doc/source/enhancingperf.rst
+++ b/doc/source/enhancingperf.rst
@@ -9,6 +9,7 @@
import csv
from pandas import DataFrame
import pandas as pd
+ pd.options.display.max_rows=15
import numpy as np
np.random.seed(123456)
diff --git a/doc/source/faq.rst b/doc/source/faq.rst
index 21d581f12c53f..d64b799a865d1 100644
--- a/doc/source/faq.rst
+++ b/doc/source/faq.rst
@@ -12,6 +12,7 @@ Frequently Asked Questions (FAQ)
import numpy as np
np.random.seed(123456)
from pandas import *
+ options.display.max_rows=15
randn = np.random.randn
randint = np.random.randint
np.set_printoptions(precision=4, suppress=True)
diff --git a/doc/source/gotchas.rst b/doc/source/gotchas.rst
index 1edd6fa1705ff..97699aa32890d 100644
--- a/doc/source/gotchas.rst
+++ b/doc/source/gotchas.rst
@@ -7,6 +7,7 @@
import os
import numpy as np
from pandas import *
+ options.display.max_rows=15
randn = np.random.randn
np.set_printoptions(precision=4, suppress=True)
from pandas.compat import lrange
diff --git a/doc/source/groupby.rst b/doc/source/groupby.rst
index 705db807ddf8f..41539b5ce283e 100644
--- a/doc/source/groupby.rst
+++ b/doc/source/groupby.rst
@@ -7,6 +7,7 @@
import numpy as np
np.random.seed(123456)
from pandas import *
+ options.display.max_rows=15
randn = np.random.randn
np.set_printoptions(precision=4, suppress=True)
import matplotlib.pyplot as plt
diff --git a/doc/source/indexing.rst b/doc/source/indexing.rst
index b95c515831f55..8813e9d838d22 100644
--- a/doc/source/indexing.rst
+++ b/doc/source/indexing.rst
@@ -9,6 +9,7 @@
import random
np.random.seed(123456)
from pandas import *
+ options.display.max_rows=15
import pandas as pd
randn = np.random.randn
randint = np.random.randint
diff --git a/doc/source/io.rst b/doc/source/io.rst
index 0ed4c45bc3a86..0f34e94084878 100644
--- a/doc/source/io.rst
+++ b/doc/source/io.rst
@@ -20,6 +20,7 @@
plt.close('all')
from pandas import *
+ options.display.max_rows=15
import pandas.util.testing as tm
clipdf = DataFrame({'A':[1,2,3],'B':[4,5,6],'C':['p','q','r']},
index=['x','y','z'])
diff --git a/doc/source/merging.rst b/doc/source/merging.rst
index bc3bec4de654d..a68fc6e0739d5 100644
--- a/doc/source/merging.rst
+++ b/doc/source/merging.rst
@@ -8,6 +8,7 @@
np.random.seed(123456)
from numpy import nan
from pandas import *
+ options.display.max_rows=15
randn = np.random.randn
np.set_printoptions(precision=4, suppress=True)
diff --git a/doc/source/missing_data.rst b/doc/source/missing_data.rst
index f953aeaa2a8a9..10053f61d8574 100644
--- a/doc/source/missing_data.rst
+++ b/doc/source/missing_data.rst
@@ -1,6 +1,12 @@
.. currentmodule:: pandas
.. _missing_data:
+.. ipython:: python
+ :suppress:
+
+ from pandas import *
+ options.display.max_rows=15
+
*************************
Working with missing data
*************************
diff --git a/doc/source/r_interface.rst b/doc/source/r_interface.rst
index 4f5c5a03a1be5..5af5685ed1f56 100644
--- a/doc/source/r_interface.rst
+++ b/doc/source/r_interface.rst
@@ -2,6 +2,13 @@
.. _rpy:
+.. ipython:: python
+ :suppress:
+
+ from pandas import *
+ options.display.max_rows=15
+
+
******************
rpy2 / R interface
******************
diff --git a/doc/source/release.rst b/doc/source/release.rst
index ccc34a4051508..793d1144531ec 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -20,6 +20,7 @@
plt.close('all')
from pandas import *
+ options.display.max_rows=15
import pandas.util.testing as tm
*************
diff --git a/doc/source/remote_data.rst b/doc/source/remote_data.rst
index b950876738852..f0eb687174ff8 100644
--- a/doc/source/remote_data.rst
+++ b/doc/source/remote_data.rst
@@ -19,6 +19,7 @@
plt.close('all')
from pandas import *
+ options.display.max_rows=15
import pandas.util.testing as tm
******************
diff --git a/doc/source/reshaping.rst b/doc/source/reshaping.rst
index 7415963296f7e..37a87e7c3d8f6 100644
--- a/doc/source/reshaping.rst
+++ b/doc/source/reshaping.rst
@@ -7,6 +7,7 @@
import numpy as np
np.random.seed(123456)
from pandas import *
+ options.display.max_rows=15
from pandas.core.reshape import *
import pandas.util.testing as tm
randn = np.random.randn
diff --git a/doc/source/rplot.rst b/doc/source/rplot.rst
index 8ede1a41f8dd8..12ade83261fb7 100644
--- a/doc/source/rplot.rst
+++ b/doc/source/rplot.rst
@@ -7,6 +7,7 @@
import numpy as np
np.random.seed(123456)
from pandas import *
+ options.display.max_rows=15
import pandas.util.testing as tm
randn = np.random.randn
np.set_printoptions(precision=4, suppress=True)
diff --git a/doc/source/sparse.rst b/doc/source/sparse.rst
index 67f5c4f3403c1..391aae1cd9105 100644
--- a/doc/source/sparse.rst
+++ b/doc/source/sparse.rst
@@ -13,6 +13,7 @@
import matplotlib.pyplot as plt
plt.close('all')
options.display.mpl_style='default'
+ options.display.max_rows = 15
**********************
Sparse data structures
diff --git a/doc/source/timeseries.rst b/doc/source/timeseries.rst
index bfae9638f5377..b43a8fff496b6 100644
--- a/doc/source/timeseries.rst
+++ b/doc/source/timeseries.rst
@@ -11,6 +11,7 @@
randn = np.random.randn
randint = np.random.randint
np.set_printoptions(precision=4, suppress=True)
+ options.display.max_rows=15
from dateutil.relativedelta import relativedelta
from pandas.tseries.api import *
from pandas.tseries.offsets import *
diff --git a/doc/source/visualization.rst b/doc/source/visualization.rst
index 6e357d6d38e49..29f4cf2588c2f 100644
--- a/doc/source/visualization.rst
+++ b/doc/source/visualization.rst
@@ -13,6 +13,7 @@
import matplotlib.pyplot as plt
plt.close('all')
options.display.mpl_style = 'default'
+ options.display.max_rows = 15
from pandas.compat import lrange
************************
diff --git a/doc/source/whatsnew.rst b/doc/source/whatsnew.rst
index 563847955877e..ad2af07d3d723 100644
--- a/doc/source/whatsnew.rst
+++ b/doc/source/whatsnew.rst
@@ -9,6 +9,7 @@
from pandas import *
randn = np.random.randn
np.set_printoptions(precision=4, suppress=True)
+ options.display.max_rows = 15
**********
What's New
| Most noticable in timeseries chapter.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5599 | 2013-11-27T16:03:07Z | 2013-11-27T16:03:16Z | 2013-11-27T16:03:16Z | 2014-07-16T08:41:43Z |
TST: dtype issue in test_groupby.py on windows (GH5595) | diff --git a/pandas/tests/test_groupby.py b/pandas/tests/test_groupby.py
index 51f608e20c738..d9bdc3adcd041 100644
--- a/pandas/tests/test_groupby.py
+++ b/pandas/tests/test_groupby.py
@@ -323,7 +323,7 @@ def func(dataf):
# GH5592
# inconcistent return type
df = DataFrame(dict(A = [ 'Tiger', 'Tiger', 'Tiger', 'Lamb', 'Lamb', 'Pony', 'Pony' ],
- B = np.arange(7)))
+ B = Series(np.arange(7),dtype='int64')))
def f(grp):
return grp.iloc[0]
expected = df.groupby('A').first()
| closes #5595
| https://api.github.com/repos/pandas-dev/pandas/pulls/5598 | 2013-11-27T12:55:23Z | 2013-11-27T13:28:17Z | 2013-11-27T13:28:17Z | 2014-07-09T19:32:06Z |
Add image for whatsnew docs | diff --git a/doc/source/_static/df_repr_truncated.png b/doc/source/_static/df_repr_truncated.png
new file mode 100644
index 0000000000000..8f60270358761
Binary files /dev/null and b/doc/source/_static/df_repr_truncated.png differ
| This should have been in PR #5550, but the directory is gitignored, and I missed it.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5594 | 2013-11-26T23:16:56Z | 2013-11-27T18:31:42Z | 2013-11-27T18:31:42Z | 2014-06-27T12:06:24Z |
BUG: Bug in groupby returning non-consistent types when user function returns a None, (GH5992) | diff --git a/doc/source/release.rst b/doc/source/release.rst
index ccc34a4051508..9c448aa7083c8 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -814,6 +814,7 @@ Bug Fixes
- Bug in delitem on a Series (:issue:`5542`)
- Bug fix in apply when using custom function and objects are not mutated (:issue:`5545`)
- Bug in selecting from a non-unique index with ``loc`` (:issue:`5553`)
+ - Bug in groupby returning non-consistent types when user function returns a ``None``, (:issue:`5592`)
pandas 0.12.0
-------------
diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py
index 1d5691edb6313..98c17e4f424f5 100644
--- a/pandas/core/groupby.py
+++ b/pandas/core/groupby.py
@@ -2122,11 +2122,23 @@ def _wrap_applied_output(self, keys, values, not_indexed_same=False):
else:
key_index = Index(keys, name=key_names[0])
- if isinstance(values[0], (np.ndarray, Series)):
- if isinstance(values[0], Series):
+
+ # make Nones an empty object
+ if com._count_not_none(*values) != len(values):
+ v = None
+ for v in values:
+ if v is not None:
+ break
+ if v is None:
+ return DataFrame()
+ values = [ x if x is not None else v._constructor(**v._construct_axes_dict()) for x in values ]
+
+ v = values[0]
+
+ if isinstance(v, (np.ndarray, Series)):
+ if isinstance(v, Series):
applied_index = self.obj._get_axis(self.axis)
- all_indexed_same = _all_indexes_same([x.index
- for x in values])
+ all_indexed_same = _all_indexes_same([x.index for x in values ])
singular_series = (len(values) == 1 and
applied_index.nlevels == 1)
@@ -2165,13 +2177,13 @@ def _wrap_applied_output(self, keys, values, not_indexed_same=False):
stacked_values = np.vstack([np.asarray(x)
for x in values])
- columns = values[0].index
+ columns = v.index
index = key_index
else:
stacked_values = np.vstack([np.asarray(x)
for x in values]).T
- index = values[0].index
+ index = v.index
columns = key_index
except (ValueError, AttributeError):
diff --git a/pandas/tests/test_groupby.py b/pandas/tests/test_groupby.py
index 1ee7268c0ca82..51f608e20c738 100644
--- a/pandas/tests/test_groupby.py
+++ b/pandas/tests/test_groupby.py
@@ -7,7 +7,7 @@
from datetime import datetime
from numpy import nan
-from pandas import bdate_range, Timestamp
+from pandas import date_range,bdate_range, Timestamp
from pandas.core.index import Index, MultiIndex, Int64Index
from pandas.core.common import rands
from pandas.core.api import Categorical, DataFrame
@@ -259,7 +259,7 @@ def test_groupby_bounds_check(self):
def test_groupby_grouper_f_sanity_checked(self):
import pandas as pd
- dates = pd.date_range('01-Jan-2013', periods=12, freq='MS')
+ dates = date_range('01-Jan-2013', periods=12, freq='MS')
ts = pd.TimeSeries(np.random.randn(12), index=dates)
# GH3035
@@ -320,6 +320,34 @@ def func(dataf):
result = df.groupby('X',squeeze=False).count()
tm.assert_isinstance(result,DataFrame)
+ # GH5592
+ # inconcistent return type
+ df = DataFrame(dict(A = [ 'Tiger', 'Tiger', 'Tiger', 'Lamb', 'Lamb', 'Pony', 'Pony' ],
+ B = np.arange(7)))
+ def f(grp):
+ return grp.iloc[0]
+ expected = df.groupby('A').first()
+ result = df.groupby('A').apply(f)[['B']]
+ assert_frame_equal(result,expected)
+
+ def f(grp):
+ if grp.name == 'Tiger':
+ return None
+ return grp.iloc[0]
+ result = df.groupby('A').apply(f)[['B']]
+ e = expected.copy()
+ e.loc['Tiger'] = np.nan
+ assert_frame_equal(result,e)
+
+ def f(grp):
+ if grp.name == 'Pony':
+ return None
+ return grp.iloc[0]
+ result = df.groupby('A').apply(f)[['B']]
+ e = expected.copy()
+ e.loc['Pony'] = np.nan
+ assert_frame_equal(result,e)
+
def test_agg_regression1(self):
grouped = self.tsframe.groupby([lambda x: x.year, lambda x: x.month])
result = grouped.agg(np.mean)
| closes #5592
| https://api.github.com/repos/pandas-dev/pandas/pulls/5593 | 2013-11-26T19:22:51Z | 2013-11-26T19:49:55Z | 2013-11-26T19:49:55Z | 2014-06-21T12:52:16Z |
PERF: perf enhancements in indexing/query/eval | diff --git a/pandas/computation/align.py b/pandas/computation/align.py
index 233f2b61dc463..b61169e1f55e0 100644
--- a/pandas/computation/align.py
+++ b/pandas/computation/align.py
@@ -151,7 +151,8 @@ def _align_core(terms):
f = partial(ti.reindex_axis, reindexer, axis=axis,
copy=False)
- if pd.lib.is_bool_array(ti.values):
+ # need to fill if we have a bool dtype/array
+ if isinstance(ti, (np.ndarray, pd.Series)) and ti.dtype == object and pd.lib.is_bool_array(ti.values):
r = f(fill_value=True)
else:
r = f()
diff --git a/pandas/computation/expr.py b/pandas/computation/expr.py
index bcb5570eae1fc..0baa596778996 100644
--- a/pandas/computation/expr.py
+++ b/pandas/computation/expr.py
@@ -183,6 +183,8 @@ def update(self, level=None):
while sl >= 0:
frame = frame.f_back
sl -= 1
+ if frame is None:
+ break
frames.append(frame)
for f in frames[::-1]:
self.locals.update(f.f_locals)
diff --git a/pandas/core/frame.py b/pandas/core/frame.py
index 88cf898d354e9..5d658410a0e32 100644
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -3061,9 +3061,9 @@ def combine_first(self, other):
Examples
--------
a's values prioritized, use values from b to fill holes:
-
+
>>> a.combine_first(b)
-
+
Returns
-------
@@ -3623,7 +3623,7 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
how : {'left', 'right', 'outer', 'inner'}
How to handle indexes of the two objects. Default: 'left'
for joining on index, None otherwise
-
+
* left: use calling frame's index
* right: use input frame's index
* outer: form union of indexes
diff --git a/pandas/core/generic.py b/pandas/core/generic.py
index 5be71afc18663..5ab5e9063a2c5 100644
--- a/pandas/core/generic.py
+++ b/pandas/core/generic.py
@@ -1092,7 +1092,7 @@ def take(self, indices, axis=0, convert=True):
new_data = self._data.reindex_axis(new_items, indexer=indices,
axis=0)
else:
- new_data = self._data.take(indices, axis=baxis)
+ new_data = self._data.take(indices, axis=baxis, verify=convert)
return self._constructor(new_data)\
._setitem_copy(True)\
.__finalize__(self)
diff --git a/pandas/core/indexing.py b/pandas/core/indexing.py
index fcb9a82b96211..a258135597078 100644
--- a/pandas/core/indexing.py
+++ b/pandas/core/indexing.py
@@ -978,7 +978,7 @@ def _get_slice_axis(self, slice_obj, axis=0):
if isinstance(indexer, slice):
return self._slice(indexer, axis=axis, typ='iloc')
else:
- return self.obj.take(indexer, axis=axis)
+ return self.obj.take(indexer, axis=axis, convert=False)
class _IXIndexer(_NDFrameIndexer):
@@ -1038,7 +1038,7 @@ def _get_slice_axis(self, slice_obj, axis=0):
if isinstance(indexer, slice):
return self._slice(indexer, axis=axis, typ='iloc')
else:
- return self.obj.take(indexer, axis=axis)
+ return self.obj.take(indexer, axis=axis, convert=False)
class _LocIndexer(_LocationIndexer):
@@ -1195,7 +1195,7 @@ def _get_slice_axis(self, slice_obj, axis=0):
return self._slice(slice_obj, axis=axis, raise_on_error=True,
typ='iloc')
else:
- return self.obj.take(slice_obj, axis=axis)
+ return self.obj.take(slice_obj, axis=axis, convert=False)
def _getitem_axis(self, key, axis=0):
diff --git a/pandas/core/internals.py b/pandas/core/internals.py
index 79667ecddc8a6..959d0186030cd 100644
--- a/pandas/core/internals.py
+++ b/pandas/core/internals.py
@@ -3247,10 +3247,9 @@ def take(self, indexer, new_index=None, axis=1, verify=True):
if verify:
indexer = _maybe_convert_indices(indexer, n)
-
- if ((indexer == -1) | (indexer >= n)).any():
- raise Exception('Indices must be nonzero and less than '
- 'the axis length')
+ if ((indexer == -1) | (indexer >= n)).any():
+ raise Exception('Indices must be nonzero and less than '
+ 'the axis length')
new_axes = list(self.axes)
if new_index is None:
diff --git a/vb_suite/eval.py b/vb_suite/eval.py
index 506d00b8bf9f9..3b0efa9e88f48 100644
--- a/vb_suite/eval.py
+++ b/vb_suite/eval.py
@@ -139,3 +139,14 @@
query_datetime_index = Benchmark("df.query('index < ts')",
index_setup, start_date=datetime(2013, 9, 27))
+
+setup = setup + """
+N = 1000000
+df = DataFrame({'a': np.random.randn(N)})
+min_val = df['a'].min()
+max_val = df['a'].max()
+"""
+
+query_with_boolean_selection = Benchmark("df.query('(a >= min_val) & (a <= max_val)')",
+ index_setup, start_date=datetime(2013, 9, 27))
+
| perf improvement in eval/query (and general take-like indexing)
```
In [1]: N = 1000000
In [2]: df = DataFrame({'a': np.random.randn(N)})
In [3]: min_val = df['a'].min()
In [4]: max_val = df['a'].max()
```
current master: 66980c68d188842b1c4d80d3508f539baab3cbe8
```
In [5]: %timeit df.query('(a >= min_val) & (a <= max_val)')
10 loops, best of 3: 31.6 ms per loop
```
This PR
```
In [5]: %timeit df.query('(a >= min_val) & (a <= max_val)')
10 loops, best of 3: 20.2 ms per loop
```
| https://api.github.com/repos/pandas-dev/pandas/pulls/5590 | 2013-11-26T14:09:14Z | 2013-11-26T14:28:18Z | 2013-11-26T14:28:18Z | 2014-07-16T08:41:34Z |
BUG: to_html doesn't truncate index to max_rows before formatting | diff --git a/pandas/core/format.py b/pandas/core/format.py
index 1ca68b8d47e09..cc6f5bd516a19 100644
--- a/pandas/core/format.py
+++ b/pandas/core/format.py
@@ -819,14 +819,14 @@ def _write_body(self, indent):
def _write_regular_rows(self, fmt_values, indent, truncated):
ncols = min(len(self.columns), self.max_cols)
-
+ nrows = min(len(self.frame), self.max_rows)
fmt = self.fmt._get_formatter('__index__')
if fmt is not None:
- index_values = self.frame.index.map(fmt)
+ index_values = self.frame.index[:nrows].map(fmt)
else:
- index_values = self.frame.index.format()
+ index_values = self.frame.index[:nrows].format()
- for i in range(min(len(self.frame), self.max_rows)):
+ for i in range(nrows):
row = []
row.append(index_values[i])
row.extend(fmt_values[j][i] for j in range(ncols))
diff --git a/vb_suite/frame_methods.py b/vb_suite/frame_methods.py
index b7754e28629d0..a7c863345b9c5 100644
--- a/vb_suite/frame_methods.py
+++ b/vb_suite/frame_methods.py
@@ -145,6 +145,20 @@ def f(x):
frame_to_string_floats = Benchmark('df.to_string()', setup,
start_date=datetime(2010, 6, 1))
+#----------------------------------------------------------------------
+# to_html
+
+setup = common_setup + """
+nrows=500
+df = DataFrame(randn(nrows, 10))
+df[0]=period_range("2000","2010",nrows)
+df[1]=range(nrows)
+
+"""
+
+frame_to_html_mixed = Benchmark('df.to_html()', setup,
+ start_date=datetime(2010, 6, 1))
+
# insert many columns
setup = common_setup + """
| @takluyver, missed an O(N) there.
#5588
| https://api.github.com/repos/pandas-dev/pandas/pulls/5589 | 2013-11-26T12:39:53Z | 2013-11-26T12:55:50Z | 2013-11-26T12:55:50Z | 2014-06-24T12:51:13Z |
Fix typo | diff --git a/doc/source/timeseries.rst b/doc/source/timeseries.rst
index 83e26d83a9363..bfae9638f5377 100644
--- a/doc/source/timeseries.rst
+++ b/doc/source/timeseries.rst
@@ -1115,7 +1115,7 @@ Localization of Timestamps functions just like DatetimeIndex and TimeSeries:
rng[5].tz_localize('Asia/Shanghai')
-Operations between TimeSeries in difficult time zones will yield UTC
+Operations between TimeSeries in different time zones will yield UTC
TimeSeries, aligning the data on the UTC timestamps:
.. ipython:: python
| While I know timezone conversion might be difficult, I think you mean different here :smile:
| https://api.github.com/repos/pandas-dev/pandas/pulls/5587 | 2013-11-25T19:12:21Z | 2013-11-25T19:18:40Z | 2013-11-25T19:18:40Z | 2014-07-12T13:20:39Z |
BUG/TST: reset setitem_copy on object enlargement | diff --git a/pandas/computation/tests/test_eval.py b/pandas/computation/tests/test_eval.py
index f2d75d3fd21c5..cfbd9335ef9a0 100644
--- a/pandas/computation/tests/test_eval.py
+++ b/pandas/computation/tests/test_eval.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
-import unittest
import functools
from itertools import product
@@ -104,10 +103,11 @@ def _is_py3_complex_incompat(result, expected):
_good_arith_ops = com.difference(_arith_ops_syms, _special_case_arith_ops_syms)
-class TestEvalNumexprPandas(unittest.TestCase):
+class TestEvalNumexprPandas(tm.TestCase):
@classmethod
def setUpClass(cls):
+ super(TestEvalNumexprPandas, cls).setUpClass()
skip_if_no_ne()
import numexpr as ne
cls.ne = ne
@@ -116,6 +116,7 @@ def setUpClass(cls):
@classmethod
def tearDownClass(cls):
+ super(TestEvalNumexprPandas, cls).tearDownClass()
del cls.engine, cls.parser
if hasattr(cls, 'ne'):
del cls.ne
@@ -707,6 +708,7 @@ class TestEvalNumexprPython(TestEvalNumexprPandas):
@classmethod
def setUpClass(cls):
+ super(TestEvalNumexprPython, cls).setUpClass()
skip_if_no_ne()
import numexpr as ne
cls.ne = ne
@@ -733,6 +735,7 @@ class TestEvalPythonPython(TestEvalNumexprPython):
@classmethod
def setUpClass(cls):
+ super(TestEvalPythonPython, cls).setUpClass()
cls.engine = 'python'
cls.parser = 'python'
@@ -761,6 +764,7 @@ class TestEvalPythonPandas(TestEvalPythonPython):
@classmethod
def setUpClass(cls):
+ super(TestEvalPythonPandas, cls).setUpClass()
cls.engine = 'python'
cls.parser = 'pandas'
@@ -1024,10 +1028,11 @@ def test_performance_warning_for_poor_alignment(self):
#------------------------------------
# slightly more complex ops
-class TestOperationsNumExprPandas(unittest.TestCase):
+class TestOperationsNumExprPandas(tm.TestCase):
@classmethod
def setUpClass(cls):
+ super(TestOperationsNumExprPandas, cls).setUpClass()
skip_if_no_ne()
cls.engine = 'numexpr'
cls.parser = 'pandas'
@@ -1035,6 +1040,7 @@ def setUpClass(cls):
@classmethod
def tearDownClass(cls):
+ super(TestOperationsNumExprPandas, cls).tearDownClass()
del cls.engine, cls.parser
def eval(self, *args, **kwargs):
@@ -1337,6 +1343,7 @@ class TestOperationsNumExprPython(TestOperationsNumExprPandas):
@classmethod
def setUpClass(cls):
+ super(TestOperationsNumExprPython, cls).setUpClass()
if not _USE_NUMEXPR:
raise nose.SkipTest("numexpr engine not installed")
cls.engine = 'numexpr'
@@ -1404,6 +1411,7 @@ class TestOperationsPythonPython(TestOperationsNumExprPython):
@classmethod
def setUpClass(cls):
+ super(TestOperationsPythonPython, cls).setUpClass()
cls.engine = cls.parser = 'python'
cls.arith_ops = expr._arith_ops_syms + expr._cmp_ops_syms
cls.arith_ops = filter(lambda x: x not in ('in', 'not in'),
@@ -1414,6 +1422,7 @@ class TestOperationsPythonPandas(TestOperationsNumExprPandas):
@classmethod
def setUpClass(cls):
+ super(TestOperationsPythonPandas, cls).setUpClass()
cls.engine = 'python'
cls.parser = 'pandas'
cls.arith_ops = expr._arith_ops_syms + expr._cmp_ops_syms
diff --git a/pandas/core/frame.py b/pandas/core/frame.py
index 5d658410a0e32..6ef6d8c75216f 100644
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -1563,7 +1563,7 @@ def _ixs(self, i, axis=0, copy=False):
# a location index by definition
i = _maybe_convert_indices(i, len(self._get_axis(axis)))
- return self.reindex(i, takeable=True)
+ return self.reindex(i, takeable=True)._setitem_copy(True)
else:
new_values, copy = self._data.fast_2d_xs(i, copy=copy)
return Series(new_values, index=self.columns,
@@ -2714,7 +2714,7 @@ def trans(v):
self._clear_item_cache()
else:
- return self.take(indexer, axis=axis, convert=False)
+ return self.take(indexer, axis=axis, convert=False, is_copy=False)
def sortlevel(self, level=0, axis=0, ascending=True, inplace=False):
"""
@@ -2760,7 +2760,7 @@ def sortlevel(self, level=0, axis=0, ascending=True, inplace=False):
self._clear_item_cache()
else:
- return self.take(indexer, axis=axis, convert=False)
+ return self.take(indexer, axis=axis, convert=False, is_copy=False)
def swaplevel(self, i, j, axis=0):
"""
diff --git a/pandas/core/generic.py b/pandas/core/generic.py
index 5ab5e9063a2c5..f3097a616ff95 100644
--- a/pandas/core/generic.py
+++ b/pandas/core/generic.py
@@ -1064,7 +1064,7 @@ def __delitem__(self, key):
except KeyError:
pass
- def take(self, indices, axis=0, convert=True):
+ def take(self, indices, axis=0, convert=True, is_copy=True):
"""
Analogous to ndarray.take
@@ -1073,6 +1073,7 @@ def take(self, indices, axis=0, convert=True):
indices : list / array of ints
axis : int, default 0
convert : translate neg to pos indices (default)
+ is_copy : mark the returned frame as a copy
Returns
-------
@@ -1090,12 +1091,17 @@ def take(self, indices, axis=0, convert=True):
labels = self._get_axis(axis)
new_items = labels.take(indices)
new_data = self._data.reindex_axis(new_items, indexer=indices,
- axis=0)
+ axis=baxis)
else:
- new_data = self._data.take(indices, axis=baxis, verify=convert)
- return self._constructor(new_data)\
- ._setitem_copy(True)\
- .__finalize__(self)
+ new_data = self._data.take(indices, axis=baxis)
+
+ result = self._constructor(new_data).__finalize__(self)
+
+ # maybe set copy if we didn't actually change the index
+ if is_copy and not result._get_axis(axis).equals(self._get_axis(axis)):
+ result = result._setitem_copy(is_copy)
+
+ return result
# TODO: Check if this was clearer in 0.12
def select(self, crit, axis=0):
diff --git a/pandas/core/indexing.py b/pandas/core/indexing.py
index a258135597078..08f935539ecfc 100644
--- a/pandas/core/indexing.py
+++ b/pandas/core/indexing.py
@@ -209,6 +209,7 @@ def _setitem_with_indexer(self, indexer, value):
labels = _safe_append_to_index(index, key)
self.obj._data = self.obj.reindex_axis(labels, i)._data
self.obj._maybe_update_cacher(clear=True)
+ self.obj._setitem_copy(False)
if isinstance(labels, MultiIndex):
self.obj.sortlevel(inplace=True)
diff --git a/pandas/io/tests/test_clipboard.py b/pandas/io/tests/test_clipboard.py
index 6ee0afa1c8c07..3556dfd999d40 100644
--- a/pandas/io/tests/test_clipboard.py
+++ b/pandas/io/tests/test_clipboard.py
@@ -1,5 +1,3 @@
-import unittest
-
import numpy as np
from numpy.random import randint
@@ -18,9 +16,10 @@
raise nose.SkipTest("no clipboard found")
-class TestClipboard(unittest.TestCase):
+class TestClipboard(tm.TestCase):
@classmethod
def setUpClass(cls):
+ super(TestClipboard, cls).setUpClass()
cls.data = {}
cls.data['string'] = mkdf(5, 3, c_idx_type='s', r_idx_type='i',
c_idx_names=[None], r_idx_names=[None])
@@ -43,6 +42,7 @@ def setUpClass(cls):
@classmethod
def tearDownClass(cls):
+ super(TestClipboard, cls).tearDownClass()
del cls.data_types, cls.data
def check_round_trip_frame(self, data_type, excel=None, sep=None):
diff --git a/pandas/io/tests/test_cparser.py b/pandas/io/tests/test_cparser.py
index 8db9c7de6cbcd..0b104ffba4242 100644
--- a/pandas/io/tests/test_cparser.py
+++ b/pandas/io/tests/test_cparser.py
@@ -9,7 +9,6 @@
import os
import sys
import re
-import unittest
import nose
@@ -32,7 +31,7 @@
import pandas.parser as parser
-class TestCParser(unittest.TestCase):
+class TestCParser(tm.TestCase):
def setUp(self):
self.dirpath = tm.get_data_path()
@@ -132,7 +131,7 @@ def test_integer_thousands(self):
expected = [123456, 12500]
tm.assert_almost_equal(result[0], expected)
-
+
def test_integer_thousands_alt(self):
data = '123.456\n12.500'
diff --git a/pandas/io/tests/test_data.py b/pandas/io/tests/test_data.py
index 4e2331f05001d..831be69b9db5f 100644
--- a/pandas/io/tests/test_data.py
+++ b/pandas/io/tests/test_data.py
@@ -1,6 +1,5 @@
from __future__ import print_function
from pandas import compat
-import unittest
import warnings
import nose
from nose.tools import assert_equal
@@ -35,15 +34,17 @@ def assert_n_failed_equals_n_null_columns(wngs, obj, cls=SymbolWarning):
assert msgs.str.contains('|'.join(failed_symbols)).all()
-class TestGoogle(unittest.TestCase):
+class TestGoogle(tm.TestCase):
@classmethod
def setUpClass(cls):
+ super(TestGoogle, cls).setUpClass()
cls.locales = tm.get_locales(prefix='en_US')
if not cls.locales:
raise nose.SkipTest("US English locale not available for testing")
@classmethod
def tearDownClass(cls):
+ super(TestGoogle, cls).tearDownClass()
del cls.locales
@network
@@ -105,9 +106,10 @@ def test_get_multi2(self):
assert_n_failed_equals_n_null_columns(w, result)
-class TestYahoo(unittest.TestCase):
+class TestYahoo(tm.TestCase):
@classmethod
def setUpClass(cls):
+ super(TestYahoo, cls).setUpClass()
_skip_if_no_lxml()
@network
@@ -224,9 +226,10 @@ def test_get_date_ret_index(self):
assert np.issubdtype(pan.values.dtype, np.floating)
-class TestYahooOptions(unittest.TestCase):
+class TestYahooOptions(tm.TestCase):
@classmethod
def setUpClass(cls):
+ super(TestYahooOptions, cls).setUpClass()
_skip_if_no_lxml()
# aapl has monthlies
@@ -241,6 +244,7 @@ def setUpClass(cls):
@classmethod
def tearDownClass(cls):
+ super(TestYahooOptions, cls).tearDownClass()
del cls.aapl, cls.expiry
@network
@@ -283,9 +287,10 @@ def test_get_put_data(self):
assert len(puts)>1
-class TestOptionsWarnings(unittest.TestCase):
+class TestOptionsWarnings(tm.TestCase):
@classmethod
def setUpClass(cls):
+ super(TestOptionsWarnings, cls).setUpClass()
_skip_if_no_lxml()
with assert_produces_warning(FutureWarning):
@@ -300,6 +305,7 @@ def setUpClass(cls):
@classmethod
def tearDownClass(cls):
+ super(TestOptionsWarnings, cls).tearDownClass()
del cls.aapl, cls.year, cls.month
@network
@@ -342,7 +348,7 @@ def test_get_put_data_warning(self):
warnings.warn("IndexError thrown no tables found")
-class TestDataReader(unittest.TestCase):
+class TestDataReader(tm.TestCase):
def test_is_s3_url(self):
from pandas.io.common import _is_s3_url
self.assert_(_is_s3_url("s3://pandas/somethingelse.com"))
@@ -372,7 +378,7 @@ def test_read_famafrench(self):
assert isinstance(ff, dict)
-class TestFred(unittest.TestCase):
+class TestFred(tm.TestCase):
@network
def test_fred(self):
"""
diff --git a/pandas/io/tests/test_date_converters.py b/pandas/io/tests/test_date_converters.py
index 8c1009b904857..74dad8537bb88 100644
--- a/pandas/io/tests/test_date_converters.py
+++ b/pandas/io/tests/test_date_converters.py
@@ -4,7 +4,6 @@
import os
import sys
import re
-import unittest
import nose
@@ -22,9 +21,9 @@
from pandas import compat
from pandas.lib import Timestamp
import pandas.io.date_converters as conv
+import pandas.util.testing as tm
-
-class TestConverters(unittest.TestCase):
+class TestConverters(tm.TestCase):
def setUp(self):
self.years = np.array([2007, 2008])
diff --git a/pandas/io/tests/test_excel.py b/pandas/io/tests/test_excel.py
index 861f3a785ce22..3446eb07a111e 100644
--- a/pandas/io/tests/test_excel.py
+++ b/pandas/io/tests/test_excel.py
@@ -3,7 +3,6 @@
from pandas.compat import u, range, map
from datetime import datetime
import os
-import unittest
import nose
@@ -86,7 +85,7 @@ def read_csv(self, *args, **kwds):
return read_csv(*args, **kwds)
-class ExcelReaderTests(SharedItems, unittest.TestCase):
+class ExcelReaderTests(SharedItems, tm.TestCase):
def test_parse_cols_int(self):
_skip_if_no_openpyxl()
_skip_if_no_xlrd()
@@ -942,7 +941,7 @@ def test_swapped_columns(self):
tm.assert_series_equal(write_frame['B'], read_frame['B'])
-class OpenpyxlTests(ExcelWriterBase, unittest.TestCase):
+class OpenpyxlTests(ExcelWriterBase, tm.TestCase):
ext = '.xlsx'
engine_name = 'openpyxl'
check_skip = staticmethod(_skip_if_no_openpyxl)
@@ -975,7 +974,7 @@ def test_to_excel_styleconverter(self):
xlsx_style.alignment.vertical)
-class XlwtTests(ExcelWriterBase, unittest.TestCase):
+class XlwtTests(ExcelWriterBase, tm.TestCase):
ext = '.xls'
engine_name = 'xlwt'
check_skip = staticmethod(_skip_if_no_xlwt)
@@ -1002,13 +1001,13 @@ def test_to_excel_styleconverter(self):
self.assertEquals(xlwt.Alignment.VERT_TOP, xls_style.alignment.vert)
-class XlsxWriterTests(ExcelWriterBase, unittest.TestCase):
+class XlsxWriterTests(ExcelWriterBase, tm.TestCase):
ext = '.xlsx'
engine_name = 'xlsxwriter'
check_skip = staticmethod(_skip_if_no_xlsxwriter)
-class OpenpyxlTests_NoMerge(ExcelWriterBase, unittest.TestCase):
+class OpenpyxlTests_NoMerge(ExcelWriterBase, tm.TestCase):
ext = '.xlsx'
engine_name = 'openpyxl'
check_skip = staticmethod(_skip_if_no_openpyxl)
@@ -1017,7 +1016,7 @@ class OpenpyxlTests_NoMerge(ExcelWriterBase, unittest.TestCase):
merge_cells = False
-class XlwtTests_NoMerge(ExcelWriterBase, unittest.TestCase):
+class XlwtTests_NoMerge(ExcelWriterBase, tm.TestCase):
ext = '.xls'
engine_name = 'xlwt'
check_skip = staticmethod(_skip_if_no_xlwt)
@@ -1026,7 +1025,7 @@ class XlwtTests_NoMerge(ExcelWriterBase, unittest.TestCase):
merge_cells = False
-class XlsxWriterTests_NoMerge(ExcelWriterBase, unittest.TestCase):
+class XlsxWriterTests_NoMerge(ExcelWriterBase, tm.TestCase):
ext = '.xlsx'
engine_name = 'xlsxwriter'
check_skip = staticmethod(_skip_if_no_xlsxwriter)
@@ -1035,7 +1034,7 @@ class XlsxWriterTests_NoMerge(ExcelWriterBase, unittest.TestCase):
merge_cells = False
-class ExcelWriterEngineTests(unittest.TestCase):
+class ExcelWriterEngineTests(tm.TestCase):
def test_ExcelWriter_dispatch(self):
with tm.assertRaisesRegexp(ValueError, 'No engine'):
ExcelWriter('nothing')
diff --git a/pandas/io/tests/test_ga.py b/pandas/io/tests/test_ga.py
index 166917799ca82..33ead20b6815f 100644
--- a/pandas/io/tests/test_ga.py
+++ b/pandas/io/tests/test_ga.py
@@ -1,5 +1,4 @@
import os
-import unittest
from datetime import datetime
import nose
@@ -7,6 +6,7 @@
from pandas import DataFrame
from pandas.util.testing import network, assert_frame_equal, with_connectivity_check
from numpy.testing.decorators import slow
+import pandas.util.testing as tm
try:
import httplib2
@@ -17,7 +17,7 @@
except ImportError:
raise nose.SkipTest("need httplib2 and auth libs")
-class TestGoogle(unittest.TestCase):
+class TestGoogle(tm.TestCase):
_multiprocess_can_split_ = True
@@ -103,17 +103,17 @@ def test_v2_advanced_segment_format(self):
advanced_segment_id = 1234567
query = ga.format_query('google_profile_id', ['visits'], '2013-09-01', segment=advanced_segment_id)
assert query['segment'] == 'gaid::' + str(advanced_segment_id), "An integer value should be formatted as an advanced segment."
-
+
def test_v2_dynamic_segment_format(self):
dynamic_segment_id = 'medium==referral'
query = ga.format_query('google_profile_id', ['visits'], '2013-09-01', segment=dynamic_segment_id)
assert query['segment'] == 'dynamic::ga:' + str(dynamic_segment_id), "A string value with more than just letters and numbers should be formatted as a dynamic segment."
-
+
def test_v3_advanced_segment_common_format(self):
advanced_segment_id = 'aZwqR234'
query = ga.format_query('google_profile_id', ['visits'], '2013-09-01', segment=advanced_segment_id)
assert query['segment'] == 'gaid::' + str(advanced_segment_id), "A string value with just letters and numbers should be formatted as an advanced segment."
-
+
def test_v3_advanced_segment_weird_format(self):
advanced_segment_id = 'aZwqR234-s1'
query = ga.format_query('google_profile_id', ['visits'], '2013-09-01', segment=advanced_segment_id)
diff --git a/pandas/io/tests/test_gbq.py b/pandas/io/tests/test_gbq.py
index f56c1aa042421..ec051d008b3f3 100644
--- a/pandas/io/tests/test_gbq.py
+++ b/pandas/io/tests/test_gbq.py
@@ -3,7 +3,6 @@
import os
import shutil
import subprocess
-import unittest
import numpy as np
@@ -41,18 +40,18 @@ def GetTableSchema(self,table_dict):
class FakeApiClient:
def __init__(self):
self._fakejobs = FakeJobs()
-
+
def jobs(self):
return self._fakejobs
class FakeJobs:
- def __init__(self):
+ def __init__(self):
self._fakequeryresults = FakeResults()
def getQueryResults(self, job_id=None, project_id=None,
max_results=None, timeout_ms=None, **kwargs):
- return self._fakequeryresults
+ return self._fakequeryresults
class FakeResults:
def execute(self):
@@ -74,7 +73,7 @@ def execute(self):
####################################################################################
-class test_gbq(unittest.TestCase):
+class TestGbq(tm.TestCase):
def setUp(self):
with open(self.fake_job_path, 'r') as fin:
self.fake_job = ast.literal_eval(fin.read())
@@ -102,7 +101,7 @@ def setUp(self):
('othello', 1603, 'brawl', 2),
('othello', 1603, "'", 17),
('othello', 1603, 'troubled', 1)
- ],
+ ],
dtype=[('corpus', 'S16'),
('corpus_date', '<i8'),
('word', 'S16'),
@@ -137,29 +136,32 @@ def setUp(self):
'TRUE_BOOLEAN',
'FALSE_BOOLEAN',
'NULL_BOOLEAN']]
-
+
@classmethod
- def setUpClass(self):
+ def setUpClass(cls):
# Integration tests require a valid bigquery token
# be present in the user's home directory. This
# can be generated with 'bq init' in the command line
- self.dirpath = tm.get_data_path()
+ super(TestGbq, cls).setUpClass()
+ cls.dirpath = tm.get_data_path()
home = os.path.expanduser("~")
- self.bq_token = os.path.join(home, '.bigquery.v2.token')
- self.fake_job_path = os.path.join(self.dirpath, 'gbq_fake_job.txt')
-
+ cls.bq_token = os.path.join(home, '.bigquery.v2.token')
+ cls.fake_job_path = os.path.join(cls.dirpath, 'gbq_fake_job.txt')
+
# If we're using a valid token, make a test dataset
# Note, dataset functionality is beyond the scope
# of the module under test, so we rely on the command
# line utility for this.
- if os.path.exists(self.bq_token):
+ if os.path.exists(cls.bq_token):
subprocess.call(['bq','mk', '-d', 'pandas_testing_dataset'])
@classmethod
- def tearDownClass(self):
+ def tearDownClass(cls):
+ super(TestGbq, cls).tearDownClass()
+
# If we're using a valid token, remove the test dataset
# created.
- if os.path.exists(self.bq_token):
+ if os.path.exists(cls.bq_token):
subprocess.call(['bq', 'rm', '-r', '-f', '-d', 'pandas_testing_dataset'])
@with_connectivity_check
@@ -167,7 +169,7 @@ def test_valid_authentication(self):
# If the user has a token file, they should recieve a client from gbq._authenticate
if not os.path.exists(self.bq_token):
raise nose.SkipTest('Skipped because authentication information is not available.')
-
+
self.assertTrue(gbq._authenticate is not None, 'Authentication To GBQ Failed')
@with_connectivity_check
@@ -205,14 +207,14 @@ def test_data_small(self):
'An element in the result DataFrame didn\'t match the sample set')
def test_index_column(self):
- # A user should be able to specify an index column for return
+ # A user should be able to specify an index column for return
result_frame = gbq._parse_data(FakeClient(), self.fake_job, index_col='word')
correct_frame = DataFrame(self.correct_data_small)
correct_frame.set_index('word', inplace=True)
self.assertTrue(result_frame.index.name == correct_frame.index.name)
def test_column_order(self):
- # A User should be able to specify the order in which columns are returned in the dataframe
+ # A User should be able to specify the order in which columns are returned in the dataframe
col_order = ['corpus_date', 'word_count', 'corpus', 'word']
result_frame = gbq._parse_data(FakeClient(), self.fake_job, col_order=col_order)
tm.assert_index_equal(result_frame.columns, DataFrame(self.correct_data_small)[col_order].columns)
@@ -279,8 +281,8 @@ def test_download_all_data_types(self):
@with_connectivity_check
def test_table_exists(self):
# Given a table name in the format {dataset}.{tablename}, if a table exists,
- # the GetTableReference should accurately indicate this.
- # This could possibly change in future implementations of bq,
+ # the GetTableReference should accurately indicate this.
+ # This could possibly change in future implementations of bq,
# but it is the simplest way to provide users with appropriate
# error messages regarding schemas.
if not os.path.exists(self.bq_token):
@@ -309,7 +311,7 @@ def test_upload_new_table_schema_error(self):
df = DataFrame(self.correct_data_small)
with self.assertRaises(gbq.SchemaMissing):
gbq.to_gbq(df, 'pandas_testing_dataset.test_database', schema=None, col_order=None, if_exists='fail')
-
+
@with_connectivity_check
def test_upload_replace_schema_error(self):
# Attempting to replace an existing table without specifying a schema should fail
@@ -319,7 +321,7 @@ def test_upload_replace_schema_error(self):
df = DataFrame(self.correct_data_small)
with self.assertRaises(gbq.SchemaMissing):
gbq.to_gbq(df, 'pandas_testing_dataset.test_database', schema=None, col_order=None, if_exists='replace')
-
+
@with_connectivity_check
def test_upload_public_data_error(self):
# Attempting to upload to a public, read-only, dataset should fail
@@ -432,7 +434,7 @@ def test_upload_replace(self):
'contributor_ip','contributor_id','contributor_username','timestamp',
'is_minor','is_bot','reversion_id','comment','num_characters'])
gbq.to_gbq(df1, 'pandas_testing_dataset.test_data5', schema=schema, col_order=None, if_exists='fail')
-
+
array2 = [['TESTING_GBQ', 999999999, 'hi', 0, True, 9999999999, '00.000.00.000', 1, 'hola',
99999999, False, False, 1, 'Jedi', 11210]]
@@ -441,7 +443,7 @@ def test_upload_replace(self):
'contributor_ip','contributor_id','contributor_username','timestamp',
'is_minor','is_bot','reversion_id','comment','num_characters'])
gbq.to_gbq(df2, 'pandas_testing_dataset.test_data5', schema=schema, col_order=None, if_exists='replace')
-
+
# Read the table and confirm the new data is all that is there
a = gbq.read_gbq("SELECT * FROM pandas_testing_dataset.test_data5")
self.assertTrue((a == df2).all().all())
diff --git a/pandas/io/tests/test_html.py b/pandas/io/tests/test_html.py
index c26048d4cf20b..893b1768b00c3 100644
--- a/pandas/io/tests/test_html.py
+++ b/pandas/io/tests/test_html.py
@@ -3,7 +3,6 @@
import os
import re
import warnings
-import unittest
try:
from importlib import import_module
@@ -85,9 +84,10 @@ def test_bs4_version_fails():
flavor='bs4')
-class TestReadHtml(unittest.TestCase):
+class TestReadHtml(tm.TestCase):
@classmethod
def setUpClass(cls):
+ super(TestReadHtml, cls).setUpClass()
_skip_if_none_of(('bs4', 'html5lib'))
def read_html(self, *args, **kwargs):
@@ -582,9 +582,10 @@ def test_parse_dates_combine(self):
tm.assert_frame_equal(newdf, res[0])
-class TestReadHtmlLxml(unittest.TestCase):
+class TestReadHtmlLxml(tm.TestCase):
@classmethod
def setUpClass(cls):
+ super(TestReadHtmlLxml, cls).setUpClass()
_skip_if_no('lxml')
def read_html(self, *args, **kwargs):
diff --git a/pandas/io/tests/test_json/test_pandas.py b/pandas/io/tests/test_json/test_pandas.py
index 6d392eb265752..084bc63188e2b 100644
--- a/pandas/io/tests/test_json/test_pandas.py
+++ b/pandas/io/tests/test_json/test_pandas.py
@@ -2,7 +2,6 @@
from pandas.compat import range, lrange, StringIO
from pandas import compat
import os
-import unittest
import numpy as np
@@ -27,7 +26,7 @@
_mixed_frame = _frame.copy()
-class TestPandasContainer(unittest.TestCase):
+class TestPandasContainer(tm.TestCase):
def setUp(self):
self.dirpath = tm.get_data_path()
diff --git a/pandas/io/tests/test_json_norm.py b/pandas/io/tests/test_json_norm.py
index e96a89e71f12d..8084446d2d246 100644
--- a/pandas/io/tests/test_json_norm.py
+++ b/pandas/io/tests/test_json_norm.py
@@ -1,5 +1,4 @@
import nose
-import unittest
from pandas import DataFrame
import numpy as np
@@ -15,7 +14,7 @@ def _assert_equal_data(left, right):
tm.assert_frame_equal(left, right)
-class TestJSONNormalize(unittest.TestCase):
+class TestJSONNormalize(tm.TestCase):
def setUp(self):
self.state_data = [
@@ -165,7 +164,7 @@ def test_record_prefix(self):
tm.assert_frame_equal(result, expected)
-class TestNestedToRecord(unittest.TestCase):
+class TestNestedToRecord(tm.TestCase):
def test_flat_stays_flat(self):
recs = [dict(flat1=1,flat2=2),
diff --git a/pandas/io/tests/test_packers.py b/pandas/io/tests/test_packers.py
index 28c541e3735c9..1563406b1f8af 100644
--- a/pandas/io/tests/test_packers.py
+++ b/pandas/io/tests/test_packers.py
@@ -1,5 +1,4 @@
import nose
-import unittest
import datetime
import numpy as np
@@ -44,7 +43,7 @@ def check_arbitrary(a, b):
assert(a == b)
-class Test(unittest.TestCase):
+class TestPackers(tm.TestCase):
def setUp(self):
self.path = '__%s__.msg' % tm.rands(10)
@@ -57,7 +56,7 @@ def encode_decode(self, x, **kwargs):
to_msgpack(p, x, **kwargs)
return read_msgpack(p, **kwargs)
-class TestAPI(Test):
+class TestAPI(TestPackers):
def test_string_io(self):
@@ -94,7 +93,7 @@ def test_iterator_with_string_io(self):
for i, result in enumerate(read_msgpack(s,iterator=True)):
tm.assert_frame_equal(result,dfs[i])
-class TestNumpy(Test):
+class TestNumpy(TestPackers):
def test_numpy_scalar_float(self):
x = np.float32(np.random.rand())
@@ -187,7 +186,7 @@ def test_list_mixed(self):
x_rec = self.encode_decode(x)
tm.assert_almost_equal(x,x_rec)
-class TestBasic(Test):
+class TestBasic(TestPackers):
def test_timestamp(self):
@@ -219,7 +218,7 @@ def test_timedeltas(self):
self.assert_(i == i_rec)
-class TestIndex(Test):
+class TestIndex(TestPackers):
def setUp(self):
super(TestIndex, self).setUp()
@@ -273,7 +272,7 @@ def test_unicode(self):
#self.assert_(i.equals(i_rec))
-class TestSeries(Test):
+class TestSeries(TestPackers):
def setUp(self):
super(TestSeries, self).setUp()
@@ -312,7 +311,7 @@ def test_basic(self):
assert_series_equal(i, i_rec)
-class TestNDFrame(Test):
+class TestNDFrame(TestPackers):
def setUp(self):
super(TestNDFrame, self).setUp()
@@ -374,7 +373,7 @@ def test_iterator(self):
check_arbitrary(packed, l[i])
-class TestSparse(Test):
+class TestSparse(TestPackers):
def _check_roundtrip(self, obj, comparator, **kwargs):
diff --git a/pandas/io/tests/test_parsers.py b/pandas/io/tests/test_parsers.py
index 84736f16e7cba..563e9c136cad2 100644
--- a/pandas/io/tests/test_parsers.py
+++ b/pandas/io/tests/test_parsers.py
@@ -6,7 +6,6 @@
import os
import sys
import re
-import unittest
import nose
import platform
@@ -2049,7 +2048,7 @@ def test_catch_too_many_names(self):
tm.assertRaises(Exception, read_csv, StringIO(data), header=0, names=['a', 'b', 'c', 'd'])
-class TestPythonParser(ParserTests, unittest.TestCase):
+class TestPythonParser(ParserTests, tm.TestCase):
def test_negative_skipfooter_raises(self):
text = """#foo,a,b,c
#foo,a,b,c
@@ -2364,7 +2363,7 @@ def test_iteration_open_handle(self):
tm.assert_series_equal(result, expected)
-class TestFwfColspaceSniffing(unittest.TestCase):
+class TestFwfColspaceSniffing(tm.TestCase):
def test_full_file(self):
# File with all values
test = '''index A B C
@@ -2464,7 +2463,7 @@ def test_variable_width_unicode(self):
header=None, encoding='utf8'))
-class TestCParserHighMemory(ParserTests, unittest.TestCase):
+class TestCParserHighMemory(ParserTests, tm.TestCase):
def read_csv(self, *args, **kwds):
kwds = kwds.copy()
@@ -2504,7 +2503,7 @@ def test_usecols(self):
raise nose.SkipTest("Usecols is not supported in C High Memory engine.")
-class TestCParserLowMemory(ParserTests, unittest.TestCase):
+class TestCParserLowMemory(ParserTests, tm.TestCase):
def read_csv(self, *args, **kwds):
kwds = kwds.copy()
@@ -2831,7 +2830,7 @@ def test_invalid_c_parser_opts_with_not_c_parser(self):
engine)):
read_csv(StringIO(data), engine=engine, **kwargs)
-class TestParseSQL(unittest.TestCase):
+class TestParseSQL(tm.TestCase):
def test_convert_sql_column_floats(self):
arr = np.array([1.5, None, 3, 4.2], dtype=object)
diff --git a/pandas/io/tests/test_pickle.py b/pandas/io/tests/test_pickle.py
index ea769a0515a78..b70248d1ef3f4 100644
--- a/pandas/io/tests/test_pickle.py
+++ b/pandas/io/tests/test_pickle.py
@@ -5,7 +5,6 @@
from datetime import datetime, timedelta
import operator
import pickle as pkl
-import unittest
import nose
import os
@@ -24,7 +23,7 @@ def _read_pickle(vf, encoding=None, compat=False):
with open(vf,'rb') as fh:
pc.load(fh, encoding=encoding, compat=compat)
-class TestPickle(unittest.TestCase):
+class TestPickle(tm.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
diff --git a/pandas/io/tests/test_pytables.py b/pandas/io/tests/test_pytables.py
index ba69f7a834dad..78d9dcb1fb888 100644
--- a/pandas/io/tests/test_pytables.py
+++ b/pandas/io/tests/test_pytables.py
@@ -1,5 +1,4 @@
import nose
-import unittest
import sys
import os
import warnings
@@ -118,7 +117,7 @@ def compat_assert_produces_warning(w,f):
f()
-class TestHDFStore(unittest.TestCase):
+class TestHDFStore(tm.TestCase):
def setUp(self):
warnings.filterwarnings(action='ignore', category=FutureWarning)
diff --git a/pandas/io/tests/test_sql.py b/pandas/io/tests/test_sql.py
index f135a3619e03c..38770def8eb7c 100644
--- a/pandas/io/tests/test_sql.py
+++ b/pandas/io/tests/test_sql.py
@@ -1,5 +1,4 @@
from __future__ import print_function
-import unittest
import sqlite3
import sys
@@ -52,7 +51,7 @@ def _skip_if_no_MySQLdb():
except ImportError:
raise nose.SkipTest('MySQLdb not installed, skipping')
-class TestSQLite(unittest.TestCase):
+class TestSQLite(tm.TestCase):
def setUp(self):
self.db = sqlite3.connect(':memory:')
@@ -243,7 +242,7 @@ def test_onecolumn_of_integer(self):
tm.assert_frame_equal(result,mono_df)
-class TestMySQL(unittest.TestCase):
+class TestMySQL(tm.TestCase):
def setUp(self):
_skip_if_no_MySQLdb()
@@ -487,8 +486,5 @@ def test_keyword_as_column_names(self):
if __name__ == '__main__':
- # unittest.main()
- # nose.runmodule(argv=[__file__,'-vvs','-x', '--pdb-failure'],
- # exit=False)
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
exit=False)
diff --git a/pandas/io/tests/test_stata.py b/pandas/io/tests/test_stata.py
index 0a87ada7097cb..76dae396c04ed 100644
--- a/pandas/io/tests/test_stata.py
+++ b/pandas/io/tests/test_stata.py
@@ -2,7 +2,6 @@
from datetime import datetime
import os
-import unittest
import warnings
import nose
@@ -15,7 +14,7 @@
from pandas.util.misc import is_little_endian
from pandas import compat
-class StataTests(unittest.TestCase):
+class TestStata(tm.TestCase):
def setUp(self):
# Unit test datasets for dta7 - dta9 (old stata formats 104, 105 and 107) can be downloaded from:
diff --git a/pandas/io/tests/test_wb.py b/pandas/io/tests/test_wb.py
index 60b4d8d462723..9549372823af8 100644
--- a/pandas/io/tests/test_wb.py
+++ b/pandas/io/tests/test_wb.py
@@ -1,42 +1,47 @@
import nose
import pandas
+from pandas.compat import u
from pandas.util.testing import network
from pandas.util.testing import assert_frame_equal
from numpy.testing.decorators import slow
from pandas.io.wb import search, download
+import pandas.util.testing as tm
+class TestWB(tm.TestCase):
-@slow
-@network
-def test_wdi_search():
- raise nose.SkipTest("skipping for now")
- expected = {u('id'): {2634: u('GDPPCKD'),
- 4649: u('NY.GDP.PCAP.KD'),
- 4651: u('NY.GDP.PCAP.KN'),
- 4653: u('NY.GDP.PCAP.PP.KD')},
- u('name'): {2634: u('GDP per Capita, constant US$, '
- 'millions'),
- 4649: u('GDP per capita (constant 2000 US$)'),
- 4651: u('GDP per capita (constant LCU)'),
- 4653: u('GDP per capita, PPP (constant 2005 '
- 'international $)')}}
- result = search('gdp.*capita.*constant').ix[:, :2]
- expected = pandas.DataFrame(expected)
- expected.index = result.index
- assert_frame_equal(result, expected)
-
-
-@slow
-@network
-def test_wdi_download():
- raise nose.SkipTest("skipping for now")
- expected = {'GDPPCKN': {(u('United States'), u('2003')): u('40800.0735367688'), (u('Canada'), u('2004')): u('37857.1261134552'), (u('United States'), u('2005')): u('42714.8594790102'), (u('Canada'), u('2003')): u('37081.4575704003'), (u('United States'), u('2004')): u('41826.1728310667'), (u('Mexico'), u('2003')): u('72720.0691255285'), (u('Mexico'), u('2004')): u('74751.6003347038'), (u('Mexico'), u('2005')): u('76200.2154469437'), (u('Canada'), u('2005')): u('38617.4563629611')}, 'GDPPCKD': {(u('United States'), u('2003')): u('40800.0735367688'), (u('Canada'), u('2004')): u('34397.055116118'), (u('United States'), u('2005')): u('42714.8594790102'), (u('Canada'), u('2003')): u('33692.2812368928'), (u('United States'), u('2004')): u('41826.1728310667'), (u('Mexico'), u('2003')): u('7608.43848670658'), (u('Mexico'), u('2004')): u('7820.99026814334'), (u('Mexico'), u('2005')): u('7972.55364129367'), (u('Canada'), u('2005')): u('35087.8925933298')}}
- expected = pandas.DataFrame(expected)
- result = download(country=['CA', 'MX', 'US', 'junk'], indicator=['GDPPCKD',
- 'GDPPCKN', 'junk'], start=2003, end=2005)
- expected.index = result.index
- assert_frame_equal(result, pandas.DataFrame(expected))
+ @slow
+ @network
+ def test_wdi_search(self):
+ raise nose.SkipTest
+
+ expected = {u('id'): {2634: u('GDPPCKD'),
+ 4649: u('NY.GDP.PCAP.KD'),
+ 4651: u('NY.GDP.PCAP.KN'),
+ 4653: u('NY.GDP.PCAP.PP.KD')},
+ u('name'): {2634: u('GDP per Capita, constant US$, '
+ 'millions'),
+ 4649: u('GDP per capita (constant 2000 US$)'),
+ 4651: u('GDP per capita (constant LCU)'),
+ 4653: u('GDP per capita, PPP (constant 2005 '
+ 'international $)')}}
+ result = search('gdp.*capita.*constant').ix[:, :2]
+ expected = pandas.DataFrame(expected)
+ expected.index = result.index
+ assert_frame_equal(result, expected)
+
+
+ @slow
+ @network
+ def test_wdi_download(self):
+ raise nose.SkipTest
+
+ expected = {'GDPPCKN': {(u('United States'), u('2003')): u('40800.0735367688'), (u('Canada'), u('2004')): u('37857.1261134552'), (u('United States'), u('2005')): u('42714.8594790102'), (u('Canada'), u('2003')): u('37081.4575704003'), (u('United States'), u('2004')): u('41826.1728310667'), (u('Mexico'), u('2003')): u('72720.0691255285'), (u('Mexico'), u('2004')): u('74751.6003347038'), (u('Mexico'), u('2005')): u('76200.2154469437'), (u('Canada'), u('2005')): u('38617.4563629611')}, 'GDPPCKD': {(u('United States'), u('2003')): u('40800.0735367688'), (u('Canada'), u('2004')): u('34397.055116118'), (u('United States'), u('2005')): u('42714.8594790102'), (u('Canada'), u('2003')): u('33692.2812368928'), (u('United States'), u('2004')): u('41826.1728310667'), (u('Mexico'), u('2003')): u('7608.43848670658'), (u('Mexico'), u('2004')): u('7820.99026814334'), (u('Mexico'), u('2005')): u('7972.55364129367'), (u('Canada'), u('2005')): u('35087.8925933298')}}
+ expected = pandas.DataFrame(expected)
+ result = download(country=['CA', 'MX', 'US', 'junk'], indicator=['GDPPCKD',
+ 'GDPPCKN', 'junk'], start=2003, end=2005)
+ expected.index = result.index
+ assert_frame_equal(result, pandas.DataFrame(expected))
if __name__ == '__main__':
diff --git a/pandas/sparse/tests/test_array.py b/pandas/sparse/tests/test_array.py
index 21ab1c4354316..86fc4598fc1c8 100644
--- a/pandas/sparse/tests/test_array.py
+++ b/pandas/sparse/tests/test_array.py
@@ -5,7 +5,6 @@
import operator
import pickle
-import unittest
from pandas.core.series import Series
from pandas.core.common import notnull
@@ -23,7 +22,7 @@ def assert_sp_array_equal(left, right):
assert(left.fill_value == right.fill_value)
-class TestSparseArray(unittest.TestCase):
+class TestSparseArray(tm.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
diff --git a/pandas/sparse/tests/test_libsparse.py b/pandas/sparse/tests/test_libsparse.py
index f820142a6e71d..8cbebad61c068 100644
--- a/pandas/sparse/tests/test_libsparse.py
+++ b/pandas/sparse/tests/test_libsparse.py
@@ -1,5 +1,3 @@
-from unittest import TestCase
-
from pandas import Series
import nose
@@ -235,7 +233,7 @@ def _check_case(xloc, xlen, yloc, ylen, eloc, elen):
check_cases(_check_case)
-class TestBlockIndex(TestCase):
+class TestBlockIndex(tm.TestCase):
def test_equals(self):
index = BlockIndex(10, [0, 4], [2, 5])
@@ -274,7 +272,7 @@ def test_to_block_index(self):
self.assert_(index.to_block_index() is index)
-class TestIntIndex(TestCase):
+class TestIntIndex(tm.TestCase):
def test_equals(self):
index = IntIndex(10, [0, 1, 2, 3, 4])
@@ -299,7 +297,7 @@ def test_to_int_index(self):
self.assert_(index.to_int_index() is index)
-class TestSparseOperators(TestCase):
+class TestSparseOperators(tm.TestCase):
def _nan_op_tests(self, sparse_op, python_op):
def _check_case(xloc, xlen, yloc, ylen, eloc, elen):
diff --git a/pandas/sparse/tests/test_sparse.py b/pandas/sparse/tests/test_sparse.py
index b3f2a8b3b8136..bd05a7093fd7c 100644
--- a/pandas/sparse/tests/test_sparse.py
+++ b/pandas/sparse/tests/test_sparse.py
@@ -1,6 +1,5 @@
# pylint: disable-msg=E1101,W0612
-from unittest import TestCase
import operator
from datetime import datetime
@@ -119,7 +118,7 @@ def assert_sp_panel_equal(left, right, exact_indices=True):
assert(item in left)
-class TestSparseSeries(TestCase,
+class TestSparseSeries(tm.TestCase,
test_series.CheckNameIntegration):
_multiprocess_can_split_ = True
@@ -742,11 +741,11 @@ def test_combine_first(self):
assert_sp_series_equal(result, expected)
-class TestSparseTimeSeries(TestCase):
+class TestSparseTimeSeries(tm.TestCase):
pass
-class TestSparseDataFrame(TestCase, test_frame.SafeForSparse):
+class TestSparseDataFrame(tm.TestCase, test_frame.SafeForSparse):
klass = SparseDataFrame
_multiprocess_can_split_ = True
@@ -1562,7 +1561,7 @@ def panel_data3():
}, index=index)
-class TestSparsePanel(TestCase,
+class TestSparsePanel(tm.TestCase,
test_panel.SafeForLongAndSparse,
test_panel.SafeForSparse):
_multiprocess_can_split_ = True
diff --git a/pandas/stats/tests/common.py b/pandas/stats/tests/common.py
index 2866a36bc435a..717eb51292796 100644
--- a/pandas/stats/tests/common.py
+++ b/pandas/stats/tests/common.py
@@ -2,13 +2,14 @@
from datetime import datetime
import string
-import unittest
import nose
import numpy as np
from pandas import DataFrame, bdate_range
from pandas.util.testing import assert_almost_equal # imported in other tests
+import pandas.util.testing as tm
+
N = 100
K = 4
@@ -52,7 +53,7 @@ def check_for_statsmodels():
raise nose.SkipTest('no statsmodels')
-class BaseTest(unittest.TestCase):
+class BaseTest(tm.TestCase):
def setUp(self):
check_for_scipy()
check_for_statsmodels()
diff --git a/pandas/stats/tests/test_math.py b/pandas/stats/tests/test_math.py
index 008fffdc1db06..32ec2ff2c0853 100644
--- a/pandas/stats/tests/test_math.py
+++ b/pandas/stats/tests/test_math.py
@@ -1,4 +1,3 @@
-import unittest
import nose
from datetime import datetime
@@ -26,7 +25,7 @@
_have_statsmodels = False
-class TestMath(unittest.TestCase):
+class TestMath(tm.TestCase):
_nan_locs = np.arange(20, 40)
_inf_locs = np.array([])
diff --git a/pandas/stats/tests/test_moments.py b/pandas/stats/tests/test_moments.py
index 5c7112a2b0981..7381d4c1ae0b4 100644
--- a/pandas/stats/tests/test_moments.py
+++ b/pandas/stats/tests/test_moments.py
@@ -1,4 +1,3 @@
-import unittest
import nose
import sys
import functools
@@ -24,7 +23,7 @@ def _skip_if_no_scipy():
except ImportError:
raise nose.SkipTest("no scipy.stats")
-class TestMoments(unittest.TestCase):
+class TestMoments(tm.TestCase):
_multiprocess_can_split_ = True
diff --git a/pandas/stats/tests/test_ols.py b/pandas/stats/tests/test_ols.py
index 69a101021f27d..476dec8c19435 100644
--- a/pandas/stats/tests/test_ols.py
+++ b/pandas/stats/tests/test_ols.py
@@ -9,7 +9,6 @@
from datetime import datetime
from pandas import compat
from distutils.version import LooseVersion
-import unittest
import nose
import numpy as np
from numpy.testing.decorators import slow
@@ -70,6 +69,7 @@ class TestOLS(BaseTest):
@classmethod
def setUpClass(cls):
+ super(TestOLS, cls).setUpClass()
try:
import matplotlib as mpl
mpl.use('Agg', warn=False)
@@ -252,7 +252,7 @@ def test_ols_object_dtype(self):
summary = repr(model)
-class TestOLSMisc(unittest.TestCase):
+class TestOLSMisc(tm.TestCase):
_multiprocess_can_split_ = True
@@ -260,7 +260,8 @@ class TestOLSMisc(unittest.TestCase):
For test coverage with faux data
'''
@classmethod
- def setupClass(cls):
+ def setUpClass(cls):
+ super(TestOLSMisc, cls).setUpClass()
if not _have_statsmodels:
raise nose.SkipTest("no statsmodels")
@@ -804,7 +805,7 @@ def _period_slice(panelModel, i):
return slice(L, R)
-class TestOLSFilter(unittest.TestCase):
+class TestOLSFilter(tm.TestCase):
_multiprocess_can_split_ = True
diff --git a/pandas/tests/test_algos.py b/pandas/tests/test_algos.py
index 6458d7c31d689..2cbccbaf5c66b 100644
--- a/pandas/tests/test_algos.py
+++ b/pandas/tests/test_algos.py
@@ -1,5 +1,4 @@
from pandas.compat import range
-import unittest
import numpy as np
@@ -10,7 +9,7 @@
import pandas.util.testing as tm
-class TestMatch(unittest.TestCase):
+class TestMatch(tm.TestCase):
_multiprocess_can_split_ = True
def test_ints(self):
@@ -30,7 +29,7 @@ def test_strings(self):
self.assert_(np.array_equal(result, expected))
-class TestUnique(unittest.TestCase):
+class TestUnique(tm.TestCase):
_multiprocess_can_split_ = True
def test_ints(self):
@@ -63,7 +62,7 @@ def test_on_index_object(self):
tm.assert_almost_equal(result, expected)
-class TestValueCounts(unittest.TestCase):
+class TestValueCounts(tm.TestCase):
_multiprocess_can_split_ = True
def test_value_counts(self):
@@ -86,7 +85,7 @@ def test_value_counts_bins(self):
result = algos.value_counts(s, bins=2, sort=False)
self.assertEqual(result.tolist(), [2, 2])
- self.assertEqual(result.index[0], 0.997)
+ self.assertEqual(result.index[0], 0.997)
self.assertEqual(result.index[1], 2.5)
def test_value_counts_dtypes(self):
diff --git a/pandas/tests/test_base.py b/pandas/tests/test_base.py
index 5d5a269b90428..3cb3528b6fff4 100644
--- a/pandas/tests/test_base.py
+++ b/pandas/tests/test_base.py
@@ -1,11 +1,10 @@
import re
-import unittest
import numpy as np
import pandas.compat as compat
from pandas.compat import u
from pandas.core.base import FrozenList, FrozenNDArray
from pandas.util.testing import assertRaisesRegexp, assert_isinstance
-
+import pandas.util.testing as tm
class CheckStringMixin(object):
def test_string_methods_dont_fail(self):
@@ -63,7 +62,7 @@ def check_result(self, result, expected, klass=None):
self.assertEqual(result, expected)
-class TestFrozenList(CheckImmutable, CheckStringMixin, unittest.TestCase):
+class TestFrozenList(CheckImmutable, CheckStringMixin, tm.TestCase):
mutable_methods = ('extend', 'pop', 'remove', 'insert')
unicode_container = FrozenList([u("\u05d0"), u("\u05d1"), "c"])
@@ -89,7 +88,7 @@ def test_inplace(self):
self.check_result(r, self.lst)
-class TestFrozenNDArray(CheckImmutable, CheckStringMixin, unittest.TestCase):
+class TestFrozenNDArray(CheckImmutable, CheckStringMixin, tm.TestCase):
mutable_methods = ('put', 'itemset', 'fill')
unicode_container = FrozenNDArray([u("\u05d0"), u("\u05d1"), "c"])
diff --git a/pandas/tests/test_categorical.py b/pandas/tests/test_categorical.py
index f41f6a9858b47..7f7af41b635b6 100644
--- a/pandas/tests/test_categorical.py
+++ b/pandas/tests/test_categorical.py
@@ -2,7 +2,6 @@
from datetime import datetime
from pandas.compat import range, lrange, u
-import unittest
import nose
import re
@@ -17,7 +16,7 @@
import pandas.util.testing as tm
-class TestCategorical(unittest.TestCase):
+class TestCategorical(tm.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
diff --git a/pandas/tests/test_common.py b/pandas/tests/test_common.py
index 7b4ea855f2f9d..2dd82870e697c 100644
--- a/pandas/tests/test_common.py
+++ b/pandas/tests/test_common.py
@@ -1,6 +1,5 @@
from datetime import datetime
import re
-import unittest
import nose
from nose.tools import assert_equal
@@ -350,7 +349,7 @@ def test_ensure_int32():
assert(result.dtype == np.int32)
-class TestEnsureNumeric(unittest.TestCase):
+class TestEnsureNumeric(tm.TestCase):
def test_numeric_values(self):
# Test integer
self.assertEqual(nanops._ensure_numeric(1), 1, 'Failed for int')
@@ -457,7 +456,7 @@ def test_is_recompilable():
assert not com.is_re_compilable(f)
-class TestTake(unittest.TestCase):
+class TestTake(tm.TestCase):
# standard incompatible fill error
fill_error = re.compile("Incompatible type for fill_value")
diff --git a/pandas/tests/test_expressions.py b/pandas/tests/test_expressions.py
index 6284e4551e167..7d392586c159b 100644
--- a/pandas/tests/test_expressions.py
+++ b/pandas/tests/test_expressions.py
@@ -1,7 +1,6 @@
from __future__ import print_function
# pylint: disable-msg=W0612,E1101
-import unittest
import nose
from numpy.random import randn
@@ -48,7 +47,7 @@
_mixed2_panel = Panel(dict(ItemA=_mixed2, ItemB=(_mixed2 + 3)))
-class TestExpressions(unittest.TestCase):
+class TestExpressions(tm.TestCase):
_multiprocess_can_split_ = False
@@ -341,7 +340,6 @@ def testit():
testit()
if __name__ == '__main__':
- # unittest.main()
import nose
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
exit=False)
diff --git a/pandas/tests/test_format.py b/pandas/tests/test_format.py
index 8e23176e9d005..7abe9b8be552e 100644
--- a/pandas/tests/test_format.py
+++ b/pandas/tests/test_format.py
@@ -6,7 +6,6 @@
import itertools
import os
import sys
-import unittest
from textwrap import dedent
import warnings
@@ -57,7 +56,7 @@ def has_expanded_repr(df):
return False
-class TestDataFrameFormatting(unittest.TestCase):
+class TestDataFrameFormatting(tm.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
@@ -1622,7 +1621,7 @@ def test_to_latex(self):
"""
self.assertEqual(withoutindex_result, withoutindex_expected)
-class TestSeriesFormatting(unittest.TestCase):
+class TestSeriesFormatting(tm.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
@@ -1809,7 +1808,7 @@ def test_mixed_datetime64(self):
self.assertTrue('2012-01-01' in result)
-class TestEngFormatter(unittest.TestCase):
+class TestEngFormatter(tm.TestCase):
_multiprocess_can_split_ = True
def test_eng_float_formatter(self):
@@ -2014,7 +2013,7 @@ def _three_digit_exp():
return '%.4g' % 1.7e8 == '1.7e+008'
-class TestFloatArrayFormatter(unittest.TestCase):
+class TestFloatArrayFormatter(tm.TestCase):
def test_misc(self):
obj = fmt.FloatArrayFormatter(np.array([], dtype=np.float64))
diff --git a/pandas/tests/test_frame.py b/pandas/tests/test_frame.py
index 280b0476efe98..456c41849d06d 100644
--- a/pandas/tests/test_frame.py
+++ b/pandas/tests/test_frame.py
@@ -7,7 +7,6 @@
import operator
import re
import csv
-import unittest
import nose
import functools
import itertools
@@ -1872,7 +1871,7 @@ def test_add_prefix_suffix(self):
self.assert_(np.array_equal(with_suffix.columns, expected))
-class TestDataFrame(unittest.TestCase, CheckIndexing,
+class TestDataFrame(tm.TestCase, CheckIndexing,
SafeForSparse):
klass = DataFrame
@@ -12026,15 +12025,18 @@ def check_raise_on_panel4d_with_multiindex(self, parser, engine):
pd.eval('p4d + 1', parser=parser, engine=engine)
-class TestDataFrameQueryNumExprPandas(unittest.TestCase):
+class TestDataFrameQueryNumExprPandas(tm.TestCase):
+
@classmethod
def setUpClass(cls):
+ super(TestDataFrameQueryNumExprPandas, cls).setUpClass()
cls.engine = 'numexpr'
cls.parser = 'pandas'
skip_if_no_ne()
@classmethod
def tearDownClass(cls):
+ super(TestDataFrameQueryNumExprPandas, cls).tearDownClass()
del cls.engine, cls.parser
def test_date_query_method(self):
@@ -12253,17 +12255,15 @@ def test_chained_cmp_and_in(self):
class TestDataFrameQueryNumExprPython(TestDataFrameQueryNumExprPandas):
+
@classmethod
def setUpClass(cls):
+ super(TestDataFrameQueryNumExprPython, cls).setUpClass()
cls.engine = 'numexpr'
cls.parser = 'python'
skip_if_no_ne(cls.engine)
cls.frame = _frame.copy()
- @classmethod
- def tearDownClass(cls):
- del cls.frame, cls.engine, cls.parser
-
def test_date_query_method(self):
engine, parser = self.engine, self.parser
df = DataFrame(randn(5, 3))
@@ -12356,28 +12356,22 @@ def test_nested_scope(self):
class TestDataFrameQueryPythonPandas(TestDataFrameQueryNumExprPandas):
+
@classmethod
def setUpClass(cls):
+ super(TestDataFrameQueryPythonPandas, cls).setUpClass()
cls.engine = 'python'
cls.parser = 'pandas'
cls.frame = _frame.copy()
- @classmethod
- def tearDownClass(cls):
- del cls.frame, cls.engine, cls.parser
-
-
class TestDataFrameQueryPythonPython(TestDataFrameQueryNumExprPython):
+
@classmethod
def setUpClass(cls):
+ super(TestDataFrameQueryPythonPython, cls).setUpClass()
cls.engine = cls.parser = 'python'
cls.frame = _frame.copy()
- @classmethod
- def tearDownClass(cls):
- del cls.frame, cls.engine, cls.parser
-
-
PARSERS = 'python', 'pandas'
ENGINES = 'python', 'numexpr'
@@ -12510,17 +12504,15 @@ def test_object_array_eq_ne(self):
yield self.check_object_array_eq_ne, parser, engine
-class TestDataFrameEvalNumExprPandas(unittest.TestCase):
+class TestDataFrameEvalNumExprPandas(tm.TestCase):
+
@classmethod
def setUpClass(cls):
+ super(TestDataFrameEvalNumExprPandas, cls).setUpClass()
cls.engine = 'numexpr'
cls.parser = 'pandas'
skip_if_no_ne()
- @classmethod
- def tearDownClass(cls):
- del cls.engine, cls.parser
-
def setUp(self):
self.frame = DataFrame(randn(10, 3), columns=list('abc'))
@@ -12540,38 +12532,29 @@ def test_bool_arith_expr(self):
class TestDataFrameEvalNumExprPython(TestDataFrameEvalNumExprPandas):
+
@classmethod
def setUpClass(cls):
+ super(TestDataFrameEvalNumExprPython, cls).setUpClass()
cls.engine = 'numexpr'
cls.parser = 'python'
skip_if_no_ne()
- @classmethod
- def tearDownClass(cls):
- del cls.engine, cls.parser
-
-
class TestDataFrameEvalPythonPandas(TestDataFrameEvalNumExprPandas):
+
@classmethod
def setUpClass(cls):
+ super(TestDataFrameEvalPythonPandas, cls).setUpClass()
cls.engine = 'python'
cls.parser = 'pandas'
- @classmethod
- def tearDownClass(cls):
- del cls.engine, cls.parser
-
-
class TestDataFrameEvalPythonPython(TestDataFrameEvalNumExprPython):
+
@classmethod
def setUpClass(cls):
+ super(TestDataFrameEvalPythonPython, cls).tearDownClass()
cls.engine = cls.parser = 'python'
- @classmethod
- def tearDownClass(cls):
- del cls.engine, cls.parser
-
-
if __name__ == '__main__':
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
exit=False)
diff --git a/pandas/tests/test_generic.py b/pandas/tests/test_generic.py
index cf9b2d174faea..97e25f105db70 100644
--- a/pandas/tests/test_generic.py
+++ b/pandas/tests/test_generic.py
@@ -2,7 +2,6 @@
from datetime import datetime, timedelta
import operator
-import unittest
import nose
import numpy as np
@@ -350,7 +349,7 @@ def test_head_tail(self):
self._compare(o.head(-3), o.head(7))
self._compare(o.tail(-3), o.tail(7))
-class TestSeries(unittest.TestCase, Generic):
+class TestSeries(tm.TestCase, Generic):
_typ = Series
_comparator = lambda self, x, y: assert_series_equal(x,y)
@@ -576,7 +575,7 @@ def test_interp_nonmono_raise(self):
with tm.assertRaises(ValueError):
s.interpolate(method='krogh')
-class TestDataFrame(unittest.TestCase, Generic):
+class TestDataFrame(tm.TestCase, Generic):
_typ = DataFrame
_comparator = lambda self, x, y: assert_frame_equal(x,y)
@@ -769,11 +768,41 @@ def test_spline(self):
expected = Series([1, 2, 3, 4, 5, 6, 7])
assert_series_equal(result, expected)
-
-class TestPanel(unittest.TestCase, Generic):
+class TestPanel(tm.TestCase, Generic):
_typ = Panel
_comparator = lambda self, x, y: assert_panel_equal(x, y)
+
+class TestNDFrame(tm.TestCase):
+ # tests that don't fit elsewhere
+
+ def test_squeeze(self):
+ # noop
+ for s in [ tm.makeFloatSeries(), tm.makeStringSeries(), tm.makeObjectSeries() ]:
+ tm.assert_series_equal(s.squeeze(),s)
+ for df in [ tm.makeTimeDataFrame() ]:
+ tm.assert_frame_equal(df.squeeze(),df)
+ for p in [ tm.makePanel() ]:
+ tm.assert_panel_equal(p.squeeze(),p)
+ for p4d in [ tm.makePanel4D() ]:
+ tm.assert_panel4d_equal(p4d.squeeze(),p4d)
+
+ # squeezing
+ df = tm.makeTimeDataFrame().reindex(columns=['A'])
+ tm.assert_series_equal(df.squeeze(),df['A'])
+
+ p = tm.makePanel().reindex(items=['ItemA'])
+ tm.assert_frame_equal(p.squeeze(),p['ItemA'])
+
+ p = tm.makePanel().reindex(items=['ItemA'],minor_axis=['A'])
+ tm.assert_series_equal(p.squeeze(),p.ix['ItemA',:,'A'])
+
+ p4d = tm.makePanel4D().reindex(labels=['label1'])
+ tm.assert_panel_equal(p4d.squeeze(),p4d['label1'])
+
+ p4d = tm.makePanel4D().reindex(labels=['label1'],items=['ItemA'])
+ tm.assert_frame_equal(p4d.squeeze(),p4d.ix['label1','ItemA'])
+
if __name__ == '__main__':
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
exit=False)
diff --git a/pandas/tests/test_graphics.py b/pandas/tests/test_graphics.py
index 8f48c2d5951f2..7c8b17fb14abe 100644
--- a/pandas/tests/test_graphics.py
+++ b/pandas/tests/test_graphics.py
@@ -1,7 +1,6 @@
import nose
import os
import string
-import unittest
from distutils.version import LooseVersion
from datetime import datetime, date, timedelta
@@ -30,7 +29,7 @@ def _skip_if_no_scipy():
@tm.mplskip
-class TestSeriesPlots(unittest.TestCase):
+class TestSeriesPlots(tm.TestCase):
def setUp(self):
import matplotlib as mpl
self.mpl_le_1_2_1 = str(mpl.__version__) <= LooseVersion('1.2.1')
@@ -351,7 +350,7 @@ def test_dup_datetime_index_plot(self):
@tm.mplskip
-class TestDataFramePlots(unittest.TestCase):
+class TestDataFramePlots(tm.TestCase):
def setUp(self):
import matplotlib as mpl
self.mpl_le_1_2_1 = str(mpl.__version__) <= LooseVersion('1.2.1')
@@ -449,7 +448,7 @@ def test_plot_xy(self):
# columns.inferred_type == 'mixed'
# TODO add MultiIndex test
-
+
@slow
def test_xcompat(self):
import pandas as pd
@@ -540,10 +539,10 @@ def test_plot_scatter(self):
df = DataFrame(randn(6, 4),
index=list(string.ascii_letters[:6]),
columns=['x', 'y', 'z', 'four'])
-
+
_check_plot_works(df.plot, x='x', y='y', kind='scatter')
_check_plot_works(df.plot, x=1, y=2, kind='scatter')
-
+
with tm.assertRaises(ValueError):
df.plot(x='x', kind='scatter')
with tm.assertRaises(ValueError):
@@ -946,7 +945,7 @@ def test_invalid_kind(self):
@tm.mplskip
-class TestDataFrameGroupByPlots(unittest.TestCase):
+class TestDataFrameGroupByPlots(tm.TestCase):
def tearDown(self):
tm.close()
diff --git a/pandas/tests/test_groupby.py b/pandas/tests/test_groupby.py
index d9bdc3adcd041..76fee1702d64a 100644
--- a/pandas/tests/test_groupby.py
+++ b/pandas/tests/test_groupby.py
@@ -1,6 +1,5 @@
from __future__ import print_function
import nose
-import unittest
from numpy.testing.decorators import slow
@@ -49,7 +48,7 @@ def commonSetUp(self):
index=self.dateRange)
-class TestGroupBy(unittest.TestCase):
+class TestGroupBy(tm.TestCase):
_multiprocess_can_split_ = True
diff --git a/pandas/tests/test_index.py b/pandas/tests/test_index.py
index 9a18e3c8562f6..d102ac999cab0 100644
--- a/pandas/tests/test_index.py
+++ b/pandas/tests/test_index.py
@@ -5,7 +5,6 @@
import operator
import pickle
import re
-import unittest
import nose
import warnings
import os
@@ -34,7 +33,7 @@
from pandas import _np_version_under1p7
-class TestIndex(unittest.TestCase):
+class TestIndex(tm.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
@@ -691,7 +690,7 @@ def test_join_self(self):
self.assert_(res is joined)
-class TestFloat64Index(unittest.TestCase):
+class TestFloat64Index(tm.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
@@ -784,7 +783,7 @@ def test_astype(self):
self.check_is_index(result)
-class TestInt64Index(unittest.TestCase):
+class TestInt64Index(tm.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
@@ -1203,7 +1202,7 @@ def test_slice_keep_name(self):
self.assertEqual(idx.name, idx[1:].name)
-class TestMultiIndex(unittest.TestCase):
+class TestMultiIndex(tm.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
@@ -1381,8 +1380,10 @@ def test_set_value_keeps_names(self):
columns=['one', 'two', 'three', 'four'],
index=idx)
df = df.sortlevel()
+ self.assert_(df._is_copy is False)
self.assertEqual(df.index.names, ('Name', 'Number'))
df = df.set_value(('grethe', '4'), 'one', 99.34)
+ self.assert_(df._is_copy is False)
self.assertEqual(df.index.names, ('Name', 'Number'))
def test_names(self):
diff --git a/pandas/tests/test_indexing.py b/pandas/tests/test_indexing.py
index 02b5812c3e653..44160609235df 100644
--- a/pandas/tests/test_indexing.py
+++ b/pandas/tests/test_indexing.py
@@ -1,5 +1,4 @@
# pylint: disable-msg=W0612,E1101
-import unittest
import nose
import itertools
import warnings
@@ -84,7 +83,7 @@ def _axify(obj, key, axis):
return k
-class TestIndexing(unittest.TestCase):
+class TestIndexing(tm.TestCase):
_multiprocess_can_split_ = True
@@ -1049,6 +1048,8 @@ def f(name,df2):
return Series(np.arange(df2.shape[0]),name=df2.index.values[0]).reindex(f_index)
new_df = pd.concat([ f(name,df2) for name, df2 in grp ],axis=1).T
+ # we are actually operating on a copy here
+ # but in this case, that's ok
for name, df2 in grp:
new_vals = np.arange(df2.shape[0])
df.ix[name, 'new_col'] = new_vals
@@ -1769,7 +1770,8 @@ def f():
'c' : [42,42,2,3,4,42,6]})
def f():
- df[df.a.str.startswith('o')]['c'] = 42
+ indexer = df.a.str.startswith('o')
+ df[indexer]['c'] = 42
self.assertRaises(com.SettingWithCopyError, f)
df['c'][df.a.str.startswith('o')] = 42
assert_frame_equal(df,expected)
@@ -1785,7 +1787,8 @@ def f():
# warnings
pd.set_option('chained_assignment','warn')
df = DataFrame({'A':['aaa','bbb','ccc'],'B':[1,2,3]})
- df.loc[0]['A'] = 111
+ with tm.assert_produces_warning(expected_warning=com.SettingWithCopyWarning):
+ df.loc[0]['A'] = 111
# make sure that _is_copy is picked up reconstruction
# GH5475
@@ -1797,6 +1800,55 @@ def f():
df2["B"] = df2["A"]
df2["B"] = df2["A"]
+ # a suprious raise as we are setting the entire column here
+ # GH5597
+ pd.set_option('chained_assignment','raise')
+ from string import ascii_letters as letters
+
+ def random_text(nobs=100):
+ df = []
+ for i in range(nobs):
+ idx= np.random.randint(len(letters), size=2)
+ idx.sort()
+ df.append([letters[idx[0]:idx[1]]])
+
+ return DataFrame(df, columns=['letters'])
+
+ df = random_text(100000)
+
+ # always a copy
+ x = df.iloc[[0,1,2]]
+ self.assert_(x._is_copy is True)
+ x = df.iloc[[0,1,2,4]]
+ self.assert_(x._is_copy is True)
+
+ # explicity copy
+ indexer = df.letters.apply(lambda x : len(x) > 10)
+ df = df.ix[indexer].copy()
+ self.assert_(df._is_copy is False)
+ df['letters'] = df['letters'].apply(str.lower)
+
+ # implicity take
+ df = random_text(100000)
+ indexer = df.letters.apply(lambda x : len(x) > 10)
+ df = df.ix[indexer]
+ self.assert_(df._is_copy is True)
+ df.loc[:,'letters'] = df['letters'].apply(str.lower)
+
+ # this will raise
+ #df['letters'] = df['letters'].apply(str.lower)
+
+ df = random_text(100000)
+ indexer = df.letters.apply(lambda x : len(x) > 10)
+ df.ix[indexer,'letters'] = df.ix[indexer,'letters'].apply(str.lower)
+
+ # an identical take, so no copy
+ df = DataFrame({'a' : [1]}).dropna()
+ self.assert_(df._is_copy is False)
+ df['a'] += 1
+
+ pd.set_option('chained_assignment','warn')
+
def test_float64index_slicing_bug(self):
# GH 5557, related to slicing a float index
ser = {256: 2321.0, 1: 78.0, 2: 2716.0, 3: 0.0, 4: 369.0, 5: 0.0, 6: 269.0, 7: 0.0, 8: 0.0, 9: 0.0, 10: 3536.0, 11: 0.0, 12: 24.0, 13: 0.0, 14: 931.0, 15: 0.0, 16: 101.0, 17: 78.0, 18: 9643.0, 19: 0.0, 20: 0.0, 21: 0.0, 22: 63761.0, 23: 0.0, 24: 446.0, 25: 0.0, 26: 34773.0, 27: 0.0, 28: 729.0, 29: 78.0, 30: 0.0, 31: 0.0, 32: 3374.0, 33: 0.0, 34: 1391.0, 35: 0.0, 36: 361.0, 37: 0.0, 38: 61808.0, 39: 0.0, 40: 0.0, 41: 0.0, 42: 6677.0, 43: 0.0, 44: 802.0, 45: 0.0, 46: 2691.0, 47: 0.0, 48: 3582.0, 49: 0.0, 50: 734.0, 51: 0.0, 52: 627.0, 53: 70.0, 54: 2584.0, 55: 0.0, 56: 324.0, 57: 0.0, 58: 605.0, 59: 0.0, 60: 0.0, 61: 0.0, 62: 3989.0, 63: 10.0, 64: 42.0, 65: 0.0, 66: 904.0, 67: 0.0, 68: 88.0, 69: 70.0, 70: 8172.0, 71: 0.0, 72: 0.0, 73: 0.0, 74: 64902.0, 75: 0.0, 76: 347.0, 77: 0.0, 78: 36605.0, 79: 0.0, 80: 379.0, 81: 70.0, 82: 0.0, 83: 0.0, 84: 3001.0, 85: 0.0, 86: 1630.0, 87: 7.0, 88: 364.0, 89: 0.0, 90: 67404.0, 91: 9.0, 92: 0.0, 93: 0.0, 94: 7685.0, 95: 0.0, 96: 1017.0, 97: 0.0, 98: 2831.0, 99: 0.0, 100: 2963.0, 101: 0.0, 102: 854.0, 103: 0.0, 104: 0.0, 105: 0.0, 106: 0.0, 107: 0.0, 108: 0.0, 109: 0.0, 110: 0.0, 111: 0.0, 112: 0.0, 113: 0.0, 114: 0.0, 115: 0.0, 116: 0.0, 117: 0.0, 118: 0.0, 119: 0.0, 120: 0.0, 121: 0.0, 122: 0.0, 123: 0.0, 124: 0.0, 125: 0.0, 126: 67744.0, 127: 22.0, 128: 264.0, 129: 0.0, 260: 197.0, 268: 0.0, 265: 0.0, 269: 0.0, 261: 0.0, 266: 1198.0, 267: 0.0, 262: 2629.0, 258: 775.0, 257: 0.0, 263: 0.0, 259: 0.0, 264: 163.0, 250: 10326.0, 251: 0.0, 252: 1228.0, 253: 0.0, 254: 2769.0, 255: 0.0}
diff --git a/pandas/tests/test_internals.py b/pandas/tests/test_internals.py
index b0a64d282e814..701b240479a62 100644
--- a/pandas/tests/test_internals.py
+++ b/pandas/tests/test_internals.py
@@ -1,6 +1,5 @@
# pylint: disable=W0102
-import unittest
import nose
import numpy as np
@@ -88,7 +87,7 @@ def create_singleblockmanager(blocks):
return SingleBlockManager(blocks, [items])
-class TestBlock(unittest.TestCase):
+class TestBlock(tm.TestCase):
_multiprocess_can_split_ = True
@@ -234,7 +233,7 @@ def test_repr(self):
pass
-class TestBlockManager(unittest.TestCase):
+class TestBlockManager(tm.TestCase):
_multiprocess_can_split_ = True
@@ -586,9 +585,6 @@ def test_missing_unicode_key(self):
pass # this is the expected exception
if __name__ == '__main__':
- # unittest.main()
import nose
- # nose.runmodule(argv=[__file__,'-vvs','-x', '--pdb-failure'],
- # exit=False)
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
exit=False)
diff --git a/pandas/tests/test_multilevel.py b/pandas/tests/test_multilevel.py
index bd431843a6b20..151f222d7357a 100644
--- a/pandas/tests/test_multilevel.py
+++ b/pandas/tests/test_multilevel.py
@@ -1,6 +1,5 @@
# pylint: disable-msg=W0612,E1101,W0141
import nose
-import unittest
from numpy.random import randn
import numpy as np
@@ -21,7 +20,7 @@
import pandas.index as _index
-class TestMultiLevel(unittest.TestCase):
+class TestMultiLevel(tm.TestCase):
_multiprocess_can_split_ = True
@@ -1860,9 +1859,6 @@ def test_multiindex_set_index(self):
if __name__ == '__main__':
- # unittest.main()
import nose
- # nose.runmodule(argv=[__file__,'-vvs','-x', '--pdb-failure'],
- # exit=False)
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
exit=False)
diff --git a/pandas/tests/test_ndframe.py b/pandas/tests/test_ndframe.py
deleted file mode 100644
index edafeb64af98e..0000000000000
--- a/pandas/tests/test_ndframe.py
+++ /dev/null
@@ -1,47 +0,0 @@
-import unittest
-
-import numpy as np
-
-from pandas.core.generic import NDFrame
-import pandas.util.testing as t
-
-
-class TestNDFrame(unittest.TestCase):
-
- _multiprocess_can_split_ = True
-
- def setUp(self):
- tdf = t.makeTimeDataFrame()
- self.ndf = NDFrame(tdf._data)
-
- def test_squeeze(self):
- # noop
- for s in [ t.makeFloatSeries(), t.makeStringSeries(), t.makeObjectSeries() ]:
- t.assert_series_equal(s.squeeze(),s)
- for df in [ t.makeTimeDataFrame() ]:
- t.assert_frame_equal(df.squeeze(),df)
- for p in [ t.makePanel() ]:
- t.assert_panel_equal(p.squeeze(),p)
- for p4d in [ t.makePanel4D() ]:
- t.assert_panel4d_equal(p4d.squeeze(),p4d)
-
- # squeezing
- df = t.makeTimeDataFrame().reindex(columns=['A'])
- t.assert_series_equal(df.squeeze(),df['A'])
-
- p = t.makePanel().reindex(items=['ItemA'])
- t.assert_frame_equal(p.squeeze(),p['ItemA'])
-
- p = t.makePanel().reindex(items=['ItemA'],minor_axis=['A'])
- t.assert_series_equal(p.squeeze(),p.ix['ItemA',:,'A'])
-
- p4d = t.makePanel4D().reindex(labels=['label1'])
- t.assert_panel_equal(p4d.squeeze(),p4d['label1'])
-
- p4d = t.makePanel4D().reindex(labels=['label1'],items=['ItemA'])
- t.assert_frame_equal(p4d.squeeze(),p4d.ix['label1','ItemA'])
-
-if __name__ == '__main__':
- import nose
- nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
- exit=False)
diff --git a/pandas/tests/test_panel.py b/pandas/tests/test_panel.py
index 96f14a09180ed..1122b4c7dcfb4 100644
--- a/pandas/tests/test_panel.py
+++ b/pandas/tests/test_panel.py
@@ -2,7 +2,6 @@
from datetime import datetime
import operator
-import unittest
import nose
import numpy as np
@@ -811,7 +810,7 @@ def test_set_value(self):
tm.add_nans(_panel)
-class TestPanel(unittest.TestCase, PanelTests, CheckIndexing,
+class TestPanel(tm.TestCase, PanelTests, CheckIndexing,
SafeForLongAndSparse,
SafeForSparse):
_multiprocess_can_split_ = True
@@ -1782,7 +1781,7 @@ def test_update_raise(self):
**{'raise_conflict': True})
-class TestLongPanel(unittest.TestCase):
+class TestLongPanel(tm.TestCase):
"""
LongPanel no longer exists, but...
"""
diff --git a/pandas/tests/test_panel4d.py b/pandas/tests/test_panel4d.py
index 4d5d29e08fa9f..ea6602dbb0be6 100644
--- a/pandas/tests/test_panel4d.py
+++ b/pandas/tests/test_panel4d.py
@@ -2,7 +2,6 @@
from pandas.compat import range, lrange
import os
import operator
-import unittest
import nose
import numpy as np
@@ -543,7 +542,7 @@ def test_set_value(self):
self.assert_(com.is_float_dtype(res3['l4'].values))
-class TestPanel4d(unittest.TestCase, CheckIndexing, SafeForSparse,
+class TestPanel4d(tm.TestCase, CheckIndexing, SafeForSparse,
SafeForLongAndSparse):
_multiprocess_can_split_ = True
diff --git a/pandas/tests/test_panelnd.py b/pandas/tests/test_panelnd.py
index 3c86998c5630a..92083afb38f41 100644
--- a/pandas/tests/test_panelnd.py
+++ b/pandas/tests/test_panelnd.py
@@ -1,7 +1,6 @@
from datetime import datetime
import os
import operator
-import unittest
import nose
import numpy as np
@@ -19,7 +18,7 @@
import pandas.util.testing as tm
-class TestPanelnd(unittest.TestCase):
+class TestPanelnd(tm.TestCase):
def setUp(self):
pass
diff --git a/pandas/tests/test_reshape.py b/pandas/tests/test_reshape.py
index c4e75fcb41d45..c6eb9739cf3d2 100644
--- a/pandas/tests/test_reshape.py
+++ b/pandas/tests/test_reshape.py
@@ -3,7 +3,6 @@
from datetime import datetime, timedelta
import operator
import os
-import unittest
import nose
@@ -23,7 +22,7 @@
_multiprocess_can_split_ = True
-class TestMelt(unittest.TestCase):
+class TestMelt(tm.TestCase):
def setUp(self):
self.df = tm.makeTimeDataFrame()[:10]
@@ -148,7 +147,7 @@ def test_multiindex(self):
self.assertEqual(res.columns.tolist(), ['CAP', 'low', 'value'])
-class TestGetDummies(unittest.TestCase):
+class TestGetDummies(tm.TestCase):
def test_basic(self):
s_list = list('abc')
s_series = Series(s_list)
@@ -199,7 +198,7 @@ def test_include_na(self):
exp_just_na = DataFrame(Series(1.0,index=[0]),columns=[nan])
assert_array_equal(res_just_na.values, exp_just_na.values)
-class TestConvertDummies(unittest.TestCase):
+class TestConvertDummies(tm.TestCase):
def test_convert_dummies(self):
df = DataFrame({'A': ['foo', 'bar', 'foo', 'bar',
'foo', 'bar', 'foo', 'foo'],
@@ -225,7 +224,7 @@ def test_convert_dummies(self):
tm.assert_frame_equal(result2, expected2)
-class TestLreshape(unittest.TestCase):
+class TestLreshape(tm.TestCase):
def test_pairs(self):
data = {'birthdt': ['08jan2009', '20dec2008', '30dec2008',
diff --git a/pandas/tests/test_rplot.py b/pandas/tests/test_rplot.py
index d59b182b77d4c..ddfce477a320d 100644
--- a/pandas/tests/test_rplot.py
+++ b/pandas/tests/test_rplot.py
@@ -1,5 +1,4 @@
from pandas.compat import range
-import unittest
import pandas.tools.rplot as rplot
import pandas.util.testing as tm
from pandas import read_csv
@@ -33,7 +32,7 @@ def between(a, b, x):
@tm.mplskip
-class TestUtilityFunctions(unittest.TestCase):
+class TestUtilityFunctions(tm.TestCase):
"""
Tests for RPlot utility functions.
"""
@@ -102,7 +101,7 @@ def test_sequence_layers(self):
@tm.mplskip
-class TestTrellis(unittest.TestCase):
+class TestTrellis(tm.TestCase):
def setUp(self):
path = os.path.join(curpath(), 'data/tips.csv')
self.data = read_csv(path, sep=',')
@@ -150,7 +149,7 @@ def test_trellis_cols_rows(self):
@tm.mplskip
-class TestScaleGradient(unittest.TestCase):
+class TestScaleGradient(tm.TestCase):
def setUp(self):
path = os.path.join(curpath(), 'data/iris.csv')
self.data = read_csv(path, sep=',')
@@ -170,7 +169,7 @@ def test_gradient(self):
@tm.mplskip
-class TestScaleGradient2(unittest.TestCase):
+class TestScaleGradient2(tm.TestCase):
def setUp(self):
path = os.path.join(curpath(), 'data/iris.csv')
self.data = read_csv(path, sep=',')
@@ -198,7 +197,7 @@ def test_gradient2(self):
@tm.mplskip
-class TestScaleRandomColour(unittest.TestCase):
+class TestScaleRandomColour(tm.TestCase):
def setUp(self):
path = os.path.join(curpath(), 'data/iris.csv')
self.data = read_csv(path, sep=',')
@@ -218,7 +217,7 @@ def test_random_colour(self):
@tm.mplskip
-class TestScaleConstant(unittest.TestCase):
+class TestScaleConstant(tm.TestCase):
def test_scale_constant(self):
scale = rplot.ScaleConstant(1.0)
self.assertEqual(scale(None, None), 1.0)
@@ -226,7 +225,7 @@ def test_scale_constant(self):
self.assertEqual(scale(None, None), "test")
-class TestScaleSize(unittest.TestCase):
+class TestScaleSize(tm.TestCase):
def setUp(self):
path = os.path.join(curpath(), 'data/iris.csv')
self.data = read_csv(path, sep=',')
@@ -247,7 +246,7 @@ def f():
@tm.mplskip
-class TestRPlot(unittest.TestCase):
+class TestRPlot(tm.TestCase):
def test_rplot1(self):
import matplotlib.pyplot as plt
path = os.path.join(curpath(), 'data/tips.csv')
@@ -295,4 +294,5 @@ def test_rplot_iris(self):
if __name__ == '__main__':
+ import unittest
unittest.main()
diff --git a/pandas/tests/test_series.py b/pandas/tests/test_series.py
index 5a6f790d5851e..0f67fce8b3314 100644
--- a/pandas/tests/test_series.py
+++ b/pandas/tests/test_series.py
@@ -2,7 +2,6 @@
from datetime import datetime, timedelta
import operator
-import unittest
import string
from itertools import product, starmap
from distutils.version import LooseVersion
@@ -246,7 +245,7 @@ def test_to_sparse_pass_name(self):
self.assertEquals(result.name, self.ts.name)
-class TestNanops(unittest.TestCase):
+class TestNanops(tm.TestCase):
_multiprocess_can_split_ = True
@@ -298,7 +297,7 @@ class SafeForSparse(object):
_ts = tm.makeTimeSeries()
-class TestSeries(unittest.TestCase, CheckNameIntegration):
+class TestSeries(tm.TestCase, CheckNameIntegration):
_multiprocess_can_split_ = True
@@ -5336,7 +5335,7 @@ def test_numpy_unique(self):
result = np.unique(self.ts)
-class TestSeriesNonUnique(unittest.TestCase):
+class TestSeriesNonUnique(tm.TestCase):
_multiprocess_can_split_ = True
diff --git a/pandas/tests/test_stats.py b/pandas/tests/test_stats.py
index e3533afc71e95..7e2144e801122 100644
--- a/pandas/tests/test_stats.py
+++ b/pandas/tests/test_stats.py
@@ -1,6 +1,5 @@
from pandas import compat
import nose
-import unittest
from numpy import nan
import numpy as np
@@ -11,9 +10,10 @@
from pandas.util.testing import (assert_frame_equal,
assert_series_equal,
assert_almost_equal)
+import pandas.util.testing as tm
-class TestRank(unittest.TestCase):
+class TestRank(tm.TestCase):
_multiprocess_can_split_ = True
s = Series([1, 3, 4, 2, nan, 2, 1, 5, nan, 3])
df = DataFrame({'A': s, 'B': s})
diff --git a/pandas/tests/test_strings.py b/pandas/tests/test_strings.py
index c75fec44c9f24..15193e44bd5cf 100644
--- a/pandas/tests/test_strings.py
+++ b/pandas/tests/test_strings.py
@@ -4,7 +4,6 @@
import os
import operator
import re
-import unittest
import warnings
import nose
@@ -26,7 +25,7 @@
import pandas.core.strings as strings
-class TestStringMethods(unittest.TestCase):
+class TestStringMethods(tm.TestCase):
_multiprocess_can_split_ = True
@@ -480,7 +479,7 @@ def test_extract(self):
tm.assert_frame_equal(result, exp)
# no groups
- s = Series(['A1', 'B2', 'C3'])
+ s = Series(['A1', 'B2', 'C3'])
f = lambda: s.str.extract('[ABC][123]')
self.assertRaises(ValueError, f)
@@ -492,7 +491,7 @@ def test_extract(self):
result = s.str.extract('(_)')
exp = Series([NA, NA, NA])
tm.assert_series_equal(result, exp)
-
+
# two groups, no matches
result = s.str.extract('(_)(_)')
exp = DataFrame([[NA, NA], [NA, NA], [NA, NA]])
diff --git a/pandas/tests/test_tseries.py b/pandas/tests/test_tseries.py
index c1eda35417fd7..7215b9dbf934b 100644
--- a/pandas/tests/test_tseries.py
+++ b/pandas/tests/test_tseries.py
@@ -1,17 +1,15 @@
-import unittest
from numpy import nan
import numpy as np
from pandas import Index, isnull, Timestamp
from pandas.util.testing import assert_almost_equal
-import pandas.util.testing as common
+import pandas.util.testing as tm
from pandas.compat import range, lrange, zip
import pandas.lib as lib
import pandas.algos as algos
from datetime import datetime
-
-class TestTseriesUtil(unittest.TestCase):
+class TestTseriesUtil(tm.TestCase):
_multiprocess_can_split_ = True
def test_combineFunc(self):
@@ -421,7 +419,7 @@ def test_series_bin_grouper():
assert_almost_equal(counts, exp_counts)
-class TestBinGroupers(unittest.TestCase):
+class TestBinGroupers(tm.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
@@ -560,7 +558,7 @@ def test_try_parse_dates():
assert(np.array_equal(result, expected))
-class TestTypeInference(unittest.TestCase):
+class TestTypeInference(tm.TestCase):
_multiprocess_can_split_ = True
def test_length_zero(self):
@@ -653,11 +651,11 @@ def test_to_object_array_tuples(self):
pass
-class TestMoments(unittest.TestCase):
+class TestMoments(tm.TestCase):
pass
-class TestReducer(unittest.TestCase):
+class TestReducer(tm.TestCase):
def test_int_index(self):
from pandas.core.series import Series
@@ -685,7 +683,7 @@ def test_int_index(self):
assert_almost_equal(result, expected)
-class TestTsUtil(unittest.TestCase):
+class TestTsUtil(tm.TestCase):
def test_min_valid(self):
# Ensure that Timestamp.min is a valid Timestamp
Timestamp(Timestamp.min)
@@ -700,7 +698,7 @@ def test_to_datetime_bijective(self):
self.assertEqual(Timestamp(Timestamp.max.to_pydatetime()).value/1000, Timestamp.max.value/1000)
self.assertEqual(Timestamp(Timestamp.min.to_pydatetime()).value/1000, Timestamp.min.value/1000)
-class TestPeriodField(unittest.TestCase):
+class TestPeriodField(tm.TestCase):
def test_get_period_field_raises_on_out_of_range(self):
from pandas import tslib
diff --git a/pandas/tools/tests/test_merge.py b/pandas/tools/tests/test_merge.py
index eec134ebeb990..e3b448b650767 100644
--- a/pandas/tools/tests/test_merge.py
+++ b/pandas/tools/tests/test_merge.py
@@ -1,7 +1,6 @@
# pylint: disable=E1103
import nose
-import unittest
from datetime import datetime
from numpy.random import randn
@@ -39,7 +38,7 @@ def get_test_data(ngroups=NGROUPS, n=N):
return arr
-class TestMerge(unittest.TestCase):
+class TestMerge(tm.TestCase):
_multiprocess_can_split_ = True
@@ -818,7 +817,7 @@ def _check_merge(x, y):
assert_frame_equal(result, expected, check_names=False) # TODO check_names on merge?
-class TestMergeMulti(unittest.TestCase):
+class TestMergeMulti(tm.TestCase):
def setUp(self):
self.index = MultiIndex(levels=[['foo', 'bar', 'baz', 'qux'],
@@ -1082,7 +1081,7 @@ def _join_by_hand(a, b, how='left'):
return a_re.reindex(columns=result_columns)
-class TestConcatenate(unittest.TestCase):
+class TestConcatenate(tm.TestCase):
_multiprocess_can_split_ = True
@@ -1840,7 +1839,7 @@ def test_concat_mixed_types_fails(self):
with tm.assertRaisesRegexp(TypeError, "Cannot concatenate.+"):
concat([df, df[0]], axis=1)
-class TestOrderedMerge(unittest.TestCase):
+class TestOrderedMerge(tm.TestCase):
def setUp(self):
self.left = DataFrame({'key': ['a', 'c', 'e'],
diff --git a/pandas/tools/tests/test_pivot.py b/pandas/tools/tests/test_pivot.py
index 6c18b6582c4cc..0ede6bd2bd46d 100644
--- a/pandas/tools/tests/test_pivot.py
+++ b/pandas/tools/tests/test_pivot.py
@@ -1,5 +1,4 @@
import datetime
-import unittest
import numpy as np
from numpy.testing import assert_equal
@@ -12,7 +11,7 @@
import pandas.util.testing as tm
-class TestPivotTable(unittest.TestCase):
+class TestPivotTable(tm.TestCase):
_multiprocess_can_split_ = True
@@ -320,7 +319,7 @@ def test_margins_no_values_two_row_two_cols(self):
self.assertEqual(result.All.tolist(), [3.0, 1.0, 4.0, 3.0, 11.0])
-class TestCrosstab(unittest.TestCase):
+class TestCrosstab(tm.TestCase):
def setUp(self):
df = DataFrame({'A': ['foo', 'foo', 'foo', 'foo',
diff --git a/pandas/tools/tests/test_tile.py b/pandas/tools/tests/test_tile.py
index 3200f336376af..ba51946173d5f 100644
--- a/pandas/tools/tests/test_tile.py
+++ b/pandas/tools/tests/test_tile.py
@@ -1,6 +1,5 @@
import os
import nose
-import unittest
import numpy as np
from pandas.compat import zip
@@ -17,7 +16,7 @@
from numpy.testing import assert_equal, assert_almost_equal
-class TestCut(unittest.TestCase):
+class TestCut(tm.TestCase):
def test_simple(self):
data = np.ones(5)
@@ -120,9 +119,9 @@ def test_inf_handling(self):
result = cut(data, [-np.inf, 2, 4, np.inf])
result_ser = cut(data_ser, [-np.inf, 2, 4, np.inf])
-
+
ex_levels = ['(-inf, 2]', '(2, 4]', '(4, inf]']
-
+
np.testing.assert_array_equal(result.levels, ex_levels)
np.testing.assert_array_equal(result_ser.levels, ex_levels)
self.assertEquals(result[5], '(4, inf]')
diff --git a/pandas/tools/tests/test_tools.py b/pandas/tools/tests/test_tools.py
index b57ff68c97e3d..2c70427f79559 100644
--- a/pandas/tools/tests/test_tools.py
+++ b/pandas/tools/tests/test_tools.py
@@ -1,22 +1,23 @@
-# import unittest
-
from pandas import DataFrame
from pandas.tools.describe import value_range
import numpy as np
+import pandas.util.testing as tm
+
+class TestTools(tm.TestCase):
-def test_value_range():
- df = DataFrame(np.random.randn(5, 5))
- df.ix[0, 2] = -5
- df.ix[2, 0] = 5
+ def test_value_range(self):
+ df = DataFrame(np.random.randn(5, 5))
+ df.ix[0, 2] = -5
+ df.ix[2, 0] = 5
- res = value_range(df)
+ res = value_range(df)
- assert(res['Minimum'] == -5)
- assert(res['Maximum'] == 5)
+ self.assert_(res['Minimum'] == -5)
+ self.assert_(res['Maximum'] == 5)
- df.ix[0, 1] = np.NaN
+ df.ix[0, 1] = np.NaN
- assert(res['Minimum'] == -5)
- assert(res['Maximum'] == 5)
+ self.assert_(res['Minimum'] == -5)
+ self.assert_(res['Maximum'] == 5)
diff --git a/pandas/tools/tests/test_util.py b/pandas/tools/tests/test_util.py
index 66ae52983b692..36cfb4870a8fe 100644
--- a/pandas/tools/tests/test_util.py
+++ b/pandas/tools/tests/test_util.py
@@ -1,8 +1,6 @@
import os
import locale
import codecs
-import unittest
-
import nose
import numpy as np
@@ -16,7 +14,7 @@
LOCALE_OVERRIDE = os.environ.get('LOCALE_OVERRIDE', None)
-class TestCartesianProduct(unittest.TestCase):
+class TestCartesianProduct(tm.TestCase):
def test_simple(self):
x, y = list('ABC'), [1, 22]
@@ -26,9 +24,11 @@ def test_simple(self):
assert_equal(result, expected)
-class TestLocaleUtils(unittest.TestCase):
+class TestLocaleUtils(tm.TestCase):
+
@classmethod
def setUpClass(cls):
+ super(TestLocaleUtils, cls).setUpClass()
cls.locales = tm.get_locales()
if not cls.locales:
@@ -39,6 +39,7 @@ def setUpClass(cls):
@classmethod
def tearDownClass(cls):
+ super(TestLocaleUtils, cls).tearDownClass()
del cls.locales
def test_get_locales(self):
diff --git a/pandas/tseries/tests/test_converter.py b/pandas/tseries/tests/test_converter.py
index 7cb84b5134a9a..29137f9cb3e50 100644
--- a/pandas/tseries/tests/test_converter.py
+++ b/pandas/tseries/tests/test_converter.py
@@ -1,12 +1,12 @@
from datetime import datetime, time, timedelta, date
import sys
import os
-import unittest
import nose
import numpy as np
from pandas.compat import u
+import pandas.util.testing as tm
try:
import pandas.tseries.converter as converter
@@ -18,7 +18,7 @@ def test_timtetonum_accepts_unicode():
assert(converter.time2num("00:01") == converter.time2num(u("00:01")))
-class TestDateTimeConverter(unittest.TestCase):
+class TestDateTimeConverter(tm.TestCase):
def setUp(self):
self.dtc = converter.DatetimeConverter()
diff --git a/pandas/tseries/tests/test_cursor.py b/pandas/tseries/tests/test_cursor.py
deleted file mode 100644
index fc02a83cbe639..0000000000000
--- a/pandas/tseries/tests/test_cursor.py
+++ /dev/null
@@ -1,196 +0,0 @@
-
-"""
-
-class TestNewOffsets(unittest.TestCase):
-
- def test_yearoffset(self):
- off = lib.YearOffset(dayoffset=0, biz=0, anchor=datetime(2002,1,1))
-
- for i in range(500):
- t = lib.Timestamp(off.ts)
- self.assert_(t.day == 1)
- self.assert_(t.month == 1)
- self.assert_(t.year == 2002 + i)
- next(off)
-
- for i in range(499, -1, -1):
- off.prev()
- t = lib.Timestamp(off.ts)
- self.assert_(t.day == 1)
- self.assert_(t.month == 1)
- self.assert_(t.year == 2002 + i)
-
- off = lib.YearOffset(dayoffset=-1, biz=0, anchor=datetime(2002,1,1))
-
- for i in range(500):
- t = lib.Timestamp(off.ts)
- self.assert_(t.month == 12)
- self.assert_(t.day == 31)
- self.assert_(t.year == 2001 + i)
- next(off)
-
- for i in range(499, -1, -1):
- off.prev()
- t = lib.Timestamp(off.ts)
- self.assert_(t.month == 12)
- self.assert_(t.day == 31)
- self.assert_(t.year == 2001 + i)
-
- off = lib.YearOffset(dayoffset=-1, biz=-1, anchor=datetime(2002,1,1))
-
- stack = []
-
- for i in range(500):
- t = lib.Timestamp(off.ts)
- stack.append(t)
- self.assert_(t.month == 12)
- self.assert_(t.day == 31 or t.day == 30 or t.day == 29)
- self.assert_(t.year == 2001 + i)
- self.assert_(t.weekday() < 5)
- next(off)
-
- for i in range(499, -1, -1):
- off.prev()
- t = lib.Timestamp(off.ts)
- self.assert_(t == stack.pop())
- self.assert_(t.month == 12)
- self.assert_(t.day == 31 or t.day == 30 or t.day == 29)
- self.assert_(t.year == 2001 + i)
- self.assert_(t.weekday() < 5)
-
- def test_monthoffset(self):
- off = lib.MonthOffset(dayoffset=0, biz=0, anchor=datetime(2002,1,1))
-
- for i in range(12):
- t = lib.Timestamp(off.ts)
- self.assert_(t.day == 1)
- self.assert_(t.month == 1 + i)
- self.assert_(t.year == 2002)
- next(off)
-
- for i in range(11, -1, -1):
- off.prev()
- t = lib.Timestamp(off.ts)
- self.assert_(t.day == 1)
- self.assert_(t.month == 1 + i)
- self.assert_(t.year == 2002)
-
- off = lib.MonthOffset(dayoffset=-1, biz=0, anchor=datetime(2002,1,1))
-
- for i in range(12):
- t = lib.Timestamp(off.ts)
- self.assert_(t.day >= 28)
- self.assert_(t.month == (12 if i == 0 else i))
- self.assert_(t.year == 2001 + (i != 0))
- next(off)
-
- for i in range(11, -1, -1):
- off.prev()
- t = lib.Timestamp(off.ts)
- self.assert_(t.day >= 28)
- self.assert_(t.month == (12 if i == 0 else i))
- self.assert_(t.year == 2001 + (i != 0))
-
- off = lib.MonthOffset(dayoffset=-1, biz=-1, anchor=datetime(2002,1,1))
-
- stack = []
-
- for i in range(500):
- t = lib.Timestamp(off.ts)
- stack.append(t)
- if t.month != 2:
- self.assert_(t.day >= 28)
- else:
- self.assert_(t.day >= 26)
- self.assert_(t.weekday() < 5)
- next(off)
-
- for i in range(499, -1, -1):
- off.prev()
- t = lib.Timestamp(off.ts)
- self.assert_(t == stack.pop())
- if t.month != 2:
- self.assert_(t.day >= 28)
- else:
- self.assert_(t.day >= 26)
- self.assert_(t.weekday() < 5)
-
- for i in (-2, -1, 1, 2):
- for j in (-1, 0, 1):
- off1 = lib.MonthOffset(dayoffset=i, biz=j, stride=12,
- anchor=datetime(2002,1,1))
- off2 = lib.YearOffset(dayoffset=i, biz=j,
- anchor=datetime(2002,1,1))
-
- for k in range(500):
- self.assert_(off1.ts == off2.ts)
- next(off1)
- next(off2)
-
- for k in range(500):
- self.assert_(off1.ts == off2.ts)
- off1.prev()
- off2.prev()
-
- def test_dayoffset(self):
- off = lib.DayOffset(biz=0, anchor=datetime(2002,1,1))
-
- us_in_day = 1e6 * 60 * 60 * 24
-
- t0 = lib.Timestamp(off.ts)
- for i in range(500):
- next(off)
- t1 = lib.Timestamp(off.ts)
- self.assert_(t1.value - t0.value == us_in_day)
- t0 = t1
-
- t0 = lib.Timestamp(off.ts)
- for i in range(499, -1, -1):
- off.prev()
- t1 = lib.Timestamp(off.ts)
- self.assert_(t0.value - t1.value == us_in_day)
- t0 = t1
-
- off = lib.DayOffset(biz=1, anchor=datetime(2002,1,1))
-
- t0 = lib.Timestamp(off.ts)
- for i in range(500):
- next(off)
- t1 = lib.Timestamp(off.ts)
- self.assert_(t1.weekday() < 5)
- self.assert_(t1.value - t0.value == us_in_day or
- t1.value - t0.value == 3 * us_in_day)
- t0 = t1
-
- t0 = lib.Timestamp(off.ts)
- for i in range(499, -1, -1):
- off.prev()
- t1 = lib.Timestamp(off.ts)
- self.assert_(t1.weekday() < 5)
- self.assert_(t0.value - t1.value == us_in_day or
- t0.value - t1.value == 3 * us_in_day)
- t0 = t1
-
-
- def test_dayofmonthoffset(self):
- for week in (-1, 0, 1):
- for day in (0, 2, 4):
- off = lib.DayOfMonthOffset(week=-1, day=day,
- anchor=datetime(2002,1,1))
-
- stack = []
-
- for i in range(500):
- t = lib.Timestamp(off.ts)
- stack.append(t)
- self.assert_(t.weekday() == day)
- next(off)
-
- for i in range(499, -1, -1):
- off.prev()
- t = lib.Timestamp(off.ts)
- self.assert_(t == stack.pop())
- self.assert_(t.weekday() == day)
-
-
-"""
diff --git a/pandas/tseries/tests/test_daterange.py b/pandas/tseries/tests/test_daterange.py
index 3b40e75194d11..0af3b6281530b 100644
--- a/pandas/tseries/tests/test_daterange.py
+++ b/pandas/tseries/tests/test_daterange.py
@@ -1,7 +1,6 @@
from datetime import datetime
from pandas.compat import range
import pickle
-import unittest
import nose
import numpy as np
@@ -39,7 +38,7 @@ def eq_gen_range(kwargs, expected):
START, END = datetime(2009, 1, 1), datetime(2010, 1, 1)
-class TestGenRangeGeneration(unittest.TestCase):
+class TestGenRangeGeneration(tm.TestCase):
def test_generate(self):
rng1 = list(generate_range(START, END, offset=datetools.bday))
rng2 = list(generate_range(START, END, time_rule='B'))
@@ -68,7 +67,7 @@ def test_3(self):
[])
-class TestDateRange(unittest.TestCase):
+class TestDateRange(tm.TestCase):
def setUp(self):
self.rng = bdate_range(START, END)
@@ -410,7 +409,7 @@ def test_range_closed(self):
self.assert_(expected_right.equals(right))
-class TestCustomDateRange(unittest.TestCase):
+class TestCustomDateRange(tm.TestCase):
def setUp(self):
_skip_if_no_cday()
diff --git a/pandas/tseries/tests/test_frequencies.py b/pandas/tseries/tests/test_frequencies.py
index f1078f44efd13..ad9c93592a26c 100644
--- a/pandas/tseries/tests/test_frequencies.py
+++ b/pandas/tseries/tests/test_frequencies.py
@@ -2,7 +2,6 @@
from pandas.compat import range
import sys
import os
-import unittest
import nose
@@ -18,7 +17,7 @@
import pandas.lib as lib
from pandas import _np_version_under1p7
-
+import pandas.util.testing as tm
def test_to_offset_multiple():
freqstr = '2h30min'
@@ -87,7 +86,7 @@ def test_anchored_shortcuts():
_dti = DatetimeIndex
-class TestFrequencyInference(unittest.TestCase):
+class TestFrequencyInference(tm.TestCase):
def test_raise_if_too_few(self):
index = _dti(['12/31/1998', '1/3/1999'])
@@ -159,7 +158,7 @@ def test_week_of_month(self):
for day in days:
for i in range(1, 5):
self._check_generated_range('1/1/2000', 'WOM-%d%s' % (i, day))
-
+
def test_week_of_month_fake(self):
#All of these dates are on same day of week and are 4 or 5 weeks apart
index = DatetimeIndex(["2013-08-27","2013-10-01","2013-10-29","2013-11-26"])
diff --git a/pandas/tseries/tests/test_offsets.py b/pandas/tseries/tests/test_offsets.py
index 008bda0a676bf..047bd244fef93 100644
--- a/pandas/tseries/tests/test_offsets.py
+++ b/pandas/tseries/tests/test_offsets.py
@@ -2,7 +2,6 @@
from dateutil.relativedelta import relativedelta
from pandas.compat import range
from pandas import compat
-import unittest
import nose
from nose.tools import assert_raises
@@ -95,7 +94,7 @@ def test_to_m8():
### DateOffset Tests
#####
-class TestBase(unittest.TestCase):
+class TestBase(tm.TestCase):
_offset = None
def test_apply_out_of_range(self):
@@ -1304,25 +1303,25 @@ def test_get_year_end(self):
self.assertEqual(makeFY5253NearestEndMonth(startingMonth=8, weekday=WeekDay.SUN).get_year_end(datetime(2013,1,1)), datetime(2013,9,1))
self.assertEqual(makeFY5253NearestEndMonth(startingMonth=8, weekday=WeekDay.FRI).get_year_end(datetime(2013,1,1)), datetime(2013,8,30))
- offset_n = FY5253(weekday=WeekDay.TUE, startingMonth=12,
+ offset_n = FY5253(weekday=WeekDay.TUE, startingMonth=12,
variation="nearest")
self.assertEqual(offset_n.get_year_end(datetime(2012,1,1)), datetime(2013,1,1))
self.assertEqual(offset_n.get_year_end(datetime(2012,1,10)), datetime(2013,1,1))
-
- self.assertEqual(offset_n.get_year_end(datetime(2013,1,1)), datetime(2013,12,31))
- self.assertEqual(offset_n.get_year_end(datetime(2013,1,2)), datetime(2013,12,31))
- self.assertEqual(offset_n.get_year_end(datetime(2013,1,3)), datetime(2013,12,31))
+
+ self.assertEqual(offset_n.get_year_end(datetime(2013,1,1)), datetime(2013,12,31))
+ self.assertEqual(offset_n.get_year_end(datetime(2013,1,2)), datetime(2013,12,31))
+ self.assertEqual(offset_n.get_year_end(datetime(2013,1,3)), datetime(2013,12,31))
self.assertEqual(offset_n.get_year_end(datetime(2013,1,10)), datetime(2013,12,31))
-
+
JNJ = FY5253(n=1, startingMonth=12, weekday=6, variation="nearest")
self.assertEqual(JNJ.get_year_end(datetime(2006, 1, 1)), datetime(2006, 12, 31))
-
+
def test_onOffset(self):
offset_lom_aug_sat = makeFY5253NearestEndMonth(1, startingMonth=8, weekday=WeekDay.SAT)
offset_lom_aug_thu = makeFY5253NearestEndMonth(1, startingMonth=8, weekday=WeekDay.THU)
- offset_n = FY5253(weekday=WeekDay.TUE, startingMonth=12,
+ offset_n = FY5253(weekday=WeekDay.TUE, startingMonth=12,
variation="nearest")
-
+
tests = [
# From Wikipedia (see: http://en.wikipedia.org/wiki/4%E2%80%934%E2%80%935_calendar#Saturday_nearest_the_end_of_month)
# 2006-09-02 2006 September 2
@@ -1369,7 +1368,7 @@ def test_onOffset(self):
#From Micron, see: http://google.brand.edgar-online.com/?sym=MU&formtypeID=7
(offset_lom_aug_thu, datetime(2012, 8, 30), True),
(offset_lom_aug_thu, datetime(2011, 9, 1), True),
-
+
(offset_n, datetime(2012, 12, 31), False),
(offset_n, datetime(2013, 1, 1), True),
(offset_n, datetime(2013, 1, 2), False),
@@ -1379,16 +1378,16 @@ def test_onOffset(self):
assertOnOffset(offset, date, expected)
def test_apply(self):
- date_seq_nem_8_sat = [datetime(2006, 9, 2), datetime(2007, 9, 1),
- datetime(2008, 8, 30), datetime(2009, 8, 29),
+ date_seq_nem_8_sat = [datetime(2006, 9, 2), datetime(2007, 9, 1),
+ datetime(2008, 8, 30), datetime(2009, 8, 29),
datetime(2010, 8, 28), datetime(2011, 9, 3)]
-
- JNJ = [datetime(2005, 1, 2), datetime(2006, 1, 1),
- datetime(2006, 12, 31), datetime(2007, 12, 30),
- datetime(2008, 12, 28), datetime(2010, 1, 3),
- datetime(2011, 1, 2), datetime(2012, 1, 1),
+
+ JNJ = [datetime(2005, 1, 2), datetime(2006, 1, 1),
+ datetime(2006, 12, 31), datetime(2007, 12, 30),
+ datetime(2008, 12, 28), datetime(2010, 1, 3),
+ datetime(2011, 1, 2), datetime(2012, 1, 1),
datetime(2012, 12, 30)]
-
+
DEC_SAT = FY5253(n=-1, startingMonth=12, weekday=5, variation="nearest")
tests = [
@@ -1547,7 +1546,7 @@ def test_year_has_extra_week(self):
def test_get_weeks(self):
sat_dec_1 = makeFY5253LastOfMonthQuarter(1, startingMonth=12, weekday=WeekDay.SAT, qtr_with_extra_week=1)
sat_dec_4 = makeFY5253LastOfMonthQuarter(1, startingMonth=12, weekday=WeekDay.SAT, qtr_with_extra_week=4)
-
+
self.assertEqual(sat_dec_1.get_weeks(datetime(2011, 4, 2)), [14, 13, 13, 13])
self.assertEqual(sat_dec_4.get_weeks(datetime(2011, 4, 2)), [13, 13, 13, 14])
self.assertEqual(sat_dec_1.get_weeks(datetime(2010, 12, 25)), [13, 13, 13, 13])
@@ -1558,9 +1557,9 @@ def test_onOffset(self):
offset_nem_sat_aug_4 = makeFY5253NearestEndMonthQuarter(1, startingMonth=8, weekday=WeekDay.SAT, qtr_with_extra_week=4)
offset_nem_thu_aug_4 = makeFY5253NearestEndMonthQuarter(1, startingMonth=8, weekday=WeekDay.THU, qtr_with_extra_week=4)
- offset_n = FY5253(weekday=WeekDay.TUE, startingMonth=12,
+ offset_n = FY5253(weekday=WeekDay.TUE, startingMonth=12,
variation="nearest", qtr_with_extra_week=4)
-
+
tests = [
#From Wikipedia
(offset_nem_sat_aug_4, datetime(2006, 9, 2), True),
@@ -1622,12 +1621,12 @@ def test_offset(self):
assertEq(offset, datetime(2012, 5, 31), datetime(2012, 8, 30))
assertEq(offset, datetime(2012, 5, 30), datetime(2012, 5, 31))
-
- offset2 = FY5253Quarter(weekday=5, startingMonth=12,
+
+ offset2 = FY5253Quarter(weekday=5, startingMonth=12,
variation="last", qtr_with_extra_week=4)
-
+
assertEq(offset2, datetime(2013,1,15), datetime(2013, 3, 30))
-
+
class TestQuarterBegin(TestBase):
def test_repr(self):
@@ -2281,7 +2280,7 @@ def test_compare_ticks():
assert(kls(3) != kls(4))
-class TestOffsetNames(unittest.TestCase):
+class TestOffsetNames(tm.TestCase):
def test_get_offset_name(self):
assertRaisesRegexp(ValueError, 'Bad rule.*BusinessDays', get_offset_name, BDay(2))
@@ -2350,7 +2349,7 @@ def test_quarterly_dont_normalize():
assert(result.time() == date.time())
-class TestOffsetAliases(unittest.TestCase):
+class TestOffsetAliases(tm.TestCase):
def setUp(self):
_offset_map.clear()
@@ -2423,7 +2422,7 @@ def get_all_subclasses(cls):
ret | get_all_subclasses(this_subclass)
return ret
-class TestCaching(unittest.TestCase):
+class TestCaching(tm.TestCase):
no_simple_ctr = [WeekOfMonth, FY5253,
FY5253Quarter,
LastWeekOfMonth]
@@ -2474,7 +2473,7 @@ def test_week_of_month_index_creation(self):
self.assertTrue(inst2 in _daterange_cache)
-class TestReprNames(unittest.TestCase):
+class TestReprNames(tm.TestCase):
def test_str_for_named_is_name(self):
# look at all the amazing combinations!
month_prefixes = ['A', 'AS', 'BA', 'BAS', 'Q', 'BQ', 'BQS', 'QS']
diff --git a/pandas/tseries/tests/test_period.py b/pandas/tseries/tests/test_period.py
index de6918eb8a1d1..ca0eba59fe5fe 100644
--- a/pandas/tseries/tests/test_period.py
+++ b/pandas/tseries/tests/test_period.py
@@ -6,9 +6,7 @@
"""
-from unittest import TestCase
from datetime import datetime, date, timedelta
-import unittest
from numpy.ma.testutils import assert_equal
@@ -33,11 +31,9 @@
from numpy.testing import assert_array_equal
-class TestPeriodProperties(TestCase):
+class TestPeriodProperties(tm.TestCase):
"Test properties such as year, month, weekday, etc...."
#
- def __init__(self, *args, **kwds):
- TestCase.__init__(self, *args, **kwds)
def test_quarterly_negative_ordinals(self):
p = Period(ordinal=-1, freq='Q-DEC')
@@ -494,12 +490,9 @@ def noWrap(item):
return item
-class TestFreqConversion(TestCase):
+class TestFreqConversion(tm.TestCase):
"Test frequency conversion of date objects"
- def __init__(self, *args, **kwds):
- TestCase.__init__(self, *args, **kwds)
-
def test_asfreq_corner(self):
val = Period(freq='A', year=2007)
self.assertRaises(ValueError, val.asfreq, '5t')
@@ -1074,7 +1067,8 @@ def test_conv_secondly(self):
assert_equal(ival_S.asfreq('S'), ival_S)
-class TestPeriodIndex(TestCase):
+class TestPeriodIndex(tm.TestCase):
+
def setUp(self):
pass
@@ -2168,12 +2162,9 @@ def _permute(obj):
return obj.take(np.random.permutation(len(obj)))
-class TestMethods(TestCase):
+class TestMethods(tm.TestCase):
"Base test class for MaskedArrays."
- def __init__(self, *args, **kwds):
- TestCase.__init__(self, *args, **kwds)
-
def test_add(self):
dt1 = Period(freq='D', year=2008, month=1, day=1)
dt2 = Period(freq='D', year=2008, month=1, day=2)
@@ -2183,7 +2174,7 @@ def test_add(self):
self.assertRaises(TypeError, dt1.__add__, dt2)
-class TestPeriodRepresentation(unittest.TestCase):
+class TestPeriodRepresentation(tm.TestCase):
"""
Wish to match NumPy units
"""
@@ -2244,7 +2235,7 @@ def test_negone_ordinals(self):
repr(period)
-class TestComparisons(unittest.TestCase):
+class TestComparisons(tm.TestCase):
def setUp(self):
self.january1 = Period('2000-01', 'M')
self.january2 = Period('2000-01', 'M')
diff --git a/pandas/tseries/tests/test_plotting.py b/pandas/tseries/tests/test_plotting.py
index 233c9f249ab38..e55dd96d64ca0 100644
--- a/pandas/tseries/tests/test_plotting.py
+++ b/pandas/tseries/tests/test_plotting.py
@@ -1,6 +1,5 @@
from datetime import datetime, timedelta, date, time
-import unittest
import nose
from pandas.compat import lrange, zip
@@ -27,7 +26,7 @@ def _skip_if_no_scipy():
@tm.mplskip
-class TestTSPlot(unittest.TestCase):
+class TestTSPlot(tm.TestCase):
def setUp(self):
freq = ['S', 'T', 'H', 'D', 'W', 'M', 'Q', 'Y']
idx = [period_range('12/31/1999', freq=x, periods=100) for x in freq]
diff --git a/pandas/tseries/tests/test_resample.py b/pandas/tseries/tests/test_resample.py
index c60d4b3fd48d1..707b052031d60 100644
--- a/pandas/tseries/tests/test_resample.py
+++ b/pandas/tseries/tests/test_resample.py
@@ -16,7 +16,6 @@
import pandas.tseries.offsets as offsets
import pandas as pd
-import unittest
import nose
from pandas.util.testing import (assert_series_equal, assert_almost_equal,
@@ -33,7 +32,7 @@ def _skip_if_no_pytz():
raise nose.SkipTest("pytz not installed")
-class TestResample(unittest.TestCase):
+class TestResample(tm.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
@@ -662,7 +661,7 @@ def _simple_pts(start, end, freq='D'):
return TimeSeries(np.random.randn(len(rng)), index=rng)
-class TestResamplePeriodIndex(unittest.TestCase):
+class TestResamplePeriodIndex(tm.TestCase):
_multiprocess_can_split_ = True
@@ -1055,7 +1054,7 @@ def test_resample_doesnt_truncate(self):
self.assertEquals(result.index[0], dates[0])
-class TestTimeGrouper(unittest.TestCase):
+class TestTimeGrouper(tm.TestCase):
def setUp(self):
self.ts = Series(np.random.randn(1000),
diff --git a/pandas/tseries/tests/test_timedeltas.py b/pandas/tseries/tests/test_timedeltas.py
index df03851ca4ddb..1d34c5b91d5ed 100644
--- a/pandas/tseries/tests/test_timedeltas.py
+++ b/pandas/tseries/tests/test_timedeltas.py
@@ -2,7 +2,6 @@
from datetime import datetime, timedelta
import nose
-import unittest
import numpy as np
import pandas as pd
@@ -24,7 +23,7 @@ def _skip_if_numpy_not_friendly():
if _np_version_under1p7:
raise nose.SkipTest("numpy < 1.7")
-class TestTimedeltas(unittest.TestCase):
+class TestTimedeltas(tm.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
diff --git a/pandas/tseries/tests/test_timeseries.py b/pandas/tseries/tests/test_timeseries.py
index a7bd2250f95e3..f2f137e18a15c 100644
--- a/pandas/tseries/tests/test_timeseries.py
+++ b/pandas/tseries/tests/test_timeseries.py
@@ -2,7 +2,6 @@
from datetime import datetime, time, timedelta, date
import sys
import os
-import unittest
import operator
from distutils.version import LooseVersion
@@ -51,7 +50,7 @@ def _skip_if_no_pytz():
raise nose.SkipTest("pytz not installed")
-class TestTimeSeriesDuplicates(unittest.TestCase):
+class TestTimeSeriesDuplicates(tm.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
@@ -271,7 +270,7 @@ def assert_range_equal(left, right):
assert(left.tz == right.tz)
-class TestTimeSeries(unittest.TestCase):
+class TestTimeSeries(tm.TestCase):
_multiprocess_can_split_ = True
def test_is_(self):
@@ -1420,7 +1419,7 @@ def test_normalize(self):
result = rng.normalize()
expected = date_range('1/1/2000', periods=10, freq='D')
self.assert_(result.equals(expected))
-
+
rng_ns = pd.DatetimeIndex(np.array([1380585623454345752, 1380585612343234312]).astype("datetime64[ns]"))
rng_ns_normalized = rng_ns.normalize()
expected = pd.DatetimeIndex(np.array([1380585600000000000, 1380585600000000000]).astype("datetime64[ns]"))
@@ -1878,7 +1877,7 @@ def _simple_ts(start, end, freq='D'):
return Series(np.random.randn(len(rng)), index=rng)
-class TestDatetimeIndex(unittest.TestCase):
+class TestDatetimeIndex(tm.TestCase):
_multiprocess_can_split_ = True
def test_hash_error(self):
@@ -2217,7 +2216,7 @@ def test_join_with_period_index(self):
df.columns.join(s.index, how=join)
-class TestDatetime64(unittest.TestCase):
+class TestDatetime64(tm.TestCase):
"""
Also test supoprt for datetime64[ns] in Series / DataFrame
"""
@@ -2431,7 +2430,7 @@ def test_slice_locs_indexerror(self):
s.ix[datetime(1900, 1, 1):datetime(2100, 1, 1)]
-class TestSeriesDatetime64(unittest.TestCase):
+class TestSeriesDatetime64(tm.TestCase):
def setUp(self):
self.series = Series(date_range('1/1/2000', periods=10))
@@ -2550,7 +2549,7 @@ def test_string_index_series_name_converted(self):
self.assertEquals(result.name, df.index[2])
-class TestTimestamp(unittest.TestCase):
+class TestTimestamp(tm.TestCase):
def test_class_ops(self):
_skip_if_no_pytz()
@@ -2794,7 +2793,7 @@ def test_timestamp_compare_series(self):
tm.assert_series_equal(result, expected)
-class TestSlicing(unittest.TestCase):
+class TestSlicing(tm.TestCase):
def test_slice_year(self):
dti = DatetimeIndex(freq='B', start=datetime(2005, 1, 1), periods=500)
diff --git a/pandas/tseries/tests/test_timezones.py b/pandas/tseries/tests/test_timezones.py
index 083de95895d18..d82f91767d413 100644
--- a/pandas/tseries/tests/test_timezones.py
+++ b/pandas/tseries/tests/test_timezones.py
@@ -2,7 +2,6 @@
from datetime import datetime, time, timedelta, tzinfo, date
import sys
import os
-import unittest
import nose
import numpy as np
@@ -65,7 +64,7 @@ def dst(self, dt):
fixed_off_no_name = FixedOffset(-330, None)
-class TestTimeZoneSupport(unittest.TestCase):
+class TestTimeZoneSupport(tm.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
@@ -366,18 +365,18 @@ def test_infer_dst(self):
tz = pytz.timezone('US/Eastern')
dr = date_range(datetime(2011, 11, 6, 0), periods=5,
freq=datetools.Hour())
- self.assertRaises(pytz.AmbiguousTimeError, dr.tz_localize,
+ self.assertRaises(pytz.AmbiguousTimeError, dr.tz_localize,
tz, infer_dst=True)
-
+
# With repeated hours, we can infer the transition
- dr = date_range(datetime(2011, 11, 6, 0), periods=5,
+ dr = date_range(datetime(2011, 11, 6, 0), periods=5,
freq=datetools.Hour(), tz=tz)
- di = DatetimeIndex(['11/06/2011 00:00', '11/06/2011 01:00',
- '11/06/2011 01:00', '11/06/2011 02:00',
+ di = DatetimeIndex(['11/06/2011 00:00', '11/06/2011 01:00',
+ '11/06/2011 01:00', '11/06/2011 02:00',
'11/06/2011 03:00'])
localized = di.tz_localize(tz, infer_dst=True)
self.assert_(np.array_equal(dr, localized))
-
+
# When there is no dst transition, nothing special happens
dr = date_range(datetime(2011, 6, 1, 0), periods=10,
freq=datetools.Hour())
@@ -673,7 +672,7 @@ def test_datetimeindex_tz(self):
self.assert_(idx1.equals(other))
-class TestTimeZones(unittest.TestCase):
+class TestTimeZones(tm.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
diff --git a/pandas/tseries/tests/test_tslib.py b/pandas/tseries/tests/test_tslib.py
index 40dbb2d3712af..9a8c19bdc00ab 100644
--- a/pandas/tseries/tests/test_tslib.py
+++ b/pandas/tseries/tests/test_tslib.py
@@ -1,4 +1,3 @@
-import unittest
import nose
import numpy as np
@@ -7,15 +6,12 @@
import datetime
from pandas.core.api import Timestamp
-
from pandas.tslib import period_asfreq, period_ordinal
-
from pandas.tseries.frequencies import get_freq
-
from pandas import _np_version_under1p7
+import pandas.util.testing as tm
-
-class TestTimestamp(unittest.TestCase):
+class TestTimestamp(tm.TestCase):
def test_bounds_with_different_units(self):
out_of_bounds_dates = (
'1677-09-21',
@@ -61,7 +57,7 @@ def test_barely_oob_dts(self):
# One us more than the maximum is an error
self.assertRaises(ValueError, tslib.Timestamp, max_ts_us + one_us)
-class TestDatetimeParsingWrappers(unittest.TestCase):
+class TestDatetimeParsingWrappers(tm.TestCase):
def test_does_not_convert_mixed_integer(self):
bad_date_strings = (
'-50000',
@@ -91,7 +87,7 @@ def test_does_not_convert_mixed_integer(self):
)
-class TestArrayToDatetime(unittest.TestCase):
+class TestArrayToDatetime(tm.TestCase):
def test_parsing_valid_dates(self):
arr = np.array(['01-01-2013', '01-02-2013'], dtype=object)
self.assert_(
@@ -194,7 +190,7 @@ def test_coerce_of_invalid_datetimes(self):
)
-class TestTimestampNsOperations(unittest.TestCase):
+class TestTimestampNsOperations(tm.TestCase):
def setUp(self):
if _np_version_under1p7:
raise nose.SkipTest('numpy >= 1.7 required')
@@ -224,7 +220,7 @@ def test_nanosecond_string_parsing(self):
self.assertEqual(self.timestamp.value, 1367392545123456000)
-class TestTslib(unittest.TestCase):
+class TestTslib(tm.TestCase):
def test_intraday_conversion_factors(self):
self.assertEqual(period_asfreq(1, get_freq('D'), get_freq('H'), False), 24)
@@ -283,7 +279,7 @@ def test_period_ordinal_business_day(self):
# Tuesday
self.assertEqual(11418, period_ordinal(2013, 10, 8, 0, 0, 0, 0, 0, get_freq('B')))
-class TestTomeStampOps(unittest.TestCase):
+class TestTomeStampOps(tm.TestCase):
def test_timestamp_and_datetime(self):
self.assertEqual((Timestamp(datetime.datetime(2013, 10,13)) - datetime.datetime(2013, 10,12)).days, 1)
self.assertEqual((datetime.datetime(2013, 10, 12) - Timestamp(datetime.datetime(2013, 10,13))).days, -1)
diff --git a/pandas/tseries/tests/test_util.py b/pandas/tseries/tests/test_util.py
index 8bf448118561d..b10c4351c8725 100644
--- a/pandas/tseries/tests/test_util.py
+++ b/pandas/tseries/tests/test_util.py
@@ -1,6 +1,5 @@
from pandas.compat import range
import nose
-import unittest
import numpy as np
from numpy.testing.decorators import slow
@@ -14,7 +13,7 @@
from pandas.tseries.util import pivot_annual, isleapyear
-class TestPivotAnnual(unittest.TestCase):
+class TestPivotAnnual(tm.TestCase):
"""
New pandas of scikits.timeseries pivot_annual
"""
diff --git a/pandas/util/testing.py b/pandas/util/testing.py
index 2ea570d6f8e94..0c4e083b54eda 100644
--- a/pandas/util/testing.py
+++ b/pandas/util/testing.py
@@ -11,6 +11,7 @@
import os
import subprocess
import locale
+import unittest
from datetime import datetime
from functools import wraps, partial
@@ -52,6 +53,18 @@
K = 4
_RAISE_NETWORK_ERROR_DEFAULT = False
+class TestCase(unittest.TestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ pd.set_option('chained_assignment','raise')
+ #print("setting up: {0}".format(cls))
+
+ @classmethod
+ def tearDownClass(cls):
+ #print("tearing down up: {0}".format(cls))
+ pass
+
# NOTE: don't pass an NDFrame or index to this function - may not handle it
# well.
assert_almost_equal = _testing.assert_almost_equal
| related #5581
closes #5597
| https://api.github.com/repos/pandas-dev/pandas/pulls/5584 | 2013-11-25T14:12:59Z | 2013-11-29T19:13:20Z | 2013-11-29T19:13:20Z | 2014-06-19T16:10:09Z |
ENH: Excel writer takes locale setting for date and datetime into account | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 2153c50155ad0..37e2f3357acd9 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -53,6 +53,9 @@ pandas 0.13.1
New features
~~~~~~~~~~~~
+ - Added ``date_format`` and ``datetime_format`` attribute to ExcelWriter.
+ (:issue:`4133`)
+
API Changes
~~~~~~~~~~~
diff --git a/pandas/io/excel.py b/pandas/io/excel.py
index ad7c37fba4c2f..29a7031c79ae4 100644
--- a/pandas/io/excel.py
+++ b/pandas/io/excel.py
@@ -355,6 +355,11 @@ class ExcelWriter(object):
Engine to use for writing. If None, defaults to
``io.excel.<extension>.writer``. NOTE: can only be passed as a keyword
argument.
+ date_format : string, default None
+ Format string for dates written into Excel files (e.g. 'YYYY-MM-DD')
+ datetime_format : string, default None
+ Format string for datetime objects written into Excel files
+ (e.g. 'YYYY-MM-DD HH:MM:SS')
"""
# Defining an ExcelWriter implementation (see abstract methods for more...)
@@ -429,8 +434,9 @@ def save(self):
"""
pass
- def __init__(self, path, engine=None, **engine_kwargs):
- # validate that this engine can handle the extnesion
+ def __init__(self, path, engine=None,
+ date_format=None, datetime_format=None, **engine_kwargs):
+ # validate that this engine can handle the extension
ext = os.path.splitext(path)[-1]
self.check_extension(ext)
@@ -438,6 +444,15 @@ def __init__(self, path, engine=None, **engine_kwargs):
self.sheets = {}
self.cur_sheet = None
+ if date_format is None:
+ self.date_format = 'YYYY-MM-DD'
+ else:
+ self.date_format = date_format
+ if datetime_format is None:
+ self.datetime_format = 'YYYY-MM-DD HH:MM:SS'
+ else:
+ self.datetime_format = datetime_format
+
def _get_sheet_name(self, sheet_name):
if sheet_name is None:
sheet_name = self.cur_sheet
@@ -518,9 +533,9 @@ def write_cells(self, cells, sheet_name=None, startrow=0, startcol=0):
style.__getattribute__(field))
if isinstance(cell.val, datetime.datetime):
- xcell.style.number_format.format_code = "YYYY-MM-DD HH:MM:SS"
+ xcell.style.number_format.format_code = self.datetime_format
elif isinstance(cell.val, datetime.date):
- xcell.style.number_format.format_code = "YYYY-MM-DD"
+ xcell.style.number_format.format_code = self.date_format
if cell.mergestart is not None and cell.mergeend is not None:
cletterstart = get_column_letter(startcol + cell.col + 1)
@@ -585,8 +600,8 @@ def __init__(self, path, engine=None, **engine_kwargs):
super(_XlwtWriter, self).__init__(path, **engine_kwargs)
self.book = xlwt.Workbook()
- self.fm_datetime = xlwt.easyxf(num_format_str='YYYY-MM-DD HH:MM:SS')
- self.fm_date = xlwt.easyxf(num_format_str='YYYY-MM-DD')
+ self.fm_datetime = xlwt.easyxf(num_format_str=self.datetime_format)
+ self.fm_date = xlwt.easyxf(num_format_str=self.date_format)
def save(self):
"""
@@ -612,9 +627,9 @@ def write_cells(self, cells, sheet_name=None, startrow=0, startcol=0):
num_format_str = None
if isinstance(cell.val, datetime.datetime):
- num_format_str = "YYYY-MM-DD HH:MM:SS"
+ num_format_str = self.datetime_format
if isinstance(cell.val, datetime.date):
- num_format_str = "YYYY-MM-DD"
+ num_format_str = self.date_format
stylekey = json.dumps(cell.style)
if num_format_str:
@@ -699,11 +714,14 @@ class _XlsxWriter(ExcelWriter):
engine = 'xlsxwriter'
supported_extensions = ('.xlsx',)
- def __init__(self, path, engine=None, **engine_kwargs):
+ def __init__(self, path, engine=None,
+ date_format=None, datetime_format=None, **engine_kwargs):
# Use the xlsxwriter module as the Excel writer.
import xlsxwriter
- super(_XlsxWriter, self).__init__(path, engine=engine, **engine_kwargs)
+ super(_XlsxWriter, self).__init__(path, engine=engine,
+ date_format=date_format, datetime_format=datetime_format,
+ **engine_kwargs)
self.book = xlsxwriter.Workbook(path, **engine_kwargs)
@@ -729,9 +747,9 @@ def write_cells(self, cells, sheet_name=None, startrow=0, startcol=0):
for cell in cells:
num_format_str = None
if isinstance(cell.val, datetime.datetime):
- num_format_str = "YYYY-MM-DD HH:MM:SS"
+ num_format_str = self.datetime_format
if isinstance(cell.val, datetime.date):
- num_format_str = "YYYY-MM-DD"
+ num_format_str = self.date_format
stylekey = json.dumps(cell.style)
if num_format_str:
@@ -762,12 +780,16 @@ def _convert_to_style(self, style_dict, num_format_str=None):
style_dict: style dictionary to convert
num_format_str: optional number format string
"""
- if style_dict is None:
- return None
# Create a XlsxWriter format object.
xl_format = self.book.add_format()
+
+ if num_format_str is not None:
+ xl_format.set_num_format(num_format_str)
+ if style_dict is None:
+ return xl_format
+
# Map the cell font to XlsxWriter font properties.
if style_dict.get('font'):
font = style_dict['font']
@@ -788,9 +810,6 @@ def _convert_to_style(self, style_dict, num_format_str=None):
if style_dict.get('borders'):
xl_format.set_border()
- if num_format_str is not None:
- xl_format.set_num_format(num_format_str)
-
return xl_format
register_writer(_XlsxWriter)
diff --git a/pandas/io/tests/test_excel.py b/pandas/io/tests/test_excel.py
index edcb80ae74f6f..5335c7691195f 100644
--- a/pandas/io/tests/test_excel.py
+++ b/pandas/io/tests/test_excel.py
@@ -1,7 +1,7 @@
# pylint: disable=E1101
from pandas.compat import u, range, map
-from datetime import datetime
+from datetime import datetime, date
import os
import nose
@@ -661,6 +661,44 @@ def test_excel_roundtrip_datetime(self):
recons = reader.parse('test1')
tm.assert_frame_equal(self.tsframe, recons)
+ # GH4133 - excel output format strings
+ def test_excel_date_datetime_format(self):
+ df = DataFrame([[date(2014, 1, 31),
+ date(1999, 9, 24)],
+ [datetime(1998, 5, 26, 23, 33, 4),
+ datetime(2014, 2, 28, 13, 5, 13)]],
+ index=['DATE', 'DATETIME'], columns=['X', 'Y'])
+ df_expected = DataFrame([[datetime(2014, 1, 31),
+ datetime(1999, 9, 24)],
+ [datetime(1998, 5, 26, 23, 33, 4),
+ datetime(2014, 2, 28, 13, 5, 13)]],
+ index=['DATE', 'DATETIME'], columns=['X', 'Y'])
+
+ with ensure_clean(self.ext) as filename1:
+ with ensure_clean(self.ext) as filename2:
+ writer1 = ExcelWriter(filename1)
+ writer2 = ExcelWriter(filename2,
+ date_format='DD.MM.YYYY',
+ datetime_format='DD.MM.YYYY HH-MM-SS')
+
+ df.to_excel(writer1, 'test1')
+ df.to_excel(writer2, 'test1')
+
+ writer1.close()
+ writer2.close()
+
+ reader1 = ExcelFile(filename1)
+ reader2 = ExcelFile(filename2)
+
+ rs1 = reader1.parse('test1', index_col=None)
+ rs2 = reader2.parse('test1', index_col=None)
+
+ tm.assert_frame_equal(rs1, rs2)
+
+ # since the reader returns a datetime object for dates, we need
+ # to use df_expected to check the result
+ tm.assert_frame_equal(rs2, df_expected)
+
def test_to_excel_periodindex(self):
_skip_if_no_xlrd()
| closes #4133
Based on the locale setting the date and datetime values are formatted in
excel exports. Moreover the this behaviour can be overruled by keyword
arguments. Old behavior can be enforced by
ExcelWriter(file, date_format='YYYY-MM-DD', datetime_format='YYYY-MM-DD HH:MM:SS')
| https://api.github.com/repos/pandas-dev/pandas/pulls/5583 | 2013-11-25T12:45:46Z | 2014-01-26T18:58:10Z | null | 2014-06-27T10:05:29Z |
CLN/BUG: Fix stacklevel on setting with copy warning. | diff --git a/pandas/core/generic.py b/pandas/core/generic.py
index b57c353fff566..5be71afc18663 100644
--- a/pandas/core/generic.py
+++ b/pandas/core/generic.py
@@ -1015,8 +1015,11 @@ def _setitem_copy(self, copy):
self._is_copy = copy
return self
- def _check_setitem_copy(self):
- """ validate if we are doing a settitem on a chained copy """
+ def _check_setitem_copy(self, stacklevel=4):
+ """ validate if we are doing a settitem on a chained copy.
+
+ If you call this function, be sure to set the stacklevel such that the
+ user will see the error *at the level of setting*"""
if self._is_copy:
value = config.get_option('mode.chained_assignment')
@@ -1026,7 +1029,7 @@ def _check_setitem_copy(self):
if value == 'raise':
raise SettingWithCopyError(t)
elif value == 'warn':
- warnings.warn(t, SettingWithCopyWarning)
+ warnings.warn(t, SettingWithCopyWarning, stacklevel=stacklevel)
def __delitem__(self, key):
"""
| May not be perfect, but gets us most of the way there. Resolves [@TomAugspurger's comment](https://github.com/pydata/pandas/pull/5390#issuecomment-29166038) on #5390.
Put the following in a file called `test.py`.
``` python
from pandas import DataFrame
def myfunction():
df = DataFrame({"A": [1, 2, 3, 4, 5], "B": [3.125, 4.12, 3.1, 6.2, 7.]})
row = df.loc[0]
row["A"] = 0
def anotherfunction():
myfunction()
def third_function():
anotherfunction()
third_function()
```
Running it will generate this warning:
```
test.py:5: SettingWithCopyWarning: A value is trying to be set on a copy
of a slice from a DataFrame.
Try using .loc[row_index,col_indexer] = value instead
row["A"] = 0
```
I don't think it's worth testing (especially because there's not necessarily a simple way to do it).
| https://api.github.com/repos/pandas-dev/pandas/pulls/5581 | 2013-11-24T21:22:48Z | 2013-11-24T22:43:43Z | 2013-11-24T22:43:42Z | 2014-07-16T08:41:24Z |
BUG: Add separate import for numpy.ma.mrecords (GH5577) | diff --git a/pandas/core/frame.py b/pandas/core/frame.py
index 6a1ecfed15896..d84c0dd9ea5f7 100644
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -200,9 +200,9 @@ def __init__(self, data=None, index=None, columns=None, dtype=None,
elif isinstance(data, dict):
mgr = self._init_dict(data, index, columns, dtype=dtype)
elif isinstance(data, ma.MaskedArray):
-
+ import numpy.ma.mrecords as mrecords
# masked recarray
- if isinstance(data, ma.mrecords.MaskedRecords):
+ if isinstance(data, mrecords.MaskedRecords):
mgr = _masked_rec_array_to_mgr(data, index, columns, dtype,
copy)
| Fixes https://github.com/pydata/pandas/issues/5577
| https://api.github.com/repos/pandas-dev/pandas/pulls/5579 | 2013-11-23T19:06:48Z | 2013-11-24T01:08:16Z | 2013-11-24T01:08:16Z | 2014-06-26T19:33:48Z |
Win32 fix2 | diff --git a/pandas/io/tests/test_excel.py b/pandas/io/tests/test_excel.py
index 465d51cab2599..861f3a785ce22 100644
--- a/pandas/io/tests/test_excel.py
+++ b/pandas/io/tests/test_excel.py
@@ -488,7 +488,7 @@ def test_int_types(self):
frame.to_excel(path, 'test1')
reader = ExcelFile(path)
recons = reader.parse('test1')
- int_frame = frame.astype(int)
+ int_frame = frame.astype(np.int64)
tm.assert_frame_equal(int_frame, recons)
recons2 = read_excel(path, 'test1')
tm.assert_frame_equal(int_frame, recons2)
@@ -616,7 +616,7 @@ def test_roundtrip_indexlabels(self):
has_index_names=self.merge_cells
).astype(np.int64)
frame.index.names = ['test']
- self.assertAlmostEqual(frame.index.names, recons.index.names)
+ tm.assert_frame_equal(frame,recons.astype(bool))
with ensure_clean(self.ext) as path:
diff --git a/pandas/io/tests/test_packers.py b/pandas/io/tests/test_packers.py
index 6b986fa87ccce..28c541e3735c9 100644
--- a/pandas/io/tests/test_packers.py
+++ b/pandas/io/tests/test_packers.py
@@ -3,6 +3,8 @@
import datetime
import numpy as np
+import sys
+from distutils.version import LooseVersion
from pandas import compat
from pandas.compat import u
@@ -197,6 +199,11 @@ def test_timestamp(self):
def test_datetimes(self):
+ # fails under 2.6/win32 (np.datetime64 seems broken)
+
+ if LooseVersion(sys.version) < '2.7':
+ raise nose.SkipTest('2.6 with np.datetime64 is broken')
+
for i in [datetime.datetime(
2013, 1, 1), datetime.datetime(2013, 1, 1, 5, 1),
datetime.date(2013, 1, 1), np.datetime64(datetime.datetime(2013, 1, 5, 2, 15))]:
diff --git a/pandas/sparse/array.py b/pandas/sparse/array.py
index 141aef3051b23..7b23b306d2927 100644
--- a/pandas/sparse/array.py
+++ b/pandas/sparse/array.py
@@ -65,7 +65,7 @@ def _sparse_array_op(left, right, op, name):
try:
fill_value = op(left.fill_value, right.fill_value)
- except ZeroDivisionError:
+ except:
fill_value = nan
return SparseArray(result, sparse_index=result_index,
diff --git a/pandas/sparse/tests/test_array.py b/pandas/sparse/tests/test_array.py
index 3d2b67f33861d..21ab1c4354316 100644
--- a/pandas/sparse/tests/test_array.py
+++ b/pandas/sparse/tests/test_array.py
@@ -144,10 +144,15 @@ def _check_op(op, first, second):
res4 = op(first, 4)
tm.assert_isinstance(res4, SparseArray)
- exp = op(first.values, 4)
- exp_fv = op(first.fill_value, 4)
- assert_almost_equal(res4.fill_value, exp_fv)
- assert_almost_equal(res4.values, exp)
+
+ # ignore this if the actual op raises (e.g. pow)
+ try:
+ exp = op(first.values, 4)
+ exp_fv = op(first.fill_value, 4)
+ assert_almost_equal(res4.fill_value, exp_fv)
+ assert_almost_equal(res4.values, exp)
+ except (ValueError) :
+ pass
def _check_inplace_op(op):
tmp = arr1.copy()
diff --git a/pandas/tools/tests/test_tile.py b/pandas/tools/tests/test_tile.py
index 86a43f648526b..3200f336376af 100644
--- a/pandas/tools/tests/test_tile.py
+++ b/pandas/tools/tests/test_tile.py
@@ -116,7 +116,7 @@ def test_na_handling(self):
def test_inf_handling(self):
data = np.arange(6)
- data_ser = Series(data)
+ data_ser = Series(data,dtype='int64')
result = cut(data, [-np.inf, 2, 4, np.inf])
result_ser = cut(data_ser, [-np.inf, 2, 4, np.inf])
diff --git a/pandas/tools/tile.py b/pandas/tools/tile.py
index 0c1d6d1c1cbab..99fa1eaba79cc 100644
--- a/pandas/tools/tile.py
+++ b/pandas/tools/tile.py
@@ -222,7 +222,9 @@ def _format_levels(bins, prec, right=True,
def _format_label(x, precision=3):
fmt_str = '%%.%dg' % precision
- if com.is_float(x):
+ if np.isinf(x):
+ return str(x)
+ elif com.is_float(x):
frac, whole = np.modf(x)
sgn = '-' if x < 0 else ''
whole = abs(whole)
| https://api.github.com/repos/pandas-dev/pandas/pulls/5574 | 2013-11-22T22:42:13Z | 2013-11-22T23:30:13Z | 2013-11-22T23:30:13Z | 2014-06-19T00:06:19Z | |
DOC/TST: Series.reorder_levels() can take names; added tests | diff --git a/pandas/core/frame.py b/pandas/core/frame.py
index d84c0dd9ea5f7..e1dafc60e64d8 100644
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -2794,9 +2794,9 @@ def reorder_levels(self, order, axis=0):
Parameters
----------
- order : list of int
+ order : list of int or list of str
List representing new level order. Reference level by number
- not by key.
+ (position) or by key (label).
axis : int
Where to reorder levels.
diff --git a/pandas/core/series.py b/pandas/core/series.py
index 9a2eb9da3a6a4..14c932dbe93f2 100644
--- a/pandas/core/series.py
+++ b/pandas/core/series.py
@@ -1869,7 +1869,7 @@ def reorder_levels(self, order):
Parameters
----------
order: list of int representing new level order.
- (reference level by number not by key)
+ (reference level by number or key)
axis: where to reorder levels
Returns
diff --git a/pandas/tests/test_frame.py b/pandas/tests/test_frame.py
index 5762171b38918..280b0476efe98 100644
--- a/pandas/tests/test_frame.py
+++ b/pandas/tests/test_frame.py
@@ -9185,6 +9185,46 @@ def test_select(self):
assert_frame_equal(result, expected, check_names=False) # TODO should reindex check_names?
+ def test_reorder_levels(self):
+ index = MultiIndex(levels=[['bar'], ['one', 'two', 'three'], [0, 1]],
+ labels=[[0, 0, 0, 0, 0, 0],
+ [0, 1, 2, 0, 1, 2],
+ [0, 1, 0, 1, 0, 1]],
+ names=['L0', 'L1', 'L2'])
+ df = DataFrame({'A': np.arange(6), 'B': np.arange(6)}, index=index)
+
+ # no change, position
+ result = df.reorder_levels([0, 1, 2])
+ assert_frame_equal(df, result)
+
+ # no change, labels
+ result = df.reorder_levels(['L0', 'L1', 'L2'])
+ assert_frame_equal(df, result)
+
+ # rotate, position
+ result = df.reorder_levels([1, 2, 0])
+ e_idx = MultiIndex(levels=[['one', 'two', 'three'], [0, 1], ['bar']],
+ labels=[[0, 1, 2, 0, 1, 2],
+ [0, 1, 0, 1, 0, 1],
+ [0, 0, 0, 0, 0, 0]],
+ names=['L1', 'L2', 'L0'])
+ expected = DataFrame({'A': np.arange(6), 'B': np.arange(6)},
+ index=e_idx)
+ assert_frame_equal(result, expected)
+
+ result = df.reorder_levels([0, 0, 0])
+ e_idx = MultiIndex(levels=[['bar'], ['bar'], ['bar']],
+ labels=[[0, 0, 0, 0, 0, 0],
+ [0, 0, 0, 0, 0, 0],
+ [0, 0, 0, 0, 0, 0]],
+ names=['L0', 'L0', 'L0'])
+ expected = DataFrame({'A': np.arange(6), 'B': np.arange(6)},
+ index=e_idx)
+ assert_frame_equal(result, expected)
+
+ result = df.reorder_levels(['L0', 'L0', 'L0'])
+ assert_frame_equal(result, expected)
+
def test_sort_index(self):
frame = DataFrame(np.random.randn(4, 4), index=[1, 2, 3, 4],
columns=['A', 'B', 'C', 'D'])
diff --git a/pandas/tests/test_series.py b/pandas/tests/test_series.py
index c44ede057adb2..5a6f790d5851e 100644
--- a/pandas/tests/test_series.py
+++ b/pandas/tests/test_series.py
@@ -1854,6 +1854,44 @@ def test_argsort_stable(self):
self.assert_(np.array_equal(qindexer, qexpected))
self.assert_(not np.array_equal(qindexer, mindexer))
+ def test_reorder_levels(self):
+ index = MultiIndex(levels=[['bar'], ['one', 'two', 'three'], [0, 1]],
+ labels=[[0, 0, 0, 0, 0, 0],
+ [0, 1, 2, 0, 1, 2],
+ [0, 1, 0, 1, 0, 1]],
+ names=['L0', 'L1', 'L2'])
+ s = Series(np.arange(6), index=index)
+
+ # no change, position
+ result = s.reorder_levels([0, 1, 2])
+ assert_series_equal(s, result)
+
+ # no change, labels
+ result = s.reorder_levels(['L0', 'L1', 'L2'])
+ assert_series_equal(s, result)
+
+ # rotate, position
+ result = s.reorder_levels([1, 2, 0])
+ e_idx = MultiIndex(levels=[['one', 'two', 'three'], [0, 1], ['bar']],
+ labels=[[0, 1, 2, 0, 1, 2],
+ [0, 1, 0, 1, 0, 1],
+ [0, 0, 0, 0, 0, 0]],
+ names=['L1', 'L2', 'L0'])
+ expected = Series(np.arange(6), index=e_idx)
+ assert_series_equal(result, expected)
+
+ result = s.reorder_levels([0, 0, 0])
+ e_idx = MultiIndex(levels=[['bar'], ['bar'], ['bar']],
+ labels=[[0, 0, 0, 0, 0, 0],
+ [0, 0, 0, 0, 0, 0],
+ [0, 0, 0, 0, 0, 0]],
+ names=['L0', 'L0', 'L0'])
+ expected = Series(range(6), index=e_idx)
+ assert_series_equal(result, expected)
+
+ result = s.reorder_levels(['L0', 'L0', 'L0'])
+ assert_series_equal(result, expected)
+
def test_cumsum(self):
self._check_accum_op('cumsum')
| Minor change to the docstring. It said you must refer to the position (not keys). Keys work:
``` python
In [18]: res.head()
Out[18]:
same_employer stamp
-3 1996-02-01 2
-2 1996-01-01 1
1996-02-01 1
1996-03-01 4
1 1996-01-01 13877
dtype: int64
In [19]: res.reorder_levels(['stamp', 'same_employer']).head()
Out[19]:
stamp same_employer
1996-02-01 -3 2
1996-01-01 -2 1
1996-02-01 -2 1
1996-03-01 -2 4
1996-01-01 1 13877
dtype: int64
```
| https://api.github.com/repos/pandas-dev/pandas/pulls/5573 | 2013-11-22T21:54:25Z | 2013-11-24T07:31:28Z | 2013-11-24T07:31:28Z | 2016-11-03T12:37:34Z |
PERF: slow conversion of single series to data frame | diff --git a/pandas/core/frame.py b/pandas/core/frame.py
index 5e617671f5c49..a031b0550c734 100644
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -4575,7 +4575,7 @@ def extract_index(data):
def _prep_ndarray(values, copy=True):
- if not isinstance(values, np.ndarray):
+ if not isinstance(values, (np.ndarray,Series)):
if len(values) == 0:
return np.empty((0, 0), dtype=object)
diff --git a/vb_suite/frame_ctor.py b/vb_suite/frame_ctor.py
index f8d6e5d548ae5..1d8df95de9fe3 100644
--- a/vb_suite/frame_ctor.py
+++ b/vb_suite/frame_ctor.py
@@ -25,19 +25,24 @@
frame_ctor_nested_dict = Benchmark("DataFrame(data)", setup)
# From JSON-like stuff
-
frame_ctor_list_of_dict = Benchmark("DataFrame(dict_list)", setup,
start_date=datetime(2011, 12, 20))
series_ctor_from_dict = Benchmark("Series(some_dict)", setup)
# nested dict, integer indexes, regression described in #621
-
setup = common_setup + """
data = dict((i,dict((j,float(j)) for j in xrange(100))) for i in xrange(2000))
"""
frame_ctor_nested_dict_int64 = Benchmark("DataFrame(data)", setup)
+# from a mi-series
+setup = common_setup + """
+mi = MultiIndex.from_tuples([(x,y) for x in range(100) for y in range(100)])
+s = Series(randn(10000), index=mi)
+"""
+frame_from_series = Benchmark("DataFrame(s)", setup)
+
#----------------------------------------------------------------------
# get_numeric_data
| ```
-------------------------------------------------------------------------------
Test name | head[ms] | base[ms] | ratio |
-------------------------------------------------------------------------------
frame_from_series | 0.1043 | 17.8473 | 0.0058 |
```
an oversight in handling a case like:
`DataFrame(a_series)`
| https://api.github.com/repos/pandas-dev/pandas/pulls/5568 | 2013-11-21T21:42:56Z | 2013-11-21T21:44:06Z | 2013-11-21T21:44:06Z | 2014-06-23T14:23:49Z |
TST/API/BUG: resolve scoping issues in pytables query where rhs is a compound selection or scoped variable | diff --git a/pandas/computation/expr.py b/pandas/computation/expr.py
index 4c6ea3ecdae7d..bcb5570eae1fc 100644
--- a/pandas/computation/expr.py
+++ b/pandas/computation/expr.py
@@ -125,6 +125,10 @@ def __init__(self, gbls=None, lcls=None, level=1, resolvers=None,
self.globals['True'] = True
self.globals['False'] = False
+ # function defs
+ self.globals['list'] = list
+ self.globals['tuple'] = tuple
+
res_keys = (list(o.keys()) for o in self.resolvers)
self.resolver_keys = frozenset(reduce(operator.add, res_keys, []))
self._global_resolvers = self.resolvers + (self.locals, self.globals)
@@ -505,21 +509,21 @@ def _possibly_evaluate_binop(self, op, op_class, lhs, rhs,
maybe_eval_in_python=('==', '!=')):
res = op(lhs, rhs)
- if (res.op in _cmp_ops_syms and lhs.is_datetime or rhs.is_datetime and
- self.engine != 'pytables'):
- # all date ops must be done in python bc numexpr doesn't work well
- # with NaT
- return self._possibly_eval(res, self.binary_ops)
+ if self.engine != 'pytables':
+ if (res.op in _cmp_ops_syms and getattr(lhs,'is_datetime',False) or getattr(rhs,'is_datetime',False)):
+ # all date ops must be done in python bc numexpr doesn't work well
+ # with NaT
+ return self._possibly_eval(res, self.binary_ops)
if res.op in eval_in_python:
# "in"/"not in" ops are always evaluated in python
return self._possibly_eval(res, eval_in_python)
- elif (lhs.return_type == object or rhs.return_type == object and
- self.engine != 'pytables'):
- # evaluate "==" and "!=" in python if either of our operands has an
- # object return type
- return self._possibly_eval(res, eval_in_python +
- maybe_eval_in_python)
+ elif self.engine != 'pytables':
+ if (getattr(lhs,'return_type',None) == object or getattr(rhs,'return_type',None) == object):
+ # evaluate "==" and "!=" in python if either of our operands has an
+ # object return type
+ return self._possibly_eval(res, eval_in_python +
+ maybe_eval_in_python)
return res
def visit_BinOp(self, node, **kwargs):
@@ -635,7 +639,7 @@ def visit_Attribute(self, node, **kwargs):
raise ValueError("Invalid Attribute context {0}".format(ctx.__name__))
- def visit_Call(self, node, **kwargs):
+ def visit_Call(self, node, side=None, **kwargs):
# this can happen with: datetime.datetime
if isinstance(node.func, ast.Attribute):
diff --git a/pandas/computation/pytables.py b/pandas/computation/pytables.py
index a521bfb3cfec9..7716bc0051159 100644
--- a/pandas/computation/pytables.py
+++ b/pandas/computation/pytables.py
@@ -401,8 +401,15 @@ def visit_Assign(self, node, **kwargs):
return self.visit(cmpr)
def visit_Subscript(self, node, **kwargs):
+ # only allow simple suscripts
+
value = self.visit(node.value)
slobj = self.visit(node.slice)
+ try:
+ value = value.value
+ except:
+ pass
+
try:
return self.const_type(value[slobj], self.env)
except TypeError:
@@ -416,9 +423,16 @@ def visit_Attribute(self, node, **kwargs):
ctx = node.ctx.__class__
if ctx == ast.Load:
# resolve the value
- resolved = self.visit(value).value
+ resolved = self.visit(value)
+
+ # try to get the value to see if we are another expression
+ try:
+ resolved = resolved.value
+ except (AttributeError):
+ pass
+
try:
- return getattr(resolved, attr)
+ return self.term_type(getattr(resolved, attr), self.env)
except AttributeError:
# something like datetime.datetime where scope is overriden
diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py
index 49f60a7051ba9..d2fe1e0638192 100644
--- a/pandas/io/pytables.py
+++ b/pandas/io/pytables.py
@@ -294,6 +294,10 @@ def read_hdf(path_or_buf, key, **kwargs):
"""
+ # grab the scope
+ if 'where' in kwargs:
+ kwargs['where'] = _ensure_term(kwargs['where'])
+
f = lambda store, auto_close: store.select(
key, auto_close=auto_close, **kwargs)
diff --git a/pandas/io/tests/test_pytables.py b/pandas/io/tests/test_pytables.py
index 759f63a962e57..ba69f7a834dad 100644
--- a/pandas/io/tests/test_pytables.py
+++ b/pandas/io/tests/test_pytables.py
@@ -81,14 +81,19 @@ def ensure_clean_store(path, mode='a', complevel=None, complib=None,
def ensure_clean_path(path):
"""
return essentially a named temporary file that is not opened
- and deleted on existing
+ and deleted on existing; if path is a list, then create and
+ return list of filenames
"""
-
try:
- filename = create_tempfile(path)
- yield filename
+ if isinstance(path, list):
+ filenames = [ create_tempfile(p) for p in path ]
+ yield filenames
+ else:
+ filenames = [ create_tempfile(path) ]
+ yield filenames[0]
finally:
- safe_remove(filename)
+ for f in filenames:
+ safe_remove(f)
# set these parameters so we don't have file sharing
tables.parameters.MAX_NUMEXPR_THREADS = 1
@@ -3124,6 +3129,70 @@ def test_frame_select_complex(self):
expected = df.loc[df.index>df.index[3]].reindex(columns=['A','B'])
tm.assert_frame_equal(result, expected)
+ def test_frame_select_complex2(self):
+
+ with ensure_clean_path(['parms.hdf','hist.hdf']) as paths:
+
+ pp, hh = paths
+
+ # use non-trivial selection criteria
+ parms = DataFrame({ 'A' : [1,1,2,2,3] })
+ parms.to_hdf(pp,'df',mode='w',format='table',data_columns=['A'])
+
+ selection = read_hdf(pp,'df',where='A=[2,3]')
+ hist = DataFrame(np.random.randn(25,1),columns=['data'],
+ index=MultiIndex.from_tuples([ (i,j) for i in range(5) for j in range(5) ],
+ names=['l1','l2']))
+
+ hist.to_hdf(hh,'df',mode='w',format='table')
+
+ expected = read_hdf(hh,'df',where=Term('l1','=',[2,3,4]))
+
+ # list like
+ result = read_hdf(hh,'df',where=Term('l1','=',selection.index.tolist()))
+ assert_frame_equal(result, expected)
+ l = selection.index.tolist()
+
+ # sccope with list like
+ store = HDFStore(hh)
+ result = store.select('df',where='l1=l')
+ assert_frame_equal(result, expected)
+ store.close()
+
+ result = read_hdf(hh,'df',where='l1=l')
+ assert_frame_equal(result, expected)
+
+ # index
+ index = selection.index
+ result = read_hdf(hh,'df',where='l1=index')
+ assert_frame_equal(result, expected)
+
+ result = read_hdf(hh,'df',where='l1=selection.index')
+ assert_frame_equal(result, expected)
+
+ result = read_hdf(hh,'df',where='l1=selection.index.tolist()')
+ assert_frame_equal(result, expected)
+
+ result = read_hdf(hh,'df',where='l1=list(selection.index)')
+ assert_frame_equal(result, expected)
+
+ # sccope with index
+ store = HDFStore(hh)
+
+ result = store.select('df',where='l1=index')
+ assert_frame_equal(result, expected)
+
+ result = store.select('df',where='l1=selection.index')
+ assert_frame_equal(result, expected)
+
+ result = store.select('df',where='l1=selection.index.tolist()')
+ assert_frame_equal(result, expected)
+
+ result = store.select('df',where='l1=list(selection.index)')
+ assert_frame_equal(result, expected)
+
+ store.close()
+
def test_invalid_filtering(self):
# can't use more than one filter (atm)
| e.g. 'l1=selection.index' and 'l1=l', where l = selection.index were failing
example reproduced here:
http://stackoverflow.com/questions/20111542/selecting-rows-from-an-hdfstore-given-list-of-indexes
```
In [5]: parms = DataFrame({ 'A' : [1,1,2,2,3] })
In [6]: parms
Out[6]:
A
0 1
1 1
2 2
3 2
4 3
In [7]: parms.to_hdf('parms.hdf','df',mode='w',format='table',data_columns=['A'])
In [8]: selection = pd.read_hdf('parms.hdf','df',where='A=[2,3]')
In [9]: selection
Out[9]:
A
2 2
3 2
4 3
In [10]: hist = DataFrame(np.random.randn(25,1),columns=['data'],
....: index=MultiIndex.from_tuples([ (i,j) for i in range(5) for j in range(5) ],
....: names=['l1','l2']))
In [11]: hist
Out[11]:
data
l1 l2
0 0 1.232358
1 -2.677047
2 -0.168854
3 0.538848
4 -0.678224
1 0 0.092575
1 1.297578
2 -1.489906
3 -1.380054
4 0.701762
2 0 1.397368
1 0.198522
2 1.034036
3 0.650406
4 1.823683
3 0 0.045635
1 -0.213975
2 -1.221950
3 -0.145615
4 -1.187883
4 0 -0.782221
1 -0.626280
2 -0.331885
3 -0.975978
4 2.006322
```
this works in 0.12
```
In [15]: pd.read_hdf('hist.hdf','df',where=pd.Term('l1','=',selection.index.tolist()))
Out[15]:
data
l1 l2
2 0 1.397368
1 0.198522
2 1.034036
3 0.650406
4 1.823683
3 0 0.045635
1 -0.213975
2 -1.221950
3 -0.145615
4 -1.187883
4 0 -0.782221
1 -0.626280
2 -0.331885
3 -0.975978
4 2.006322
```
This works in 0.13 as well
```
In [16]: pd.read_hdf('hist.hdf','df',where='l1=selection.index')
Out[16]:
data
l1 l2
2 0 1.397368
1 0.198522
2 1.034036
3 0.650406
4 1.823683
3 0 0.045635
1 -0.213975
2 -1.221950
3 -0.145615
4 -1.187883
4 0 -0.782221
1 -0.626280
2 -0.331885
3 -0.975978
4 2.006322
```
| https://api.github.com/repos/pandas-dev/pandas/pulls/5566 | 2013-11-21T14:24:45Z | 2013-11-21T15:07:41Z | 2013-11-21T15:07:41Z | 2014-07-16T08:41:13Z |
ENH: short-circuit config lookup when exact key given GH5147 | diff --git a/pandas/core/config.py b/pandas/core/config.py
index ac48232ec618f..bb591947d21de 100644
--- a/pandas/core/config.py
+++ b/pandas/core/config.py
@@ -512,6 +512,11 @@ def _select_options(pat):
if pat=="all", returns all registered options
"""
+ # short-circuit for exact key
+ if pat in _registered_options:
+ return [pat]
+
+ # else look through all of them
keys = sorted(_registered_options.keys())
if pat == 'all': # reserved key
return keys
| Related #5147, #5457
before
```
In [4]: %timeit -r 10 pd.get_option("display.max_rows")
10000 loops, best of 10: 53.3 us per loop
```
after
```
In [1]: %timeit -r 10 pd.get_option("display.max_rows")
100000 loops, best of 10: 5.5 us per loop
```
jeff's version with no error checking or rerouting deprecated keys
```
In [1]: %timeit -r 10 pd.core.config._get_option_fast("display.max_rows")
1000000 loops, best of 10: 792 ns per loop
```
Probably makes no practical difference.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5565 | 2013-11-21T13:21:48Z | 2013-11-21T13:22:16Z | 2013-11-21T13:22:16Z | 2014-06-26T05:41:17Z |
ENH: Add wide_to_long convenience function | diff --git a/doc/source/v0.13.0.txt b/doc/source/v0.13.0.txt
index a39e415abe519..ea6e300906da9 100644
--- a/doc/source/v0.13.0.txt
+++ b/doc/source/v0.13.0.txt
@@ -615,6 +615,23 @@ Enhancements
ser = Series([1, 3, np.nan, np.nan, np.nan, 11])
ser.interpolate(limit=2)
+- Added ``wide_to_long`` panel data convenience function.
+
+ .. ipython:: python
+
+ import pandas as pd
+ import numpy as np
+ np.random.seed(123)
+ df = pd.DataFrame({"A1970" : {0 : "a", 1 : "b", 2 : "c"},
+ "A1980" : {0 : "d", 1 : "e", 2 : "f"},
+ "B1970" : {0 : 2.5, 1 : 1.2, 2 : .7},
+ "B1980" : {0 : 3.2, 1 : 1.3, 2 : .1},
+ "X" : dict(zip(range(3), np.random.randn(3)))
+ })
+ df["id"] = df.index
+ df
+ wide_to_long(df, ["A", "B"], i="id", j="year")
+
.. _scipy: http://www.scipy.org
.. _documentation: http://docs.scipy.org/doc/scipy/reference/interpolate.html#univariate-interpolation
.. _guide: http://docs.scipy.org/doc/scipy/reference/tutorial/interpolate.html
diff --git a/pandas/core/api.py b/pandas/core/api.py
index 28118c60776ce..d75c075d22d7c 100644
--- a/pandas/core/api.py
+++ b/pandas/core/api.py
@@ -15,7 +15,7 @@
from pandas.core.panel4d import Panel4D
from pandas.core.groupby import groupby
from pandas.core.reshape import (pivot_simple as pivot, get_dummies,
- lreshape)
+ lreshape, wide_to_long)
WidePanel = Panel
diff --git a/pandas/core/reshape.py b/pandas/core/reshape.py
index 1178a853c6619..d421fa36326aa 100644
--- a/pandas/core/reshape.py
+++ b/pandas/core/reshape.py
@@ -786,6 +786,89 @@ def lreshape(data, groups, dropna=True, label=None):
return DataFrame(mdata, columns=id_cols + pivot_cols)
+def wide_to_long(df, stubnames, i, j):
+ """
+ Wide panel to long format. Less flexible but more user-friendly than melt.
+
+ Parameters
+ ----------
+ df : DataFrame
+ The wide-format DataFrame
+ stubnames : list
+ A list of stub names. The wide format variables are assumed to
+ start with the stub names.
+ i : str
+ The name of the id variable.
+ j : str
+ The name of the subobservation variable.
+ stubend : str
+ Regex to match for the end of the stubs.
+
+ Returns
+ -------
+ DataFrame
+ A DataFrame that contains each stub name as a variable as well as
+ variables for i and j.
+
+ Examples
+ --------
+ >>> import pandas as pd
+ >>> import numpy as np
+ >>> np.random.seed(123)
+ >>> df = pd.DataFrame({"A1970" : {0 : "a", 1 : "b", 2 : "c"},
+ ... "A1980" : {0 : "d", 1 : "e", 2 : "f"},
+ ... "B1970" : {0 : 2.5, 1 : 1.2, 2 : .7},
+ ... "B1980" : {0 : 3.2, 1 : 1.3, 2 : .1},
+ ... "X" : dict(zip(range(3), np.random.randn(3)))
+ ... })
+ >>> df["id"] = df.index
+ >>> df
+ A1970 A1980 B1970 B1980 X id
+ 0 a d 2.5 3.2 -1.085631 0
+ 1 b e 1.2 1.3 0.997345 1
+ 2 c f 0.7 0.1 0.282978 2
+ >>> wide_to_long(df, ["A", "B"], i="id", j="year")
+ X A B
+ id year
+ 0 1970 -1.085631 a 2.5
+ 1 1970 0.997345 b 1.2
+ 2 1970 0.282978 c 0.7
+ 0 1980 -1.085631 d 3.2
+ 1 1980 0.997345 e 1.3
+ 2 1980 0.282978 f 0.1
+
+ Notes
+ -----
+ All extra variables are treated as extra id variables. This simply uses
+ `pandas.melt` under the hood, but is hard-coded to "do the right thing"
+ in a typicaly case.
+ """
+ def get_var_names(df, regex):
+ return df.filter(regex=regex).columns.tolist()
+
+ def melt_stub(df, stub, i, j):
+ varnames = get_var_names(df, "^"+stub)
+ newdf = melt(df, id_vars=i, value_vars=varnames,
+ value_name=stub, var_name=j)
+ newdf_j = newdf[j].str.replace(stub, "")
+ try:
+ newdf_j = newdf_j.astype(int)
+ except ValueError:
+ pass
+ newdf[j] = newdf_j
+ return newdf
+
+ id_vars = get_var_names(df, "^(?!%s)" % "|".join(stubnames))
+ if i not in id_vars:
+ id_vars += [i]
+
+ stub = stubnames.pop(0)
+ newdf = melt_stub(df, stub, id_vars, j)
+
+ for stub in stubnames:
+ new = melt_stub(df, stub, id_vars, j)
+ newdf = newdf.merge(new, how="outer", on=id_vars + [j], copy=False)
+ return newdf.set_index([i, j])
def convert_dummies(data, cat_variables, prefix_sep='_'):
"""
diff --git a/pandas/tests/test_reshape.py b/pandas/tests/test_reshape.py
index c6eb9739cf3d2..b48fb29de0289 100644
--- a/pandas/tests/test_reshape.py
+++ b/pandas/tests/test_reshape.py
@@ -15,7 +15,8 @@
from pandas.util.testing import assert_frame_equal
from numpy.testing import assert_array_equal
-from pandas.core.reshape import melt, convert_dummies, lreshape, get_dummies
+from pandas.core.reshape import (melt, convert_dummies, lreshape, get_dummies,
+ wide_to_long)
import pandas.util.testing as tm
from pandas.compat import StringIO, cPickle, range
@@ -296,6 +297,27 @@ def test_pairs(self):
'wt': ['wt%d' % i for i in range(1, 4)]}
self.assertRaises(ValueError, lreshape, df, spec)
+class TestWideToLong(tm.TestCase):
+ def test_simple(self):
+ np.random.seed(123)
+ x = np.random.randn(3)
+ df = pd.DataFrame({"A1970" : {0 : "a", 1 : "b", 2 : "c"},
+ "A1980" : {0 : "d", 1 : "e", 2 : "f"},
+ "B1970" : {0 : 2.5, 1 : 1.2, 2 : .7},
+ "B1980" : {0 : 3.2, 1 : 1.3, 2 : .1},
+ "X" : dict(zip(range(3), x))
+ })
+ df["id"] = df.index
+ exp_data = {"X" : x.tolist() + x.tolist(),
+ "A" : ['a', 'b', 'c', 'd', 'e', 'f'],
+ "B" : [2.5, 1.2, 0.7, 3.2, 1.3, 0.1],
+ "year" : [1970, 1970, 1970, 1980, 1980, 1980],
+ "id" : [0, 1, 2, 0, 1, 2]}
+ exp_frame = DataFrame(exp_data)
+ exp_frame = exp_frame.set_index(['id', 'year'])[["X", "A", "B"]]
+ long_frame = wide_to_long(df, ["A", "B"], i="id", j="year")
+ tm.assert_frame_equal(long_frame, exp_frame)
+
if __name__ == '__main__':
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
| closes #4920
I thought I submitted this PR long ago.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5564 | 2013-11-21T12:46:25Z | 2013-12-07T14:15:52Z | 2013-12-07T14:15:52Z | 2014-06-30T21:46:37Z |
DOC: styling clean-up of docstrings (part 1, frame.py) | diff --git a/pandas/core/frame.py b/pandas/core/frame.py
index a031b0550c734..6a1ecfed15896 100644
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -170,11 +170,11 @@ class DataFrame(NDFrame):
See also
--------
- DataFrame.from_records: constructor from tuples, also record arrays
- DataFrame.from_dict: from dicts of Series, arrays, or dicts
- DataFrame.from_csv: from CSV files
- DataFrame.from_items: from sequence of (key, value) pairs
- read_csv / read_table / read_clipboard
+ DataFrame.from_records : constructor from tuples, also record arrays
+ DataFrame.from_dict : from dicts of Series, arrays, or dicts
+ DataFrame.from_csv : from CSV files
+ DataFrame.from_items : from sequence of (key, value) pairs
+ pandas.read_csv, pandas.read_table, pandas.read_clipboard
"""
_auto_consolidate = True
@@ -728,7 +728,7 @@ def from_records(cls, data, index=None, exclude=None, columns=None,
index : string, list of fields, array-like
Field of array to use as the index, alternately a specific set of
input labels to use
- exclude: sequence, default None
+ exclude : sequence, default None
Columns or fields to exclude
columns : sequence, default None
Column names to use. If the passed data do not have named
@@ -1167,8 +1167,10 @@ def to_excel(self, excel_writer, sheet_name='Sheet1', na_rep='',
Column label for index column(s) if desired. If None is given, and
`header` and `index` are True, then the index names are used. A
sequence should be given if the DataFrame uses MultiIndex.
- startow : upper left cell row to dump data frame
- startcol : upper left cell column to dump data frame
+ startow :
+ upper left cell row to dump data frame
+ startcol :
+ upper left cell column to dump data frame
engine : string, default None
write engine to use - you can also set this via the options
``io.excel.xlsx.writer``, ``io.excel.xls.writer``, and
@@ -1180,7 +1182,7 @@ def to_excel(self, excel_writer, sheet_name='Sheet1', na_rep='',
-----
If passing an existing ExcelWriter object, then the sheet will be added
to the existing workbook. This can be used to save different
- DataFrames to one workbook
+ DataFrames to one workbook:
>>> writer = ExcelWriter('output.xlsx')
>>> df1.to_excel(writer,'Sheet1')
@@ -1249,13 +1251,14 @@ def to_sql(self, name, con, flavor='sqlite', if_exists='fail', **kwargs):
Parameters
----------
- name: name of SQL table
- conn: an open SQL database connection object
+ name : str
+ Name of SQL table
+ conn : an open SQL database connection object
flavor: {'sqlite', 'mysql', 'oracle'}, default 'sqlite'
if_exists: {'fail', 'replace', 'append'}, default 'fail'
- fail: If table exists, do nothing.
- replace: If table exists, drop it, recreate it, and insert data.
- append: If table exists, insert data. Create if does not exist.
+ - fail: If table exists, do nothing.
+ - replace: If table exists, drop it, recreate it, and insert data.
+ - append: If table exists, insert data. Create if does not exist.
"""
from pandas.io.sql import write_frame
write_frame(
@@ -1316,6 +1319,7 @@ def to_html(self, buf=None, columns=None, col_space=None, colSpace=None,
CSS class(es) to apply to the resulting html table
escape : boolean, default True
Convert the characters <, >, and & to HTML-safe sequences.
+
"""
if force_unicode is not None: # pragma: no cover
@@ -1355,6 +1359,7 @@ def to_latex(self, buf=None, columns=None, col_space=None, colSpace=None,
bold_rows : boolean, default True
Make the row labels bold in the output
+
"""
if force_unicode is not None: # pragma: no cover
@@ -1923,8 +1928,9 @@ def _set_item(self, key, value):
def insert(self, loc, column, value, allow_duplicates=False):
"""
Insert column into DataFrame at specified location.
- if allow_duplicates is False, Raises Exception if column is already
- contained in the DataFrame
+
+ If `allow_duplicates` is False, raises Exception if column
+ is already contained in the DataFrame.
Parameters
----------
@@ -2010,7 +2016,7 @@ def xs(self, key, axis=0, level=None, copy=True, drop_level=True):
which levels are used. Levels can be referred by label or position.
copy : boolean, default True
Whether to make a copy of the data
- drop_level, default True
+ drop_level : boolean, default True
If False, returns object with same levels as self.
Examples
@@ -2133,9 +2139,9 @@ def xs(self, key, axis=0, level=None, copy=True, drop_level=True):
_xs = xs
def lookup(self, row_labels, col_labels):
- """Label-based "fancy indexing" function for DataFrame. Given
- equal-length arrays of row and column labels, return an array of the
- values corresponding to each (row, col) pair.
+ """Label-based "fancy indexing" function for DataFrame.
+ Given equal-length arrays of row and column labels, return an
+ array of the values corresponding to each (row, col) pair.
Parameters
----------
@@ -2146,13 +2152,11 @@ def lookup(self, row_labels, col_labels):
Notes
-----
- Akin to
-
- .. code-block:: python
+ Akin to::
- result = []
- for row, col in zip(row_labels, col_labels):
- result.append(df.get_value(row, col))
+ result = []
+ for row, col in zip(row_labels, col_labels):
+ result.append(df.get_value(row, col))
Examples
--------
@@ -2467,14 +2471,14 @@ def dropna(self, axis=0, how='any', thresh=None, subset=None,
axis : {0, 1}, or tuple/list thereof
Pass tuple or list to drop on multiple axes
how : {'any', 'all'}
- any : if any NA values are present, drop that label
- all : if all values are NA, drop that label
+ * any : if any NA values are present, drop that label
+ * all : if all values are NA, drop that label
thresh : int, default None
int value : require that many non-NA values
subset : array-like
Labels along other axis to consider, e.g. if you are dropping rows
these would be a list of columns to include
- inplace : bool, defalt False
+ inplace : boolean, defalt False
If True, do operation inplace and return None.
Returns
@@ -2725,7 +2729,7 @@ def sortlevel(self, level=0, axis=0, ascending=True, inplace=False):
----------
level : int
axis : {0, 1}
- ascending : bool, default True
+ ascending : boolean, default True
inplace : boolean, default False
Sort the DataFrame without creating a new instance
@@ -2790,9 +2794,11 @@ def reorder_levels(self, order, axis=0):
Parameters
----------
- order: list of int representing new level order.
- (reference level by number not by key)
- axis: where to reorder levels
+ order : list of int
+ List representing new level order. Reference level by number
+ not by key.
+ axis : int
+ Where to reorder levels.
Returns
-------
@@ -3057,8 +3063,10 @@ def combine_first(self, other):
Examples
--------
+ a's values prioritized, use values from b to fill holes:
+
>>> a.combine_first(b)
- a's values prioritized, use values from b to fill holes
+
Returns
-------
@@ -3094,7 +3102,7 @@ def update(self, other, join='left', overwrite=True, filter_func=None,
filter_func : callable(1d-array) -> 1d-array<boolean>, default None
Can choose to replace values other than NA. Return True for values
that should be updated
- raise_conflict : bool
+ raise_conflict : boolean
If True, will raise an error if the DataFrame and other both
contain data in the same place.
"""
@@ -3322,22 +3330,24 @@ def diff(self, periods=1):
def apply(self, func, axis=0, broadcast=False, raw=False, reduce=True,
args=(), **kwds):
"""
- Applies function along input axis of DataFrame. Objects passed to
- functions are Series objects having index either the DataFrame's index
- (axis=0) or the columns (axis=1). Return type depends on whether passed
- function aggregates
+ Applies function along input axis of DataFrame.
+
+ Objects passed to functions are Series objects having index
+ either the DataFrame's index (axis=0) or the columns (axis=1).
+ Return type depends on whether passed function aggregates
Parameters
----------
func : function
- Function to apply to each column
+ Function to apply to each column/row
axis : {0, 1}
- 0 : apply function to each column
- 1 : apply function to each row
- broadcast : bool, default False
+ * 0 : apply function to each column
+ * 1 : apply function to each row
+ broadcast : boolean, default False
For aggregation functions, return object of same size with values
propagated
- reduce : bool, default True, try to apply reduction procedures
+ reduce : boolean, default True
+ Try to apply reduction procedures
raw : boolean, default False
If False, convert each row or column into a Series. If raw=True the
passed function will receive ndarray objects instead. If you are
@@ -3529,6 +3539,11 @@ def applymap(self, func):
Returns
-------
applied : DataFrame
+
+ See also
+ --------
+ DataFrame.apply : For operations on rows/columns
+
"""
# if we have a dtype == 'M8[ns]', provide boxed values
@@ -3611,6 +3626,7 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
how : {'left', 'right', 'outer', 'inner'}
How to handle indexes of the two objects. Default: 'left'
for joining on index, None otherwise
+
* left: use calling frame's index
* right: use input frame's index
* outer: form union of indexes
@@ -3698,9 +3714,9 @@ def corr(self, method='pearson', min_periods=1):
Parameters
----------
method : {'pearson', 'kendall', 'spearman'}
- pearson : standard correlation coefficient
- kendall : Kendall Tau correlation coefficient
- spearman : Spearman rank correlation
+ * pearson : standard correlation coefficient
+ * kendall : Kendall Tau correlation coefficient
+ * spearman : Spearman rank correlation
min_periods : int, optional
Minimum number of observations required per pair of columns
to have a valid result. Currently only available for pearson
@@ -3756,7 +3772,9 @@ def cov(self, min_periods=None):
-------
y : DataFrame
- y contains the covariance matrix of the DataFrame's time series.
+ Notes
+ -----
+ `y` contains the covariance matrix of the DataFrame's time series.
The covariance is normalized by N-1 (unbiased estimator).
"""
numeric_df = self._get_numeric_data()
@@ -4156,9 +4174,9 @@ def mode(self, axis=0, numeric_only=False):
Parameters
----------
axis : {0, 1, 'index', 'columns'} (default 0)
- 0/'index' : get mode of each column
- 1/'columns' : get mode of each row
- numeric_only : bool, default False
+ * 0/'index' : get mode of each column
+ * 1/'columns' : get mode of each row
+ numeric_only : boolean, default False
if True, only apply to numeric columns
Returns
@@ -4213,14 +4231,14 @@ def rank(self, axis=0, numeric_only=None, method='average',
numeric_only : boolean, default None
Include only float, int, boolean data
method : {'average', 'min', 'max', 'first'}
- average: average rank of group
- min: lowest rank in group
- max: highest rank in group
- first: ranks assigned in order they appear in the array
+ * average: average rank of group
+ * min: lowest rank in group
+ * max: highest rank in group
+ * first: ranks assigned in order they appear in the array
na_option : {'keep', 'top', 'bottom'}
- keep: leave NA values where they are
- top: smallest rank if ascending
- bottom: smallest rank if descending
+ * keep: leave NA values where they are
+ * top: smallest rank if ascending
+ * bottom: smallest rank if descending
ascending : boolean, default True
False for ranks by high (1) to low (N)
@@ -4861,11 +4879,11 @@ def boxplot(self, column=None, by=None, ax=None, fontsize=None,
Can be any valid input to groupby
by : string or sequence
Column in the DataFrame to group by
- ax : matplotlib axis object, default None
+ ax : matplotlib axis object, default None
fontsize : int or string
- rot : int, default None
+ rot : int, default None
Rotation for ticks
- grid : boolean, default None (matlab style default)
+ grid : boolean, default None (matlab style default)
Axis grid lines
Returns
| Some stylistic clean-up of the docstrings in frame.py.
Things changed are mainly:
- missing spaces aroung the `:` in `param : type`
- explanation of param on second line (instead of on the same line -> there should be the type info)
- add bullets to enumerations of possible values of a keyword (so they are rendered as a list in the html docstring instead of one continuous block of text) Eg the `method` keyword explanation in http://pandas.pydata.org/pandas-docs/dev/generated/pandas.DataFrame.corr.html
| https://api.github.com/repos/pandas-dev/pandas/pulls/5560 | 2013-11-20T21:25:18Z | 2013-11-23T10:10:45Z | 2013-11-23T10:10:45Z | 2014-06-23T21:39:28Z |
DOC version added 0.13 to cumcount | diff --git a/doc/source/groupby.rst b/doc/source/groupby.rst
index 03919caf6d101..705db807ddf8f 100644
--- a/doc/source/groupby.rst
+++ b/doc/source/groupby.rst
@@ -709,6 +709,8 @@ can be used as group keys. If so, the order of the levels will be preserved:
Enumerate group items
~~~~~~~~~~~~~~~~~~~~~
+.. versionadded:: 0.13.0
+
To see the order in which each row appears within its group, use the
``cumcount`` method:
| @jreback is this what you mean? #4646
| https://api.github.com/repos/pandas-dev/pandas/pulls/5559 | 2013-11-20T21:12:41Z | 2013-11-20T21:15:16Z | 2013-11-20T21:15:16Z | 2014-06-14T21:14:01Z |
BUG: repr of series fails repr in the presence of a Float64Index that is not monotonic (GH5557) | diff --git a/pandas/core/series.py b/pandas/core/series.py
index cf704e9aef174..9a2eb9da3a6a4 100644
--- a/pandas/core/series.py
+++ b/pandas/core/series.py
@@ -870,12 +870,12 @@ def _tidy_repr(self, max_vals=20):
Internal function, should always return unicode string
"""
num = max_vals // 2
- head = self[:num]._get_repr(print_header=True, length=False,
- dtype=False, name=False)
- tail = self[-(max_vals - num):]._get_repr(print_header=False,
- length=False,
- name=False,
- dtype=False)
+ head = self.iloc[:num]._get_repr(print_header=True, length=False,
+ dtype=False, name=False)
+ tail = self.iloc[-(max_vals - num):]._get_repr(print_header=False,
+ length=False,
+ name=False,
+ dtype=False)
result = head + '\n...\n' + tail
result = '%s\n%s' % (result, self._repr_footer())
diff --git a/pandas/tests/test_indexing.py b/pandas/tests/test_indexing.py
index 581513408c0a1..02b5812c3e653 100644
--- a/pandas/tests/test_indexing.py
+++ b/pandas/tests/test_indexing.py
@@ -1797,6 +1797,15 @@ def f():
df2["B"] = df2["A"]
df2["B"] = df2["A"]
+ def test_float64index_slicing_bug(self):
+ # GH 5557, related to slicing a float index
+ ser = {256: 2321.0, 1: 78.0, 2: 2716.0, 3: 0.0, 4: 369.0, 5: 0.0, 6: 269.0, 7: 0.0, 8: 0.0, 9: 0.0, 10: 3536.0, 11: 0.0, 12: 24.0, 13: 0.0, 14: 931.0, 15: 0.0, 16: 101.0, 17: 78.0, 18: 9643.0, 19: 0.0, 20: 0.0, 21: 0.0, 22: 63761.0, 23: 0.0, 24: 446.0, 25: 0.0, 26: 34773.0, 27: 0.0, 28: 729.0, 29: 78.0, 30: 0.0, 31: 0.0, 32: 3374.0, 33: 0.0, 34: 1391.0, 35: 0.0, 36: 361.0, 37: 0.0, 38: 61808.0, 39: 0.0, 40: 0.0, 41: 0.0, 42: 6677.0, 43: 0.0, 44: 802.0, 45: 0.0, 46: 2691.0, 47: 0.0, 48: 3582.0, 49: 0.0, 50: 734.0, 51: 0.0, 52: 627.0, 53: 70.0, 54: 2584.0, 55: 0.0, 56: 324.0, 57: 0.0, 58: 605.0, 59: 0.0, 60: 0.0, 61: 0.0, 62: 3989.0, 63: 10.0, 64: 42.0, 65: 0.0, 66: 904.0, 67: 0.0, 68: 88.0, 69: 70.0, 70: 8172.0, 71: 0.0, 72: 0.0, 73: 0.0, 74: 64902.0, 75: 0.0, 76: 347.0, 77: 0.0, 78: 36605.0, 79: 0.0, 80: 379.0, 81: 70.0, 82: 0.0, 83: 0.0, 84: 3001.0, 85: 0.0, 86: 1630.0, 87: 7.0, 88: 364.0, 89: 0.0, 90: 67404.0, 91: 9.0, 92: 0.0, 93: 0.0, 94: 7685.0, 95: 0.0, 96: 1017.0, 97: 0.0, 98: 2831.0, 99: 0.0, 100: 2963.0, 101: 0.0, 102: 854.0, 103: 0.0, 104: 0.0, 105: 0.0, 106: 0.0, 107: 0.0, 108: 0.0, 109: 0.0, 110: 0.0, 111: 0.0, 112: 0.0, 113: 0.0, 114: 0.0, 115: 0.0, 116: 0.0, 117: 0.0, 118: 0.0, 119: 0.0, 120: 0.0, 121: 0.0, 122: 0.0, 123: 0.0, 124: 0.0, 125: 0.0, 126: 67744.0, 127: 22.0, 128: 264.0, 129: 0.0, 260: 197.0, 268: 0.0, 265: 0.0, 269: 0.0, 261: 0.0, 266: 1198.0, 267: 0.0, 262: 2629.0, 258: 775.0, 257: 0.0, 263: 0.0, 259: 0.0, 264: 163.0, 250: 10326.0, 251: 0.0, 252: 1228.0, 253: 0.0, 254: 2769.0, 255: 0.0}
+
+ # smoke test for the repr
+ s = Series(ser)
+ result = s.value_counts()
+ str(result)
+
def test_floating_index_doc_example(self):
index = Index([1.5, 2, 3, 4.5, 5])
| closes #5557
```
In [4]: s.value_counts()
Out[4]:
0 85
70 3
78 3
2584 1
3001 1
734 1
163 1
3374 1
9643 1
42 1
8172 1
931 1
802 1
67744 1
2716 1
...
775 1
36605 1
1630 1
605 1
347 1
729 1
88 1
854 1
34773 1
2769 1
3536 1
67404 1
264 1
1228 1
324 1
Length: 61, dtype: int64
```
| https://api.github.com/repos/pandas-dev/pandas/pulls/5558 | 2013-11-20T19:52:12Z | 2013-11-20T20:15:58Z | 2013-11-20T20:15:58Z | 2014-06-12T14:46:25Z |
BUG: Bug in selecting from a non-unique index with loc (GH5553) | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 1642324172e3b..ccc34a4051508 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -813,6 +813,7 @@ Bug Fixes
- Bug in getitem with a multi-index and ``iloc`` (:issue:`5528`)
- Bug in delitem on a Series (:issue:`5542`)
- Bug fix in apply when using custom function and objects are not mutated (:issue:`5545`)
+ - Bug in selecting from a non-unique index with ``loc`` (:issue:`5553`)
pandas 0.12.0
-------------
diff --git a/pandas/core/indexing.py b/pandas/core/indexing.py
index 6d0f57c6ddd57..fcb9a82b96211 100644
--- a/pandas/core/indexing.py
+++ b/pandas/core/indexing.py
@@ -826,8 +826,10 @@ def _reindex(keys, level=None):
# a unique indexer
if keyarr_is_unique:
- new_indexer = (Index(cur_indexer) +
- Index(missing_indexer)).values
+
+ # see GH5553, make sure we use the right indexer
+ new_indexer = np.arange(len(indexer))
+ new_indexer[cur_indexer] = np.arange(len(result._get_axis(axis)))
new_indexer[missing_indexer] = -1
# we have a non_unique selector, need to use the original
diff --git a/pandas/tests/test_indexing.py b/pandas/tests/test_indexing.py
index 86c3808781694..581513408c0a1 100644
--- a/pandas/tests/test_indexing.py
+++ b/pandas/tests/test_indexing.py
@@ -869,9 +869,9 @@ def test_dups_fancy_indexing(self):
assert_frame_equal(df,result)
# GH 3561, dups not in selected order
- df = DataFrame({'test': [5,7,9,11]}, index=['A', 'A', 'B', 'C'])
+ df = DataFrame({'test': [5,7,9,11], 'test1': [4.,5,6,7], 'other': list('abcd') }, index=['A', 'A', 'B', 'C'])
rows = ['C', 'B']
- expected = DataFrame({'test' : [11,9]},index=rows)
+ expected = DataFrame({'test' : [11,9], 'test1': [ 7., 6], 'other': ['d','c']},index=rows)
result = df.ix[rows]
assert_frame_equal(result, expected)
@@ -879,7 +879,15 @@ def test_dups_fancy_indexing(self):
assert_frame_equal(result, expected)
rows = ['C','B','E']
- expected = DataFrame({'test' : [11,9,np.nan]},index=rows)
+ expected = DataFrame({'test' : [11,9,np.nan], 'test1': [7.,6,np.nan], 'other': ['d','c',np.nan]},index=rows)
+ result = df.ix[rows]
+ assert_frame_equal(result, expected)
+
+ # see GH5553, make sure we use the right indexer
+ rows = ['F','G','H','C','B','E']
+ expected = DataFrame({'test' : [np.nan,np.nan,np.nan,11,9,np.nan],
+ 'test1': [np.nan,np.nan,np.nan,7.,6,np.nan],
+ 'other': [np.nan,np.nan,np.nan,'d','c',np.nan]},index=rows)
result = df.ix[rows]
assert_frame_equal(result, expected)
| closes #5553
| https://api.github.com/repos/pandas-dev/pandas/pulls/5555 | 2013-11-20T15:25:57Z | 2013-11-20T16:07:05Z | 2013-11-20T16:07:05Z | 2014-07-16T08:41:04Z |
BUG: Bug fix in apply when using custom function and objects are not mutated (GH5545) | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 6ba31fbc61a05..1642324172e3b 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -812,6 +812,7 @@ Bug Fixes
length to the indexer (:issue:`5508`)
- Bug in getitem with a multi-index and ``iloc`` (:issue:`5528`)
- Bug in delitem on a Series (:issue:`5542`)
+ - Bug fix in apply when using custom function and objects are not mutated (:issue:`5545`)
pandas 0.12.0
-------------
diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py
index 20f17a7f42472..1d5691edb6313 100644
--- a/pandas/core/groupby.py
+++ b/pandas/core/groupby.py
@@ -543,13 +543,13 @@ def head(self, n=5):
>>> df = DataFrame([[1, 2], [1, 4], [5, 6]],
columns=['A', 'B'])
- >>> df.groupby('A', as_index=False).head(1)
+ >>> df.groupby('A', as_index=False).head(1)
A B
0 1 2
2 5 6
>>> df.groupby('A').head(1)
A B
- A
+ A
1 0 1 2
5 2 5 6
@@ -572,16 +572,16 @@ def tail(self, n=5):
>>> df = DataFrame([[1, 2], [1, 4], [5, 6]],
columns=['A', 'B'])
- >>> df.groupby('A', as_index=False).tail(1)
+ >>> df.groupby('A', as_index=False).tail(1)
A B
0 1 2
2 5 6
>>> df.groupby('A').head(1)
A B
- A
+ A
1 0 1 2
5 2 5 6
-
+
"""
rng = np.arange(0, -self.grouper._max_groupsize, -1, dtype='int64')
in_tail = self._cumcount_array(rng, ascending=False) > -n
@@ -2149,6 +2149,12 @@ def _wrap_applied_output(self, keys, values, not_indexed_same=False):
keys, values, not_indexed_same=not_indexed_same
)
+ # still a series
+ # path added as of GH 5545
+ elif all_indexed_same:
+ from pandas.tools.merge import concat
+ return concat(values)
+
if not all_indexed_same:
return self._concat_objects(
keys, values, not_indexed_same=not_indexed_same
diff --git a/pandas/src/reduce.pyx b/pandas/src/reduce.pyx
index cd010151f1ef7..13df983c45d53 100644
--- a/pandas/src/reduce.pyx
+++ b/pandas/src/reduce.pyx
@@ -541,7 +541,7 @@ def apply_frame_axis0(object frame, object f, object names,
# I'm paying the price for index-sharing, ugh
try:
if piece.index is slider.dummy.index:
- piece.index = piece.index.copy()
+ piece = piece.copy()
else:
mutated = True
except AttributeError:
diff --git a/pandas/tests/test_groupby.py b/pandas/tests/test_groupby.py
index a1a7456f51140..1ee7268c0ca82 100644
--- a/pandas/tests/test_groupby.py
+++ b/pandas/tests/test_groupby.py
@@ -1214,7 +1214,7 @@ def test_groupby_as_index_apply(self):
res_not_as_apply = g_not_as.apply(lambda x: x.head(2)).index
# apply doesn't maintain the original ordering
- exp_not_as_apply = Index([0, 2, 1, 4])
+ exp_not_as_apply = Index([0, 2, 1, 4])
exp_as_apply = MultiIndex.from_tuples([(1, 0), (1, 2), (2, 1), (3, 4)])
assert_index_equal(res_as_apply, exp_as_apply)
@@ -1845,6 +1845,28 @@ def test_apply_corner(self):
expected = self.tsframe * 2
assert_frame_equal(result, expected)
+ def test_apply_without_copy(self):
+ # GH 5545
+ # returning a non-copy in an applied function fails
+
+ data = DataFrame({'id_field' : [100, 100, 200, 300], 'category' : ['a','b','c','c'], 'value' : [1,2,3,4]})
+
+ def filt1(x):
+ if x.shape[0] == 1:
+ return x.copy()
+ else:
+ return x[x.category == 'c']
+
+ def filt2(x):
+ if x.shape[0] == 1:
+ return x
+ else:
+ return x[x.category == 'c']
+
+ expected = data.groupby('id_field').apply(filt1)
+ result = data.groupby('id_field').apply(filt2)
+ assert_frame_equal(result,expected)
+
def test_apply_use_categorical_name(self):
from pandas import qcut
cats = qcut(self.df.C, 4)
@@ -2638,7 +2660,7 @@ def test_cumcount_mi(self):
expected = Series([0, 1, 2, 0, 3], index=mi)
assert_series_equal(expected, g.cumcount())
- assert_series_equal(expected, sg.cumcount())
+ assert_series_equal(expected, sg.cumcount())
def test_cumcount_groupby_not_col(self):
df = DataFrame([['a'], ['a'], ['a'], ['b'], ['a']], columns=['A'], index=[0] * 5)
@@ -2895,7 +2917,7 @@ def test_filter_maintains_ordering(self):
def test_filter_and_transform_with_non_unique_int_index(self):
# GH4620
index = [1, 1, 1, 2, 1, 1, 0, 1]
- df = DataFrame({'pid' : [1,1,1,2,2,3,3,3],
+ df = DataFrame({'pid' : [1,1,1,2,2,3,3,3],
'tag' : [23,45,62,24,45,34,25,62]}, index=index)
grouped_df = df.groupby('tag')
ser = df['pid']
@@ -2923,7 +2945,7 @@ def test_filter_and_transform_with_non_unique_int_index(self):
# ^ made manually because this can get confusing!
assert_series_equal(actual, expected)
- # Transform Series
+ # Transform Series
actual = grouped_ser.transform(len)
expected = Series([1, 2, 2, 1, 2, 1, 1, 2], index)
assert_series_equal(actual, expected)
| closes #5545
| https://api.github.com/repos/pandas-dev/pandas/pulls/5554 | 2013-11-20T14:08:02Z | 2013-11-20T14:28:49Z | 2013-11-20T14:28:49Z | 2014-06-22T05:16:05Z |
HTML (and text) reprs for large dataframes. | diff --git a/doc/source/dsintro.rst b/doc/source/dsintro.rst
index 08ef25b178af9..828797deff5cf 100644
--- a/doc/source/dsintro.rst
+++ b/doc/source/dsintro.rst
@@ -573,8 +573,9 @@ indexing semantics are quite different in places from a matrix.
Console display
~~~~~~~~~~~~~~~
-For very large DataFrame objects, only a summary will be printed to the console
-(here I am reading a CSV version of the **baseball** dataset from the **plyr**
+Very large DataFrames will be truncated to display them in the console.
+You can also get a summary using :meth:`~pandas.DataFrame.info`.
+(Here I am reading a CSV version of the **baseball** dataset from the **plyr**
R package):
.. ipython:: python
@@ -587,6 +588,7 @@ R package):
baseball = read_csv('data/baseball.csv')
print(baseball)
+ baseball.info()
.. ipython:: python
:suppress:
@@ -622,19 +624,8 @@ option:
reset_option('line_width')
-You can also disable this feature via the ``expand_frame_repr`` option:
-
-.. ipython:: python
-
- set_option('expand_frame_repr', False)
-
- DataFrame(randn(3, 12))
-
-.. ipython:: python
- :suppress:
-
- reset_option('expand_frame_repr')
-
+You can also disable this feature via the ``expand_frame_repr`` option.
+This will print the table in one block.
DataFrame column attribute access and IPython completion
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/doc/source/faq.rst b/doc/source/faq.rst
index e5312e241ce47..21d581f12c53f 100644
--- a/doc/source/faq.rst
+++ b/doc/source/faq.rst
@@ -36,21 +36,25 @@ horizontal scrolling, auto-detection of width/height.
To appropriately address all these environments, the display behavior is controlled
by several options, which you're encouraged to tweak to suit your setup.
-As of 0.12, these are the relevant options, all under the `display` namespace,
-(e.g. display.width, etc'):
+As of 0.13, these are the relevant options, all under the `display` namespace,
+(e.g. ``display.width``, etc.):
- notebook_repr_html: if True, IPython frontends with HTML support will display
dataframes as HTML tables when possible.
-- expand_repr (default True): when the frame width cannot fit within the screen,
- the output will be broken into multiple pages to accomedate. This applies to
- textual (as opposed to HTML) display only.
-- max_columns: max dataframe columns to display. a wider frame will trigger
- a summary view, unless `expand_repr` is True and HTML output is disabled.
-- max_rows: max dataframe rows display. a longer frame will trigger a summary view.
-- width: width of display screen in characters, used to determine the width of lines
- when expand_repr is active, Setting this to None will trigger auto-detection of terminal
- width, this only works for proper terminals, not IPython frontends such as ipnb.
- width is ignored in IPython notebook, since the browser provides horizontal scrolling.
+- large_repr (default 'truncate'): when a :class:`~pandas.DataFrame`
+ exceeds max_columns or max_rows, it can be displayed either as a
+ truncated table or, with this set to 'info', as a short summary view.
+- max_columns (default 20): max dataframe columns to display.
+- max_rows (default 60): max dataframe rows display.
+
+Two additional options only apply to displaying DataFrames in terminals,
+not to the HTML view:
+
+- expand_repr (default True): when the frame width cannot fit within
+ the screen, the output will be broken into multiple pages.
+- width: width of display screen in characters, used to determine the
+ width of lines when expand_repr is active. Setting this to None will
+ trigger auto-detection of terminal width.
IPython users can use the IPython startup file to import pandas and set these
options automatically when starting up.
diff --git a/doc/source/v0.13.0.txt b/doc/source/v0.13.0.txt
index 207281caafeae..a39e415abe519 100644
--- a/doc/source/v0.13.0.txt
+++ b/doc/source/v0.13.0.txt
@@ -375,6 +375,22 @@ HDFStore API Changes
via the option ``io.hdf.dropna_table`` (:issue:`4625`)
- pass thru store creation arguments; can be used to support in-memory stores
+DataFrame repr Changes
+~~~~~~~~~~~~~~~~~~~~~~
+
+The HTML and plain text representations of :class:`DataFrame` now show
+a truncated view of the table once it exceeds a certain size, rather
+than switching to the short info view (:issue:`4886`, :issue:`5550`).
+This makes the representation more consistent as small DataFrames get
+larger.
+
+.. image:: _static/df_repr_truncated.png
+ :alt: Truncated HTML representation of a DataFrame
+
+To get the info view, call :meth:`DataFrame.info`. If you prefer the
+info view as the repr for large DataFrames, you can set this by running
+``set_option('display.large_repr', 'info')``.
+
Enhancements
~~~~~~~~~~~~
diff --git a/pandas/core/config_init.py b/pandas/core/config_init.py
index 5502dc94e24c1..b7ec76522b60c 100644
--- a/pandas/core/config_init.py
+++ b/pandas/core/config_init.py
@@ -166,13 +166,19 @@
pc_max_info_rows_doc = """
: int or None
- max_info_rows is the maximum number of rows for which a frame will
- perform a null check on its columns when repr'ing To a console.
- The default is 1,000,000 rows. So, if a DataFrame has more
- 1,000,000 rows there will be no null check performed on the
- columns and thus the representation will take much less time to
- display in an interactive session. A value of None means always
- perform a null check when repr'ing.
+ Deprecated.
+"""
+
+pc_max_info_rows_deprecation_warning = """\
+max_info_rows has been deprecated, as reprs no longer use the info view.
+"""
+
+pc_large_repr_doc = """
+: 'truncate'/'info'
+
+ For DataFrames exceeding max_rows/max_cols, the repr (and HTML repr) can
+ show a truncated table (the default from 0.13), or switch to the view from
+ df.info() (the behaviour in earlier versions of pandas).
"""
pc_mpl_style_doc = """
@@ -220,6 +226,8 @@ def mpl_style_cb(key):
cf.register_option('max_colwidth', 50, max_colwidth_doc, validator=is_int)
cf.register_option('max_columns', 20, pc_max_cols_doc,
validator=is_instance_factory([type(None), int]))
+ cf.register_option('large_repr', 'truncate', pc_large_repr_doc,
+ validator=is_one_of_factory(['truncate', 'info']))
cf.register_option('max_info_columns', 100, pc_max_info_cols_doc,
validator=is_int)
cf.register_option('colheader_justify', 'right', colheader_justify_doc,
@@ -258,6 +266,9 @@ def mpl_style_cb(key):
msg=pc_height_deprecation_warning,
rkey='display.max_rows')
+cf.deprecate_option('display.max_info_rows',
+ msg=pc_max_info_rows_deprecation_warning)
+
tc_sim_interactive_doc = """
: boolean
Whether to simulate interactive mode for purposes of testing
diff --git a/pandas/core/format.py b/pandas/core/format.py
index 7354600c78c67..1ca68b8d47e09 100644
--- a/pandas/core/format.py
+++ b/pandas/core/format.py
@@ -1,3 +1,4 @@
+#coding: utf-8
from __future__ import print_function
# pylint: disable=W0141
@@ -263,7 +264,8 @@ class DataFrameFormatter(TableFormatter):
def __init__(self, frame, buf=None, columns=None, col_space=None,
header=True, index=True, na_rep='NaN', formatters=None,
justify=None, float_format=None, sparsify=None,
- index_names=True, line_width=None, **kwds):
+ index_names=True, line_width=None, max_rows=None, max_cols=None,
+ show_dimensions=False, **kwds):
self.frame = frame
self.buf = buf if buf is not None else StringIO()
self.show_index_names = index_names
@@ -280,6 +282,9 @@ def __init__(self, frame, buf=None, columns=None, col_space=None,
self.header = header
self.index = index
self.line_width = line_width
+ self.max_rows = max_rows
+ self.max_cols = max_cols
+ self.show_dimensions = show_dimensions
if justify is None:
self.justify = get_option("display.colheader_justify")
@@ -303,12 +308,20 @@ def _to_str_columns(self):
str_index = self._get_formatted_index()
str_columns = self._get_formatted_column_labels()
- stringified = []
-
_strlen = _strlen_func()
- for i, c in enumerate(self.columns):
- if self.header:
+ cols_to_show = self.columns[:self.max_cols]
+ truncate_h = self.max_cols and (len(self.columns) > self.max_cols)
+ truncate_v = self.max_rows and (len(self.frame) > self.max_rows)
+ self.truncated_v = truncate_v
+ if truncate_h:
+ cols_to_show = self.columns[:self.max_cols]
+ else:
+ cols_to_show = self.columns
+
+ if self.header:
+ stringified = []
+ for i, c in enumerate(cols_to_show):
fmt_values = self._format_col(i)
cheader = str_columns[i]
@@ -316,7 +329,7 @@ def _to_str_columns(self):
*(_strlen(x) for x in cheader))
fmt_values = _make_fixed_width(fmt_values, self.justify,
- minimum=max_colwidth)
+ minimum=max_colwidth, truncated=truncate_v)
max_len = max(np.max([_strlen(x) for x in fmt_values]),
max_colwidth)
@@ -326,14 +339,17 @@ def _to_str_columns(self):
cheader = [x.rjust(max_len) for x in cheader]
stringified.append(cheader + fmt_values)
- else:
- stringified = [_make_fixed_width(self._format_col(i),
- self.justify)
- for i, c in enumerate(self.columns)]
+ else:
+ stringified = [_make_fixed_width(self._format_col(i), self.justify,
+ truncated=truncate_v)
+ for i, c in enumerate(cols_to_show)]
strcols = stringified
if self.index:
strcols.insert(0, str_index)
+ if truncate_h:
+ strcols.append(([''] * len(str_columns[-1])) \
+ + (['...'] * min(len(self.frame), self.max_rows)) )
return strcols
@@ -364,6 +380,10 @@ def to_string(self, force_unicode=None):
self.buf.writelines(text)
+ if self.show_dimensions:
+ self.buf.write("\n\n[%d rows x %d columns]" \
+ % (len(frame), len(frame.columns)) )
+
def _join_multiline(self, *strcols):
lwidth = self.line_width
adjoin_width = 1
@@ -378,6 +398,11 @@ def _join_multiline(self, *strcols):
col_bins = _binify(col_widths, lwidth)
nbins = len(col_bins)
+ if self.max_rows and len(self.frame) > self.max_rows:
+ nrows = self.max_rows + 1
+ else:
+ nrows = len(self.frame)
+
str_lst = []
st = 0
for i, ed in enumerate(col_bins):
@@ -385,9 +410,9 @@ def _join_multiline(self, *strcols):
row.insert(0, idx)
if nbins > 1:
if ed <= len(strcols) and i < nbins - 1:
- row.append([' \\'] + [' '] * (len(self.frame) - 1))
+ row.append([' \\'] + [' '] * (nrows - 1))
else:
- row.append([' '] * len(self.frame))
+ row.append([' '] * nrows)
str_lst.append(adjoin(adjoin_width, *row))
st = ed
@@ -458,8 +483,8 @@ def write(buf, frame, column_format, strcols):
def _format_col(self, i):
formatter = self._get_formatter(i)
- return format_array(self.frame.icol(i).get_values(), formatter,
- float_format=self.float_format,
+ return format_array(self.frame.icol(i)[:self.max_rows].get_values(),
+ formatter, float_format=self.float_format,
na_rep=self.na_rep,
space=self.col_space)
@@ -467,7 +492,9 @@ def to_html(self, classes=None):
"""
Render a DataFrame to a html table.
"""
- html_renderer = HTMLFormatter(self, classes=classes)
+ html_renderer = HTMLFormatter(self, classes=classes,
+ max_rows=self.max_rows,
+ max_cols=self.max_cols)
if hasattr(self.buf, 'write'):
html_renderer.write_result(self.buf)
elif isinstance(self.buf, compat.string_types):
@@ -483,8 +510,13 @@ def _get_formatted_column_labels(self):
def is_numeric_dtype(dtype):
return issubclass(dtype.type, np.number)
- if isinstance(self.columns, MultiIndex):
- fmt_columns = self.columns.format(sparsify=False, adjoin=False)
+ if self.max_cols:
+ columns = self.columns[:self.max_cols]
+ else:
+ columns = self.columns
+
+ if isinstance(columns, MultiIndex):
+ fmt_columns = columns.format(sparsify=False, adjoin=False)
fmt_columns = lzip(*fmt_columns)
dtypes = self.frame.dtypes.values
need_leadsp = dict(zip(fmt_columns, map(is_numeric_dtype, dtypes)))
@@ -496,14 +528,14 @@ def is_numeric_dtype(dtype):
str_columns = [list(x) for x in zip(*str_columns)]
else:
- fmt_columns = self.columns.format()
+ fmt_columns = columns.format()
dtypes = self.frame.dtypes
need_leadsp = dict(zip(fmt_columns, map(is_numeric_dtype, dtypes)))
str_columns = [[' ' + x
if not self._get_formatter(i) and need_leadsp[x]
else x]
for i, (col, x) in
- enumerate(zip(self.columns, fmt_columns))]
+ enumerate(zip(columns, fmt_columns))]
if self.show_index_names and self.has_index_names:
for x in str_columns:
@@ -521,7 +553,10 @@ def has_column_names(self):
def _get_formatted_index(self):
# Note: this is only used by to_string(), not by to_html().
- index = self.frame.index
+ if self.max_rows:
+ index = self.frame.index[:self.max_rows]
+ else:
+ index = self.frame.index
columns = self.frame.columns
show_index_names = self.show_index_names and self.has_index_names
@@ -564,7 +599,7 @@ class HTMLFormatter(TableFormatter):
indent_delta = 2
- def __init__(self, formatter, classes=None):
+ def __init__(self, formatter, classes=None, max_rows=None, max_cols=None):
self.fmt = formatter
self.classes = classes
@@ -574,6 +609,9 @@ def __init__(self, formatter, classes=None):
self.bold_rows = self.fmt.kwds.get('bold_rows', False)
self.escape = self.fmt.kwds.get('escape', True)
+ self.max_rows = max_rows or len(self.fmt.frame)
+ self.max_cols = max_cols or len(self.fmt.columns)
+
def write(self, s, indent=0):
rs = com.pprint_thing(s)
self.elements.append(' ' * indent + rs)
@@ -640,6 +678,8 @@ def write_result(self, buf):
'not %s') % type(self.classes))
_classes.extend(self.classes)
+
+
self.write('<table border="1" class="%s">' % ' '.join(_classes),
indent)
@@ -656,6 +696,10 @@ def write_result(self, buf):
indent = self._write_body(indent)
self.write('</table>', indent)
+ if self.fmt.show_dimensions:
+ by = chr(215) if compat.PY3 else unichr(215) # ×
+ self.write(u('<p>%d rows %s %d columns</p>') %
+ (len(frame), by, len(frame.columns)) )
_put_lines(buf, self.elements)
def _write_header(self, indent):
@@ -680,7 +724,9 @@ def _column_header():
else:
if self.fmt.index:
row.append(self.columns.name or '')
- row.extend(self.columns)
+ row.extend(self.columns[:self.max_cols])
+ if len(self.columns) > self.max_cols:
+ row.append('')
return row
self.write('<thead>', indent)
@@ -695,6 +741,13 @@ def _column_header():
sentinal = com.sentinal_factory()
levels = self.columns.format(sparsify=sentinal, adjoin=False,
names=False)
+ # Truncate column names
+ if len(levels[0]) > self.max_cols:
+ levels = [lev[:self.max_cols] for lev in levels]
+ truncated = True
+ else:
+ truncated = False
+
level_lengths = _get_level_lengths(levels, sentinal)
row_levels = self.frame.index.nlevels
@@ -716,6 +769,9 @@ def _column_header():
j += 1
row.append(v)
+ if truncated:
+ row.append('')
+
self.write_tr(row, indent, self.indent_delta, tags=tags,
header=True)
else:
@@ -726,8 +782,8 @@ def _column_header():
align=align)
if self.fmt.has_index_names:
- row = [x if x is not None else ''
- for x in self.frame.index.names] + [''] * len(self.columns)
+ row = [x if x is not None else '' for x in self.frame.index.names] \
+ + [''] * min(len(self.columns), self.max_cols)
self.write_tr(row, indent, self.indent_delta, header=True)
indent -= self.indent_delta
@@ -740,15 +796,16 @@ def _write_body(self, indent):
indent += self.indent_delta
fmt_values = {}
- for i in range(len(self.columns)):
+ for i in range(min(len(self.columns), self.max_cols)):
fmt_values[i] = self.fmt._format_col(i)
+ truncated = (len(self.columns) > self.max_cols)
# write values
if self.fmt.index:
if isinstance(self.frame.index, MultiIndex):
self._write_hierarchical_rows(fmt_values, indent)
else:
- self._write_regular_rows(fmt_values, indent)
+ self._write_regular_rows(fmt_values, indent, truncated)
else:
for i in range(len(self.frame)):
row = [fmt_values[j][i] for j in range(len(self.columns))]
@@ -760,8 +817,8 @@ def _write_body(self, indent):
return indent
- def _write_regular_rows(self, fmt_values, indent):
- ncols = len(self.columns)
+ def _write_regular_rows(self, fmt_values, indent, truncated):
+ ncols = min(len(self.columns), self.max_cols)
fmt = self.fmt._get_formatter('__index__')
if fmt is not None:
@@ -769,10 +826,17 @@ def _write_regular_rows(self, fmt_values, indent):
else:
index_values = self.frame.index.format()
- for i in range(len(self.frame)):
+ for i in range(min(len(self.frame), self.max_rows)):
row = []
row.append(index_values[i])
row.extend(fmt_values[j][i] for j in range(ncols))
+ if truncated:
+ row.append('...')
+ self.write_tr(row, indent, self.indent_delta, tags=None,
+ nindex_levels=1)
+
+ if len(self.frame) > self.max_rows:
+ row = [''] + (['...'] * ncols)
self.write_tr(row, indent, self.indent_delta, tags=None,
nindex_levels=1)
@@ -780,7 +844,8 @@ def _write_hierarchical_rows(self, fmt_values, indent):
template = 'rowspan="%d" valign="top"'
frame = self.frame
- ncols = len(self.columns)
+ ncols = min(len(self.columns), self.max_cols)
+ truncate = (len(frame) > self.max_rows)
idx_values = frame.index.format(sparsify=False, adjoin=False,
names=False)
@@ -792,9 +857,13 @@ def _write_hierarchical_rows(self, fmt_values, indent):
sentinal = com.sentinal_factory()
levels = frame.index.format(sparsify=sentinal, adjoin=False,
names=False)
+ # Truncate row names
+ if truncate:
+ levels = [lev[:self.max_rows] for lev in levels]
+
level_lengths = _get_level_lengths(levels, sentinal)
- for i in range(len(frame)):
+ for i in range(min(len(frame), self.max_rows)):
row = []
tags = {}
@@ -825,6 +894,11 @@ def _write_hierarchical_rows(self, fmt_values, indent):
self.write_tr(row, indent, self.indent_delta, tags=None,
nindex_levels=frame.index.nlevels)
+ # Truncation markers (...)
+ if truncate:
+ row = ([''] * frame.index.nlevels) + (['...'] * ncols)
+ self.write_tr(row, indent, self.indent_delta, tags=None)
+
def _get_level_lengths(levels, sentinal=''):
from itertools import groupby
@@ -1708,7 +1782,7 @@ def _format_timedelta64(x):
return lib.repr_timedelta64(x)
-def _make_fixed_width(strings, justify='right', minimum=None):
+def _make_fixed_width(strings, justify='right', minimum=None, truncated=False):
if len(strings) == 0:
return strings
@@ -1737,7 +1811,12 @@ def just(x):
return justfunc(x, eff_len)
- return [just(x) for x in strings]
+ result = [just(x) for x in strings]
+
+ if truncated:
+ result.append(justfunc('...'[:max_len], max_len))
+
+ return result
def _trim_zeros(str_floats, na_rep='NaN'):
diff --git a/pandas/core/frame.py b/pandas/core/frame.py
index e1dafc60e64d8..88cf898d354e9 100644
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -429,6 +429,12 @@ def _repr_fits_horizontal_(self, ignore_width=False):
return repr_width < width
+ def _info_repr(self):
+ """True if the repr should show the info view."""
+ info_repr_option = (get_option("display.large_repr") == "info")
+ return info_repr_option and not \
+ (self._repr_fits_horizontal_() and self._repr_fits_vertical_())
+
def __unicode__(self):
"""
Return a string representation for a particular DataFrame
@@ -437,30 +443,18 @@ def __unicode__(self):
py2/py3.
"""
buf = StringIO(u(""))
- fits_vertical = self._repr_fits_vertical_()
- fits_horizontal = False
- if fits_vertical:
- # This needs to compute the entire repr
- # so don't do it unless rownum is bounded
- fits_horizontal = self._repr_fits_horizontal_()
-
- if fits_vertical and fits_horizontal:
- self.to_string(buf=buf)
- else:
+ if self._info_repr():
+ self.info(buf=buf)
+ return buf.getvalue()
+
+ max_rows = get_option("display.max_rows")
+ max_cols = get_option("display.max_columns")
+ if get_option("display.expand_frame_repr"):
width, _ = fmt.get_console_size()
- max_columns = get_option("display.max_columns")
- expand_repr = get_option("display.expand_frame_repr")
- # within max_cols and max_rows, but cols exceed width
- # of terminal, then use expand_repr
- if (fits_vertical and
- expand_repr and
- len(self.columns) <= max_columns):
- self.to_string(buf=buf, line_width=width)
- else:
- max_info_rows = get_option('display.max_info_rows')
- verbose = (max_info_rows is None or
- self.shape[0] <= max_info_rows)
- self.info(buf=buf, verbose=verbose)
+ else:
+ width = None
+ self.to_string(buf=buf, max_rows=max_rows, max_cols=max_cols,
+ line_width=width, show_dimensions=True)
return buf.getvalue()
@@ -480,28 +474,20 @@ def _repr_html_(self):
if com.in_qtconsole():
raise ValueError('Disable HTML output in QtConsole')
+ if self._info_repr():
+ buf = StringIO(u(""))
+ self.info(buf=buf)
+ return '<pre>' + buf.getvalue() + '</pre>'
+
if get_option("display.notebook_repr_html"):
- fits_vertical = self._repr_fits_vertical_()
- fits_horizontal = False
- if fits_vertical:
- fits_horizontal = self._repr_fits_horizontal_(
- ignore_width=ipnbh)
-
- if fits_horizontal and fits_vertical:
- return ('<div style="max-height:1000px;'
- 'max-width:1500px;overflow:auto;">\n' +
- self.to_html() + '\n</div>')
- else:
- buf = StringIO(u(""))
- max_info_rows = get_option('display.max_info_rows')
- verbose = (max_info_rows is None or
- self.shape[0] <= max_info_rows)
- self.info(buf=buf, verbose=verbose)
- info = buf.getvalue()
- info = info.replace('&', r'&')
- info = info.replace('<', r'<')
- info = info.replace('>', r'>')
- return ('<pre>\n' + info + '\n</pre>')
+ max_rows = get_option("display.max_rows")
+ max_cols = get_option("display.max_columns")
+
+ return ('<div style="max-height:1000px;'
+ 'max-width:1500px;overflow:auto;">\n' +
+ self.to_html(max_rows=max_rows, max_cols=max_cols,
+ show_dimensions=True) \
+ + '\n</div>')
else:
return None
@@ -1269,7 +1255,8 @@ def to_string(self, buf=None, columns=None, col_space=None, colSpace=None,
header=True, index=True, na_rep='NaN', formatters=None,
float_format=None, sparsify=None, nanRep=None,
index_names=True, justify=None, force_unicode=None,
- line_width=None):
+ line_width=None, max_rows=None, max_cols=None,
+ show_dimensions=False):
"""
Render a DataFrame to a console-friendly tabular output.
"""
@@ -1295,7 +1282,9 @@ def to_string(self, buf=None, columns=None, col_space=None, colSpace=None,
justify=justify,
index_names=index_names,
header=header, index=index,
- line_width=line_width)
+ line_width=line_width,
+ max_rows=max_rows, max_cols=max_cols,
+ show_dimensions=show_dimensions)
formatter.to_string()
if buf is None:
@@ -1307,7 +1296,8 @@ def to_html(self, buf=None, columns=None, col_space=None, colSpace=None,
header=True, index=True, na_rep='NaN', formatters=None,
float_format=None, sparsify=None, index_names=True,
justify=None, force_unicode=None, bold_rows=True,
- classes=None, escape=True):
+ classes=None, escape=True, max_rows=None, max_cols=None,
+ show_dimensions=False):
"""
Render a DataFrame as an HTML table.
@@ -1318,7 +1308,12 @@ def to_html(self, buf=None, columns=None, col_space=None, colSpace=None,
classes : str or list or tuple, default None
CSS class(es) to apply to the resulting html table
escape : boolean, default True
- Convert the characters <, >, and & to HTML-safe sequences.
+ Convert the characters <, >, and & to HTML-safe sequences.=
+ max_rows : int, optional
+ Maximum number of rows to show before truncating. If None, show all.
+ max_cols : int, optional
+ Maximum number of columns to show before truncating. If None, show
+ all.
"""
@@ -1340,7 +1335,9 @@ def to_html(self, buf=None, columns=None, col_space=None, colSpace=None,
index_names=index_names,
header=header, index=index,
bold_rows=bold_rows,
- escape=escape)
+ escape=escape,
+ max_rows=max_rows, max_cols=max_cols,
+ show_dimensions=show_dimensions)
formatter.to_html(classes=classes)
if buf is None:
@@ -1386,7 +1383,7 @@ def to_latex(self, buf=None, columns=None, col_space=None, colSpace=None,
def info(self, verbose=True, buf=None, max_cols=None):
"""
- Concise summary of a DataFrame, used in __repr__ when very large.
+ Concise summary of a DataFrame.
Parameters
----------
diff --git a/pandas/io/clipboard.py b/pandas/io/clipboard.py
index 51142c9f52655..13135d255d9e2 100644
--- a/pandas/io/clipboard.py
+++ b/pandas/io/clipboard.py
@@ -1,5 +1,5 @@
""" io on the clipboard """
-from pandas import compat, get_option
+from pandas import compat, get_option, DataFrame
from pandas.compat import StringIO
def read_clipboard(**kwargs): # pragma: no cover
@@ -64,5 +64,10 @@ def to_clipboard(obj, excel=None, sep=None, **kwargs): # pragma: no cover
except:
pass
- clipboard_set(str(obj))
+ if isinstance(obj, DataFrame):
+ # str(df) has various unhelpful defaults, like truncation
+ objstr = obj.to_string()
+ else:
+ objstr = str(obj)
+ clipboard_set(objstr)
diff --git a/pandas/io/tests/test_clipboard.py b/pandas/io/tests/test_clipboard.py
index 45b479ebb589e..6ee0afa1c8c07 100644
--- a/pandas/io/tests/test_clipboard.py
+++ b/pandas/io/tests/test_clipboard.py
@@ -7,6 +7,7 @@
from pandas import DataFrame
from pandas import read_clipboard
+from pandas import get_option
from pandas.util import testing as tm
from pandas.util.testing import makeCustomDataframe as mkdf
@@ -33,6 +34,11 @@ def setUpClass(cls):
cls.data['mixed'] = DataFrame({'a': np.arange(1.0, 6.0) + 0.01,
'b': np.arange(1, 6),
'c': list('abcde')})
+ # Test GH-5346
+ max_rows = get_option('display.max_rows')
+ cls.data['longdf'] = mkdf(max_rows+1, 3, data_gen_f=lambda *args: randint(2),
+ c_idx_type='s', r_idx_type='i',
+ c_idx_names=[None], r_idx_names=[None])
cls.data_types = list(cls.data.keys())
@classmethod
diff --git a/pandas/tests/test_format.py b/pandas/tests/test_format.py
index d9bf8adb71298..8e23176e9d005 100644
--- a/pandas/tests/test_format.py
+++ b/pandas/tests/test_format.py
@@ -3,6 +3,7 @@
from pandas.compat import range, zip, lrange, StringIO, PY3, lzip, u
import pandas.compat as compat
+import itertools
import os
import sys
import unittest
@@ -34,6 +35,20 @@ def has_info_repr(df):
r = repr(df)
return r.split('\n')[0].startswith("<class")
+def has_horizontally_truncated_repr(df):
+ r = repr(df)
+ return any(l.strip().endswith('...') for l in r.splitlines())
+
+def has_vertically_truncated_repr(df):
+ r = repr(df)
+ return '..' in r.splitlines()[-3]
+
+def has_truncated_repr(df):
+ return has_horizontally_truncated_repr(df) or has_vertically_truncated_repr(df)
+
+def has_doubly_truncated_repr(df):
+ return has_horizontally_truncated_repr(df) and has_vertically_truncated_repr(df)
+
def has_expanded_repr(df):
r = repr(df)
for line in r.split('\n'):
@@ -113,16 +128,16 @@ def test_repr_truncation(self):
def test_repr_chop_threshold(self):
df = DataFrame([[0.1, 0.5],[0.5, -0.1]])
pd.reset_option("display.chop_threshold") # default None
- self.assertEqual(repr(df), ' 0 1\n0 0.1 0.5\n1 0.5 -0.1')
+ self.assertEqual(repr(df), ' 0 1\n0 0.1 0.5\n1 0.5 -0.1\n\n[2 rows x 2 columns]')
with option_context("display.chop_threshold", 0.2 ):
- self.assertEqual(repr(df), ' 0 1\n0 0.0 0.5\n1 0.5 0.0')
+ self.assertEqual(repr(df), ' 0 1\n0 0.0 0.5\n1 0.5 0.0\n\n[2 rows x 2 columns]')
with option_context("display.chop_threshold", 0.6 ):
- self.assertEqual(repr(df), ' 0 1\n0 0 0\n1 0 0')
+ self.assertEqual(repr(df), ' 0 1\n0 0 0\n1 0 0\n\n[2 rows x 2 columns]')
with option_context("display.chop_threshold", None ):
- self.assertEqual(repr(df), ' 0 1\n0 0.1 0.5\n1 0.5 -0.1')
+ self.assertEqual(repr(df), ' 0 1\n0 0.1 0.5\n1 0.5 -0.1\n\n[2 rows x 2 columns]')
def test_repr_obeys_max_seq_limit(self):
import pandas.core.common as com
@@ -172,19 +187,19 @@ def test_expand_frame_repr(self):
'display.width',20,
'display.max_rows', 20):
with option_context('display.expand_frame_repr', True):
- self.assertFalse(has_info_repr(df_small))
+ self.assertFalse(has_truncated_repr(df_small))
self.assertFalse(has_expanded_repr(df_small))
- self.assertFalse(has_info_repr(df_wide))
+ self.assertFalse(has_truncated_repr(df_wide))
self.assertTrue(has_expanded_repr(df_wide))
- self.assertTrue(has_info_repr(df_tall))
- self.assertFalse(has_expanded_repr(df_tall))
+ self.assertTrue(has_vertically_truncated_repr(df_tall))
+ self.assertTrue(has_expanded_repr(df_tall))
with option_context('display.expand_frame_repr', False):
- self.assertFalse(has_info_repr(df_small))
+ self.assertFalse(has_truncated_repr(df_small))
self.assertFalse(has_expanded_repr(df_small))
- self.assertTrue(has_info_repr(df_wide))
+ self.assertFalse(has_horizontally_truncated_repr(df_wide))
self.assertFalse(has_expanded_repr(df_wide))
- self.assertTrue(has_info_repr(df_tall))
+ self.assertTrue(has_vertically_truncated_repr(df_tall))
self.assertFalse(has_expanded_repr(df_tall))
def test_repr_non_interactive(self):
@@ -196,7 +211,7 @@ def test_repr_non_interactive(self):
'display.width', 0,
'display.height', 0,
'display.max_rows',5000):
- self.assertFalse(has_info_repr(df))
+ self.assertFalse(has_truncated_repr(df))
self.assertFalse(has_expanded_repr(df))
def test_repr_max_columns_max_rows(self):
@@ -218,20 +233,20 @@ def mkframe(n):
self.assertFalse(has_expanded_repr(mkframe(4)))
self.assertFalse(has_expanded_repr(mkframe(5)))
self.assertFalse(has_expanded_repr(df6))
- self.assertTrue(has_info_repr(df6))
+ self.assertTrue(has_doubly_truncated_repr(df6))
with option_context('display.max_rows', 20,
'display.max_columns', 10):
# Out off max_columns boundary, but no extending
# since not exceeding width
self.assertFalse(has_expanded_repr(df6))
- self.assertFalse(has_info_repr(df6))
+ self.assertFalse(has_truncated_repr(df6))
with option_context('display.max_rows', 9,
'display.max_columns', 10):
# out vertical bounds can not result in exanded repr
self.assertFalse(has_expanded_repr(df10))
- self.assertTrue(has_info_repr(df10))
+ self.assertTrue(has_vertically_truncated_repr(df10))
# width=None in terminal, auto detection
with option_context('display.max_columns', 100,
@@ -723,45 +738,6 @@ def test_frame_info_encoding(self):
repr(df.T)
fmt.set_option('display.max_rows', 200)
- def test_large_frame_repr(self):
- def wrap_rows_options(f):
- def _f(*args, **kwargs):
- old_max_rows = pd.get_option('display.max_rows')
- old_max_info_rows = pd.get_option('display.max_info_rows')
- o = f(*args, **kwargs)
- pd.set_option('display.max_rows', old_max_rows)
- pd.set_option('display.max_info_rows', old_max_info_rows)
- return o
- return _f
-
- @wrap_rows_options
- def test_setting(value, nrows=3, ncols=2):
- if value is None:
- expected_difference = 0
- elif isinstance(value, int):
- expected_difference = ncols
- else:
- raise ValueError("'value' must be int or None")
-
- with option_context('mode.sim_interactive', True):
- pd.set_option('display.max_rows', nrows - 1)
- pd.set_option('display.max_info_rows', value)
-
- smallx = DataFrame(np.random.rand(nrows, ncols))
- repr_small = repr(smallx)
-
- bigx = DataFrame(np.random.rand(nrows + 1, ncols))
- repr_big = repr(bigx)
-
- diff = len(repr_small.splitlines()) - len(repr_big.splitlines())
-
- # the difference in line count is the number of columns
- self.assertEqual(diff, expected_difference)
-
- test_setting(None)
- test_setting(3)
- self.assertRaises(ValueError, test_setting, 'string')
-
def test_pprint_thing(self):
import nose
from pandas.core.common import pprint_thing as pp_t
@@ -799,6 +775,8 @@ def test_wide_repr(self):
df = DataFrame([col(max_cols-1, 25) for _ in range(10)])
set_option('display.expand_frame_repr', False)
rep_str = repr(df)
+ print(rep_str)
+ assert "10 rows x %d columns" % (max_cols-1) in rep_str
set_option('display.expand_frame_repr', True)
wide_repr = repr(df)
self.assert_(rep_str != wide_repr)
@@ -814,7 +792,7 @@ def test_wide_repr_wide_columns(self):
df = DataFrame(randn(5, 3), columns=['a' * 90, 'b' * 90, 'c' * 90])
rep_str = repr(df)
- self.assert_(len(rep_str.splitlines()) == 20)
+ self.assertEqual(len(rep_str.splitlines()), 22)
def test_wide_repr_named(self):
with option_context('mode.sim_interactive', True):
@@ -1433,6 +1411,114 @@ def test_repr_html(self):
fmt.reset_option('^display.')
+ def test_repr_html_wide(self):
+ row = lambda l, k: [tm.rands(k) for _ in range(l)]
+ max_cols = get_option('display.max_columns')
+ df = DataFrame([row(max_cols-1, 25) for _ in range(10)])
+ reg_repr = df._repr_html_()
+ assert "..." not in reg_repr
+
+ wide_df = DataFrame([row(max_cols+1, 25) for _ in range(10)])
+ wide_repr = wide_df._repr_html_()
+ assert "..." in wide_repr
+
+ def test_repr_html_wide_multiindex_cols(self):
+ row = lambda l, k: [tm.rands(k) for _ in range(l)]
+ max_cols = get_option('display.max_columns')
+
+ tuples = list(itertools.product(np.arange(max_cols//2), ['foo', 'bar']))
+ mcols = pandas.MultiIndex.from_tuples(tuples, names=['first', 'second'])
+ df = DataFrame([row(len(mcols), 25) for _ in range(10)], columns=mcols)
+ reg_repr = df._repr_html_()
+ assert '...' not in reg_repr
+
+
+ tuples = list(itertools.product(np.arange(1+(max_cols//2)), ['foo', 'bar']))
+ mcols = pandas.MultiIndex.from_tuples(tuples, names=['first', 'second'])
+ df = DataFrame([row(len(mcols), 25) for _ in range(10)], columns=mcols)
+ wide_repr = df._repr_html_()
+ assert '...' in wide_repr
+
+ def test_repr_html_long(self):
+ max_rows = get_option('display.max_rows')
+ h = max_rows - 1
+ df = pandas.DataFrame({'A':np.arange(1,1+h), 'B':np.arange(41, 41+h)})
+ reg_repr = df._repr_html_()
+ assert '...' not in reg_repr
+ assert str(40 + h) in reg_repr
+
+ h = max_rows + 1
+ df = pandas.DataFrame({'A':np.arange(1,1+h), 'B':np.arange(41, 41+h)})
+ long_repr = df._repr_html_()
+ assert '...' in long_repr
+ assert str(40 + h) not in long_repr
+ assert u('%d rows ') % h in long_repr
+ assert u('2 columns') in long_repr
+
+ def test_repr_html_long_multiindex(self):
+ max_rows = get_option('display.max_rows')
+ max_L1 = max_rows//2
+
+ tuples = list(itertools.product(np.arange(max_L1), ['foo', 'bar']))
+ idx = pandas.MultiIndex.from_tuples(tuples, names=['first', 'second'])
+ df = DataFrame(np.random.randn(max_L1*2, 2), index=idx,
+ columns=['A', 'B'])
+ reg_repr = df._repr_html_()
+ assert '...' not in reg_repr
+
+ tuples = list(itertools.product(np.arange(max_L1+1), ['foo', 'bar']))
+ idx = pandas.MultiIndex.from_tuples(tuples, names=['first', 'second'])
+ df = DataFrame(np.random.randn((max_L1+1)*2, 2), index=idx,
+ columns=['A', 'B'])
+ long_repr = df._repr_html_()
+ assert '...' in long_repr
+
+ def test_repr_html_long_and_wide(self):
+ max_cols = get_option('display.max_columns')
+ max_rows = get_option('display.max_rows')
+
+ h, w = max_rows-1, max_cols-1
+ df = pandas.DataFrame(dict((k,np.arange(1,1+h)) for k in np.arange(w)))
+ assert '...' not in df._repr_html_()
+
+ h, w = max_rows+1, max_cols+1
+ df = pandas.DataFrame(dict((k,np.arange(1,1+h)) for k in np.arange(w)))
+ assert '...' in df._repr_html_()
+
+ def test_info_repr(self):
+ max_rows = get_option('display.max_rows')
+ max_cols = get_option('display.max_columns')
+ # Long
+ h, w = max_rows+1, max_cols-1
+ df = pandas.DataFrame(dict((k,np.arange(1,1+h)) for k in np.arange(w)))
+ assert has_vertically_truncated_repr(df)
+ with option_context('display.large_repr', 'info'):
+ assert has_info_repr(df)
+
+ # Wide
+ h, w = max_rows-1, max_cols+1
+ df = pandas.DataFrame(dict((k,np.arange(1,1+h)) for k in np.arange(w)))
+ assert has_vertically_truncated_repr(df)
+ with option_context('display.large_repr', 'info'):
+ assert has_info_repr(df)
+
+ def test_info_repr_html(self):
+ max_rows = get_option('display.max_rows')
+ max_cols = get_option('display.max_columns')
+ # Long
+ h, w = max_rows+1, max_cols-1
+ df = pandas.DataFrame(dict((k,np.arange(1,1+h)) for k in np.arange(w)))
+ assert '<class' not in df._repr_html_()
+ with option_context('display.large_repr', 'info'):
+ assert '<class' in df._repr_html_()
+
+ # Wide
+ h, w = max_rows-1, max_cols+1
+ df = pandas.DataFrame(dict((k,np.arange(1,1+h)) for k in np.arange(w)))
+ assert '<class' not in df._repr_html_()
+ with option_context('display.large_repr', 'info'):
+ assert '<class' in df._repr_html_()
+
def test_fake_qtconsole_repr_html(self):
def get_ipython():
return {'config':
@@ -1483,7 +1569,7 @@ def test_float_trim_zeros(self):
vals = [2.08430917305e+10, 3.52205017305e+10, 2.30674817305e+10,
2.03954217305e+10, 5.59897817305e+10]
skip = True
- for line in repr(DataFrame({'A': vals})).split('\n'):
+ for line in repr(DataFrame({'A': vals})).split('\n')[:-2]:
if line.startswith('dtype:'):
continue
if _three_digit_exp():
| As discussed in #4886, the HTML representation of DataFrames currently starts off as a table, but switches to the condensed info view if the table exceeds a certain size (by default, more than 60 rows or 20 columns). I've seen this confusing users, who think that they suddenly have a completely different kind of object, and don't understand why.
With these changes, the HTML repr always displays the table, but truncates it when it exceeds a certain size. It reuses the same options, `display.max_rows` and `display.max_columns`.
Before:


After:


| https://api.github.com/repos/pandas-dev/pandas/pulls/5550 | 2013-11-19T19:49:46Z | 2013-11-26T01:04:01Z | 2013-11-26T01:04:01Z | 2014-06-12T17:07:25Z |
DOC: mention new to_clipboard/paste into excel capability in release docs | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 4a4726c78a677..6ba31fbc61a05 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -57,6 +57,8 @@ New features
the bandwidth, and to gkde.evaluate() to specify the indicies at which it
is evaluated, respecttively. See scipy docs. (:issue:`4298`)
- Added ``isin`` method to DataFrame (:issue:`4211`)
+ - ``df.to_clipboard()`` learned a new ``excel`` keyword that let's you
+ paste df data directly into excel (enabled by default). (:issue:`5070`).
- Clipboard functionality now works with PySide (:issue:`4282`)
- New ``extract`` string method returns regex matches more conveniently
(:issue:`4685`)
diff --git a/doc/source/v0.13.0.txt b/doc/source/v0.13.0.txt
index 70fc0572ad8fb..6e908ce739a1d 100644
--- a/doc/source/v0.13.0.txt
+++ b/doc/source/v0.13.0.txt
@@ -378,6 +378,8 @@ HDFStore API Changes
Enhancements
~~~~~~~~~~~~
+- ``df.to_clipboard()`` learned a new ``excel`` keyword that let's you
+ paste df data directly into excel (enabled by default). (:issue:`5070`).
- ``read_html`` now raises a ``URLError`` instead of catching and raising a
``ValueError`` (:issue:`4303`, :issue:`4305`)
- Added a test for ``read_clipboard()`` and ``to_clipboard()`` (:issue:`4282`)
| https://api.github.com/repos/pandas-dev/pandas/pulls/5548 | 2013-11-19T11:52:13Z | 2013-11-19T11:52:30Z | 2013-11-19T11:52:30Z | 2014-07-16T08:40:50Z | |
DOC: Fixing a good number of spelling mistakes in 0.13 release notes | diff --git a/doc/source/v0.13.0.txt b/doc/source/v0.13.0.txt
index 70fc0572ad8fb..2d01f1fb49942 100644
--- a/doc/source/v0.13.0.txt
+++ b/doc/source/v0.13.0.txt
@@ -49,10 +49,10 @@ API changes
index = index.set_levels([[1, 2, 3, 4], [1, 2, 4, 4]])
# similarly, for names, you can rename the object
- # but setting names is not deprecated.
+ # but setting names is not deprecated
index = index.set_names(["bob", "cranberry"])
- # and all methods take an inplace kwarg - but returns None
+ # and all methods take an inplace kwarg - but return None
index.set_names(["bob", "cranberry"], inplace=True)
- **All** division with ``NDFrame`` - likes is now truedivision, regardless
@@ -80,7 +80,7 @@ API changes
- ``__nonzero__`` for all NDFrame objects, will now raise a ``ValueError``, this reverts back to (:issue:`1073`, :issue:`4633`)
behavior. See :ref:`gotchas<gotchas.truth>` for a more detailed discussion.
- This prevents doing boolean comparision on *entire* pandas objects, which is inherently ambiguous. These all will raise a ``ValueError``.
+ This prevents doing boolean comparison on *entire* pandas objects, which is inherently ambiguous. These all will raise a ``ValueError``.
.. code-block:: python
@@ -106,7 +106,7 @@ API changes
statistical mode(s) by axis/Series. (:issue:`5367`)
- Chained assignment will now by default warn if the user is assigning to a copy. This can be changed
- with he option ``mode.chained_assignment``, allowed options are ``raise/warn/None``. See :ref:`the docs<indexing.view_versus_copy>`.
+ with the option ``mode.chained_assignment``, allowed options are ``raise/warn/None``. See :ref:`the docs<indexing.view_versus_copy>`.
.. ipython:: python
@@ -158,7 +158,7 @@ Deprecated in 0.13.0
of ``match`` will change to become analogous to ``contains``, which returns
a boolean indexer. (Their
distinction is strictness: ``match`` relies on ``re.match`` while
- ``contains`` relies on ``re.serach``.) In this release, the deprecated
+ ``contains`` relies on ``re.search``.) In this release, the deprecated
behavior is the default, but the new behavior is available through the
keyword argument ``as_indexer=True``.
@@ -310,8 +310,8 @@ HDFStore API Changes
os.remove(path)
- the ``format`` keyword now replaces the ``table`` keyword; allowed values are ``fixed(f)`` or ``table(t)``
- the same defaults as prior < 0.13.0 remain, e.g. ``put`` implies ``fixed`` format
- and ``append`` imples ``table`` format. This default format can be set as an option by setting ``io.hdf.default_format``.
+ the same defaults as prior < 0.13.0 remain, e.g. ``put`` implies ``fixed`` format and ``append`` implies
+ ``table`` format. This default format can be set as an option by setting ``io.hdf.default_format``.
.. ipython:: python
@@ -443,7 +443,7 @@ Enhancements
td * -1
td * Series([1,2,3,4])
- Absolute ``DateOffset`` objects can act equivalenty to ``timedeltas``
+ Absolute ``DateOffset`` objects can act equivalently to ``timedeltas``
.. ipython:: python
@@ -467,8 +467,8 @@ Enhancements
- ``plot(kind='kde')`` now accepts the optional parameters ``bw_method`` and
``ind``, passed to scipy.stats.gaussian_kde() (for scipy >= 0.11.0) to set
- the bandwidth, and to gkde.evaluate() to specify the indicies at which it
- is evaluated, respecttively. See scipy docs. (:issue:`4298`)
+ the bandwidth, and to gkde.evaluate() to specify the indices at which it
+ is evaluated, respectively. See scipy docs. (:issue:`4298`)
- DataFrame constructor now accepts a numpy masked record array (:issue:`3478`)
@@ -752,7 +752,7 @@ Experimental
df3 = pandas.concat([df2.min(), df2.mean(), df2.max()],
axis=1,keys=["Min Tem", "Mean Temp", "Max Temp"])
- The resulting dataframe is::
+ The resulting DataFrame is::
> df3
Min Tem Mean Temp Max Temp
@@ -842,7 +842,7 @@ to unify methods and behaviors. Series formerly subclassed directly from
- ``swapaxes`` on a ``Panel`` with the same axes specified now return a copy
- support attribute access for setting
- - filter supports same api as original ``DataFrame`` filter
+ - filter supports the same API as the original ``DataFrame`` filter
- Reindex called with no arguments will now return a copy of the input object
@@ -870,11 +870,11 @@ to unify methods and behaviors. Series formerly subclassed directly from
- enable setitem on ``SparseSeries`` for boolean/integer/slices
- ``SparsePanels`` implementation is unchanged (e.g. not using BlockManager, needs work)
-- added ``ftypes`` method to Series/DataFame, similar to ``dtypes``, but indicates
+- added ``ftypes`` method to Series/DataFrame, similar to ``dtypes``, but indicates
if the underlying is sparse/dense (as well as the dtype)
-- All ``NDFrame`` objects now have a ``_prop_attributes``, which can be used to indcated various
- values to propogate to a new object from an existing (e.g. name in ``Series`` will follow
- more automatically now)
+- All ``NDFrame`` objects can now use ``__finalize__()`` to specify various
+ values to propagate to new objects from an existing one (e.g. ``name`` in ``Series`` will
+ follow more automatically now)
- Internal type checking is now done via a suite of generated classes, allowing ``isinstance(value, klass)``
without having to directly import the klass, courtesy of @jtratner
- Bug in Series update where the parent frame is not updating its cache based on
@@ -886,7 +886,7 @@ to unify methods and behaviors. Series formerly subclassed directly from
- Refactor ``rename`` methods to core/generic.py; fixes ``Series.rename`` for (:issue:`4605`), and adds ``rename``
with the same signature for ``Panel``
- Refactor ``clip`` methods to core/generic.py (:issue:`4798`)
-- Refactor of ``_get_numeric_data/_get_bool_data`` to core/generic.py, allowing Series/Panel functionaility
+- Refactor of ``_get_numeric_data/_get_bool_data`` to core/generic.py, allowing Series/Panel functionality
- ``Series`` (for index) / ``Panel`` (for items) now allow attribute access to its elements (:issue:`1903`)
.. ipython:: python
| https://api.github.com/repos/pandas-dev/pandas/pulls/5547 | 2013-11-19T10:58:32Z | 2013-11-19T23:36:10Z | 2013-11-19T23:36:10Z | 2014-07-16T08:40:49Z | |
BUG: Bug in delitem on a Series (GH5542) | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 8d39db39ad4a6..4a4726c78a677 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -809,6 +809,7 @@ Bug Fixes
- Fixed various setitem with 1d ndarray that does not have a matching
length to the indexer (:issue:`5508`)
- Bug in getitem with a multi-index and ``iloc`` (:issue:`5528`)
+ - Bug in delitem on a Series (:issue:`5542`)
pandas 0.12.0
-------------
diff --git a/pandas/core/internals.py b/pandas/core/internals.py
index 44a18ef3043b3..79667ecddc8a6 100644
--- a/pandas/core/internals.py
+++ b/pandas/core/internals.py
@@ -1969,7 +1969,7 @@ def ndim(self):
self._ndim = len(self.axes)
return self._ndim
- def set_axis(self, axis, value, maybe_rename=True, check_axis=True):
+ def _set_axis(self, axis, value, check_axis=True):
cur_axis = self.axes[axis]
value = _ensure_index(value)
@@ -1980,6 +1980,10 @@ def set_axis(self, axis, value, maybe_rename=True, check_axis=True):
self.axes[axis] = value
self._shape = None
+ return cur_axis, value
+
+ def set_axis(self, axis, value, maybe_rename=True, check_axis=True):
+ cur_axis, value = self._set_axis(axis, value, check_axis)
if axis == 0:
@@ -3473,24 +3477,22 @@ def reindex_axis0_with_method(self, new_axis, indexer=None, method=None,
return self.reindex(new_axis, indexer=indexer, method=method,
fill_value=fill_value, limit=limit, copy=copy)
+ def _delete_from_block(self, i, item):
+ super(SingleBlockManager, self)._delete_from_block(i, item)
+
+ # reset our state
+ self._block = self.blocks[0] if len(self.blocks) else make_block(np.array([],dtype=self._block.dtype),[],[])
+ self._values = self._block.values
+
def get_slice(self, slobj, raise_on_error=False):
if raise_on_error:
_check_slice_bounds(slobj, self.index)
return self.__class__(self._block._slice(slobj),
self.index._getitem_slice(slobj), fastpath=True)
- def set_axis(self, axis, value):
- cur_axis = self.axes[axis]
- value = _ensure_index(value)
-
- if len(value) != len(cur_axis):
- raise ValueError('Length mismatch: Expected axis has %d elements, '
- 'new values have %d elements' % (len(cur_axis),
- len(value)))
-
- self.axes[axis] = value
- self._shape = None
- self._block.set_ref_items(self.items, maybe_rename=True)
+ def set_axis(self, axis, value, maybe_rename=True, check_axis=True):
+ cur_axis, value = self._set_axis(axis, value, check_axis)
+ self._block.set_ref_items(self.items, maybe_rename=maybe_rename)
def set_ref_items(self, ref_items, maybe_rename=True):
""" we can optimize and our ref_locs are always equal to ref_items """
diff --git a/pandas/tests/test_series.py b/pandas/tests/test_series.py
index b6f0387835c22..c44ede057adb2 100644
--- a/pandas/tests/test_series.py
+++ b/pandas/tests/test_series.py
@@ -113,6 +113,35 @@ def test_combine_first_dt64(self):
xp = Series([datetime(2010, 1, 1), '2011'])
assert_series_equal(rs, xp)
+ def test_delitem(self):
+
+ # GH 5542
+ # should delete the item inplace
+ s = Series(lrange(5))
+ del s[0]
+
+ expected = Series(lrange(1,5),index=lrange(1,5))
+ assert_series_equal(s, expected)
+
+ del s[1]
+ expected = Series(lrange(2,5),index=lrange(2,5))
+ assert_series_equal(s, expected)
+
+ # empty
+ s = Series()
+ def f():
+ del s[0]
+ self.assertRaises(KeyError, f)
+
+ # only 1 left, del, add, del
+ s = Series(1)
+ del s[0]
+ assert_series_equal(s, Series(dtype='int64'))
+ s[0] = 1
+ assert_series_equal(s, Series(1))
+ del s[0]
+ assert_series_equal(s, Series(dtype='int64'))
+
def test_getitem_preserve_name(self):
result = self.ts[self.ts > 0]
self.assertEquals(result.name, self.ts.name)
| closes #5542
| https://api.github.com/repos/pandas-dev/pandas/pulls/5544 | 2013-11-19T01:00:56Z | 2013-11-19T01:49:54Z | 2013-11-19T01:49:54Z | 2014-06-23T11:03:02Z |
TST: fix cumcount test on 32-bit env | diff --git a/pandas/tests/test_groupby.py b/pandas/tests/test_groupby.py
index 9df5541615cee..da20dadb062fc 100644
--- a/pandas/tests/test_groupby.py
+++ b/pandas/tests/test_groupby.py
@@ -2574,7 +2574,7 @@ def test_cumcount_empty(self):
ge = DataFrame().groupby()
se = Series().groupby()
- e = Series(dtype='int') # edge case, as this is usually considered float
+ e = Series(dtype='int64') # edge case, as this is usually considered float
assert_series_equal(e, ge.cumcount())
assert_series_equal(e, se.cumcount())
| Fix `test_groupby.test_cumcount_empty()` on 32-bit platforms by specifying expected dtype of 'int64'.
```
======================================================================
FAIL: test_cumcount_empty (pandas.tests.test_groupby.TestGroupBy)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/gmd/github_shadow/pandas/pandas/tests/test_groupby.py", line 2579, in test_cumcount_empty
assert_series_equal(e, ge.cumcount())
File "/home/gmd/github_shadow/pandas/pandas/util/testing.py", line 423, in assert_series_equal
assert_attr_equal('dtype', left, right)
File "/home/gmd/github_shadow/pandas/pandas/util/testing.py", line 407, in assert_attr_equal
assert_equal(left_attr,right_attr,"attr is not equal [{0}]" .format(attr))
File "/home/gmd/github_shadow/pandas/pandas/util/testing.py", line 390, in assert_equal
assert a == b, "%s: %r != %r" % (msg.format(a,b), a, b)
AssertionError: attr is not equal [dtype]: dtype('int32') != dtype('int64')
```
| https://api.github.com/repos/pandas-dev/pandas/pulls/5540 | 2013-11-18T01:29:16Z | 2013-11-18T01:48:18Z | 2013-11-18T01:48:18Z | 2014-06-12T16:56:31Z |
TST: correctly predict locale setability | diff --git a/pandas/tools/tests/test_util.py b/pandas/tools/tests/test_util.py
index 614f5ecc39e9d..66ae52983b692 100644
--- a/pandas/tools/tests/test_util.py
+++ b/pandas/tools/tests/test_util.py
@@ -65,7 +65,7 @@ def test_set_locale(self):
enc = codecs.lookup(enc).name
new_locale = lang, enc
- if not tm._can_set_locale('.'.join(new_locale)):
+ if not tm._can_set_locale(new_locale):
with tm.assertRaises(locale.Error):
with tm.set_locale(new_locale):
pass
| Don't join the lang and encoding when performing the trial set, because
```
locale.setlocale(locale.LC_ALL, ('it_CH', 'utf-8'))
```
succeeds, but
```
locale.setlocale(locale.LC_ALL, 'it_CH.utf-8')
```
throws locale.Error.
Closes #5537.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5538 | 2013-11-17T14:24:40Z | 2013-11-17T15:00:14Z | 2013-11-17T15:00:14Z | 2014-06-19T22:50:55Z |
ENH nlargest and nsmallest Series methods | diff --git a/doc/source/v0.13.1.txt b/doc/source/v0.13.1.txt
index b48f555f9691a..557abfc48a023 100644
--- a/doc/source/v0.13.1.txt
+++ b/doc/source/v0.13.1.txt
@@ -128,6 +128,7 @@ API changes
import pandas.core.common as com
com.array_equivalent(np.array([0, np.nan]), np.array([0, np.nan]))
np.array_equal(np.array([0, np.nan]), np.array([0, np.nan]))
+- Add nsmallest and nlargest Series methods (:issue:`3960`)
- ``DataFrame.apply`` will use the ``reduce`` argument to determine whether a
``Series`` or a ``DataFrame`` should be returned when the ``DataFrame`` is
diff --git a/pandas/algos.pyx b/pandas/algos.pyx
index 27e25c3954dad..71d7b41647564 100644
--- a/pandas/algos.pyx
+++ b/pandas/algos.pyx
@@ -752,6 +752,8 @@ def kth_smallest(ndarray[double_t] a, Py_ssize_t k):
if k < i: m = j
return a[k]
+kth_smallest_float64 = kth_smallest
+
cdef inline kth_smallest_c(float64_t* a, Py_ssize_t k, Py_ssize_t n):
cdef:
Py_ssize_t i,j,l,m
@@ -779,6 +781,35 @@ cdef inline kth_smallest_c(float64_t* a, Py_ssize_t k, Py_ssize_t n):
if k < i: m = j
return a[k]
+def kth_smallest_int64(ndarray[int64_t] a, Py_ssize_t k):
+ cdef:
+ Py_ssize_t i,j,l,m,n
+ int64_t x, t
+
+ n = len(a)
+
+ l = 0
+ m = n-1
+ while (l<m):
+ x = a[k]
+ i = l
+ j = m
+
+ while 1:
+ while a[i] < x: i += 1
+ while x < a[j]: j -= 1
+ if i <= j:
+ t = a[i]
+ a[i] = a[j]
+ a[j] = t
+ i += 1; j -= 1
+
+ if i > j: break
+
+ if j < k: l = i
+ if k < i: m = j
+ return a[k]
+
def median(ndarray arr):
'''
diff --git a/pandas/core/series.py b/pandas/core/series.py
index 70b73c56772aa..73a5ebce01d01 100644
--- a/pandas/core/series.py
+++ b/pandas/core/series.py
@@ -35,7 +35,9 @@
from pandas.core.categorical import Categorical
from pandas.tseries.index import DatetimeIndex
from pandas.tseries.period import PeriodIndex, Period
+from pandas.tseries.tools import to_datetime
from pandas import compat
+from pandas import algos as _algos
from pandas.util.terminal import get_terminal_size
from pandas.compat import zip, lzip, u, OrderedDict
@@ -1740,7 +1742,17 @@ def _try_kind_sort(arr):
good = -bad
idx = pa.arange(len(self))
- argsorted = _try_kind_sort(arr[good])
+ def _try_kind_sort(arr, kind='mergesort'):
+ # easier to ask forgiveness than permission
+ try:
+ # if kind==mergesort, it can fail for object dtype
+ return arr.argsort(kind=kind)
+ except TypeError:
+ # stable sort not available for object dtype
+ # uses the argsort default quicksort
+ return arr.argsort(kind='quicksort')
+
+ argsorted = _try_kind_sort(arr[good], kind=kind)
if not ascending:
argsorted = argsorted[::-1]
@@ -1758,6 +1770,51 @@ def _try_kind_sort(arr):
return self._constructor(arr[sortedIdx], index=self.index[sortedIdx])\
.__finalize__(self)
+ def nlargest(self, n=5, take_last=False):
+ '''
+ Returns the largest n rows:
+
+ May be faster than .order(ascending=False).head(n).
+
+ '''
+ # TODO remove need for dropna ?
+ dropped = self.dropna()
+
+ from pandas.tools.util import nlargest
+
+ if dropped.dtype == object:
+ try:
+ dropped = dropped.astype(float)
+ except (NotImplementedError, TypeError):
+ return dropped.order(ascending=False).head(n)
+
+ inds = nlargest(dropped.values, n, take_last)
+ if len(inds) == 0:
+ # TODO remove this special case
+ return dropped[[]]
+ return dropped.iloc[inds]
+
+ def nsmallest(self, n=5, take_last=False):
+ '''
+ Returns the smallest n rows.
+
+ May be faster than .order().head(n).
+
+ '''
+ # TODO remove need for dropna ?
+ dropped = self.dropna()
+
+ from pandas.tools.util import nsmallest
+ try:
+ inds = nsmallest(dropped.values, n, take_last)
+ except NotImplementedError:
+ return dropped.order().head(n)
+
+ if len(inds) == 0:
+ # TODO remove this special case
+ return dropped[[]]
+ return dropped.iloc[inds]
+
def sortlevel(self, level=0, ascending=True):
"""
Sort Series with MultiIndex by chosen level. Data will be
diff --git a/pandas/tests/test_series.py b/pandas/tests/test_series.py
index 5b088598dfcec..27a6281510e59 100644
--- a/pandas/tests/test_series.py
+++ b/pandas/tests/test_series.py
@@ -3956,6 +3956,39 @@ def test_order(self):
ordered = ts.order(ascending=False, na_position='first')
assert_almost_equal(expected, ordered.valid().values)
+ def test_nsmallest_nlargest(self):
+ # float, int, datetime64 (use i8), timedelts64 (same),
+ # object that are numbers, object that are strings
+
+ s_list = [Series([3, 2, 1, 2, 5]),
+ Series([3., 2., 1., 2., 5.]),
+ Series([3., 2, 1, 2, 5], dtype='object'),
+ Series([3., 2, 1, 2, '5'], dtype='object'),
+ Series(pd.to_datetime(['2003', '2002', '2001', '2002', '2005']))]
+
+ for s in s_list:
+
+ assert_series_equal(s.nsmallest(2), s.iloc[[2, 1]])
+ assert_series_equal(s.nsmallest(2, take_last=True), s.iloc[[2, 3]])
+
+ assert_series_equal(s.nlargest(3), s.iloc[[4, 0, 1]])
+ assert_series_equal(s.nlargest(3, take_last=True), s.iloc[[4, 0, 3]])
+
+ empty = s.iloc[0:0]
+ assert_series_equal(s.nsmallest(0), empty)
+ assert_series_equal(s.nsmallest(-1), empty)
+ assert_series_equal(s.nlargest(0), empty)
+ assert_series_equal(s.nlargest(-1), empty)
+
+ assert_series_equal(s.nsmallest(len(s)), s.order())
+ assert_series_equal(s.nsmallest(len(s) + 1), s.order())
+ assert_series_equal(s.nlargest(len(s)), s.iloc[[4, 0, 1, 3, 2]])
+ assert_series_equal(s.nlargest(len(s) + 1), s.iloc[[4, 0, 1, 3, 2]])
+
+ s = Series([3., np.nan, 1, 2, 5])
+ assert_series_equal(s.nlargest(), s.iloc[[4, 0, 3, 2]])
+ assert_series_equal(s.nsmallest(), s.iloc[[2, 3, 0, 4]])
+
def test_rank(self):
from pandas.compat.scipy import rankdata
diff --git a/pandas/tools/util.py b/pandas/tools/util.py
index 6dbefc4b70930..60bbd68a8ac08 100644
--- a/pandas/tools/util.py
+++ b/pandas/tools/util.py
@@ -1,6 +1,9 @@
from pandas.compat import reduce
from pandas.core.index import Index
import numpy as np
+from pandas import algos
+import pandas.core.common as com
+
def match(needles, haystack):
haystack = Index(haystack)
@@ -17,7 +20,7 @@ def cartesian_product(X):
--------
>>> cartesian_product([list('ABC'), [1, 2]])
[array(['A', 'A', 'B', 'B', 'C', 'C'], dtype='|S1'),
- array([1, 2, 1, 2, 1, 2])]
+ array([1, 2, 1, 2, 1, 2])]
'''
@@ -43,3 +46,76 @@ def compose(*funcs):
"""Compose 2 or more callables"""
assert len(funcs) > 1, 'At least 2 callables must be passed to compose'
return reduce(_compose2, funcs)
+
+
+def nsmallest(arr, n=5, take_last=False):
+ '''
+ Find the indices of the n smallest values of a numpy array.
+
+ Note: Fails silently with NaN.
+
+ '''
+ if n <= 0:
+ return np.array([]) # empty
+ elif n >= len(arr):
+ n = len(arr)
+
+ if arr.dtype == object:
+ # just sort and take n
+ return arr.argsort(kind='mergesort')[:n]
+
+ if com.needs_i8_conversion(arr):
+ dtype = 'i8'
+ kth_s = algos.kth_smallest_int64
+ elif arr.dtype in ['int64']:
+ dtype = 'int64'
+ kth_s = algos.kth_smallest_int64
+ elif arr.dtype in ['float64']:
+ dtype = 'float64'
+ kth_s = algos.kth_smallest_float64
+ else:
+ raise NotImplementedError("Not implemented for %s dtype, "
+ "perhaps convert to int64 or float64, "
+ "or use .order().head(n)") % arr.dtype
+
+ if take_last:
+ arr = arr.view(dtype)[::-1]
+ else:
+ arr = arr.view(dtype)
+
+ kth_val = kth_s(arr.copy(), n - 1)
+
+ ns = np.nonzero(arr <= kth_val)[0]
+ inds = ns[arr[ns].argsort(kind='mergesort')][:n]
+
+ if take_last:
+ # reverse indices
+ return len(arr) - 1 - inds
+ else:
+ return inds
+
+
+def nlargest(arr, n=5, take_last=False):
+ '''
+ Find the indices of the n largest values of a numpy array.
+
+ Note: Fails silently with NaN.
+
+ '''
+ if n <= 0:
+ return np.array([]) # empty
+ elif n >= len(arr):
+ n = len(arr)
+
+ if arr.dtype == object:
+ try:
+ arr = arr.astype(float)
+ except:
+ raise TypeError("An object array must convert to float.")
+
+ if com.needs_i8_conversion(arr):
+ arr = -arr.view('i8')
+ else:
+ arr = -arr
+
+ return nsmallest(arr, n, take_last=take_last)
diff --git a/vb_suite/series_methods.py b/vb_suite/series_methods.py
new file mode 100644
index 0000000000000..1659340cfe050
--- /dev/null
+++ b/vb_suite/series_methods.py
@@ -0,0 +1,29 @@
+from vbench.api import Benchmark
+from datetime import datetime
+
+common_setup = """from pandas_vb_common import *
+"""
+
+setup = common_setup + """
+s1 = Series(np.random.randn(10000))
+s2 = Series(np.random.randint(1, 10, 10000))
+"""
+
+series_nlargest1 = Benchmark('s1.nlargest(3, take_last=True);'
+ 's1.nlargest(3, take_last=False)',
+ setup,
+ start_date=datetime(2014, 1, 25))
+series_nlargest2 = Benchmark('s2.nlargest(3, take_last=True);'
+ 's2.nlargest(3, take_last=False)',
+ setup,
+ start_date=datetime(2014, 1, 25))
+
+series_nsmallest2 = Benchmark('s1.nsmallest(3, take_last=True);'
+ 's1.nsmallest(3, take_last=False)',
+ setup,
+ start_date=datetime(2014, 1, 25))
+
+series_nsmallest2 = Benchmark('s2.nsmallest(3, take_last=True);'
+ 's2.nsmallest(3, take_last=False)',
+ setup,
+ start_date=datetime(2014, 1, 25))
| closes #3960.
_Implemented using kth_largest, could cython using better algo later._
| https://api.github.com/repos/pandas-dev/pandas/pulls/5534 | 2013-11-17T10:10:29Z | 2014-05-13T14:29:21Z | null | 2014-06-16T20:51:36Z |
PERF faster head, tail and size groupby methods | diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py
index e763700d08cf4..20f17a7f42472 100644
--- a/pandas/core/groupby.py
+++ b/pandas/core/groupby.py
@@ -52,7 +52,6 @@
_apply_whitelist = frozenset(['last', 'first',
'mean', 'sum', 'min', 'max',
- 'head', 'tail',
'cumsum', 'cumprod', 'cummin', 'cummax',
'resample',
'describe',
@@ -482,13 +481,19 @@ def picker(arr):
return np.nan
return self.agg(picker)
- def cumcount(self):
- """Number each item in each group from 0 to the length of that group.
+ def cumcount(self, **kwargs):
+ """
+ Number each item in each group from 0 to the length of that group - 1.
Essentially this is equivalent to
>>> self.apply(lambda x: Series(np.arange(len(x)), x.index))
+ Parameters
+ ----------
+ ascending : bool, default True
+ If False, number in reverse, from length of group - 1 to 0.
+
Example
-------
@@ -510,14 +515,111 @@ def cumcount(self):
4 1
5 3
dtype: int64
+ >>> df.groupby('A').cumcount(ascending=False)
+ 0 3
+ 1 2
+ 2 1
+ 3 1
+ 4 0
+ 5 0
+ dtype: int64
"""
+ ascending = kwargs.pop('ascending', True)
+
index = self.obj.index
- cumcounts = np.zeros(len(index), dtype='int64')
- for v in self.indices.values():
- cumcounts[v] = np.arange(len(v), dtype='int64')
+ rng = np.arange(self.grouper._max_groupsize, dtype='int64')
+ cumcounts = self._cumcount_array(rng, ascending=ascending)
return Series(cumcounts, index)
+ def head(self, n=5):
+ """
+ Returns first n rows of each group.
+
+ Essentially equivalent to ``.apply(lambda x: x.head(n))``
+
+ Example
+ -------
+
+ >>> df = DataFrame([[1, 2], [1, 4], [5, 6]],
+ columns=['A', 'B'])
+ >>> df.groupby('A', as_index=False).head(1)
+ A B
+ 0 1 2
+ 2 5 6
+ >>> df.groupby('A').head(1)
+ A B
+ A
+ 1 0 1 2
+ 5 2 5 6
+
+ """
+ rng = np.arange(self.grouper._max_groupsize, dtype='int64')
+ in_head = self._cumcount_array(rng) < n
+ head = self.obj[in_head]
+ if self.as_index:
+ head.index = self._index_with_as_index(in_head)
+ return head
+
+ def tail(self, n=5):
+ """
+ Returns last n rows of each group
+
+ Essentially equivalent to ``.apply(lambda x: x.tail(n))``
+
+ Example
+ -------
+
+ >>> df = DataFrame([[1, 2], [1, 4], [5, 6]],
+ columns=['A', 'B'])
+ >>> df.groupby('A', as_index=False).tail(1)
+ A B
+ 0 1 2
+ 2 5 6
+ >>> df.groupby('A').head(1)
+ A B
+ A
+ 1 0 1 2
+ 5 2 5 6
+
+ """
+ rng = np.arange(0, -self.grouper._max_groupsize, -1, dtype='int64')
+ in_tail = self._cumcount_array(rng, ascending=False) > -n
+ tail = self.obj[in_tail]
+ if self.as_index:
+ tail.index = self._index_with_as_index(in_tail)
+ return tail
+
+ def _cumcount_array(self, arr, **kwargs):
+ ascending = kwargs.pop('ascending', True)
+
+ len_index = len(self.obj.index)
+ cumcounts = np.zeros(len_index, dtype='int64')
+ if ascending:
+ for v in self.indices.values():
+ cumcounts[v] = arr[:len(v)]
+ else:
+ for v in self.indices.values():
+ cumcounts[v] = arr[len(v)-1::-1]
+ return cumcounts
+
+ def _index_with_as_index(self, b):
+ """
+ Take boolean mask of index to be returned from apply, if as_index=True
+
+ """
+ # TODO perf, it feels like this should already be somewhere...
+ from itertools import chain
+ original = self.obj.index
+ gp = self.grouper
+ levels = chain((gp.levels[i][gp.labels[i][b]]
+ for i in range(len(gp.groupings))),
+ (original.get_level_values(i)[b]
+ for i in range(original.nlevels)))
+ new = MultiIndex.from_arrays(list(levels))
+ new.names = gp.names + original.names
+ return new
+
def _try_cast(self, result, obj):
"""
try to cast the result to our obj original type,
@@ -758,14 +860,28 @@ def names(self):
def size(self):
"""
Compute group sizes
+
"""
# TODO: better impl
labels, _, ngroups = self.group_info
- bin_counts = Series(labels).value_counts()
+ bin_counts = algos.value_counts(labels, sort=False)
bin_counts = bin_counts.reindex(np.arange(ngroups))
bin_counts.index = self.result_index
return bin_counts
+ @cache_readonly
+ def _max_groupsize(self):
+ '''
+ Compute size of largest group
+
+ '''
+ # For many items in each group this is much faster than
+ # self.size().max(), in worst case marginally slower
+ if self.indices:
+ return max(len(v) for v in self.indices.values())
+ else:
+ return 0
+
@cache_readonly
def groups(self):
if len(self.groupings) == 1:
diff --git a/pandas/tests/test_groupby.py b/pandas/tests/test_groupby.py
index 9df5541615cee..9c636168114c7 100644
--- a/pandas/tests/test_groupby.py
+++ b/pandas/tests/test_groupby.py
@@ -1203,24 +1203,64 @@ def test_groupby_as_index_apply(self):
g_not_as = df.groupby('user_id', as_index=False)
res_as = g_as.head(2).index
- exp_as = MultiIndex.from_tuples([(1, 0), (1, 2), (2, 1), (3, 4)])
+ exp_as = MultiIndex.from_tuples([(1, 0), (2, 1), (1, 2), (3, 4)])
assert_index_equal(res_as, exp_as)
res_not_as = g_not_as.head(2).index
- exp_not_as = Index([0, 2, 1, 4])
+ exp_not_as = Index([0, 1, 2, 4])
assert_index_equal(res_not_as, exp_not_as)
- res_as = g_as.apply(lambda x: x.head(2)).index
- assert_index_equal(res_not_as, exp_not_as)
+ res_as_apply = g_as.apply(lambda x: x.head(2)).index
+ res_not_as_apply = g_not_as.apply(lambda x: x.head(2)).index
- res_not_as = g_not_as.apply(lambda x: x.head(2)).index
- assert_index_equal(res_not_as, exp_not_as)
+ # apply doesn't maintain the original ordering
+ exp_not_as_apply = Index([0, 2, 1, 4])
+ exp_as_apply = MultiIndex.from_tuples([(1, 0), (1, 2), (2, 1), (3, 4)])
+
+ assert_index_equal(res_as_apply, exp_as_apply)
+ assert_index_equal(res_not_as_apply, exp_not_as_apply)
ind = Index(list('abcde'))
df = DataFrame([[1, 2], [2, 3], [1, 4], [1, 5], [2, 6]], index=ind)
res = df.groupby(0, as_index=False).apply(lambda x: x).index
assert_index_equal(res, ind)
+ def test_groupby_head_tail(self):
+ df = DataFrame([[1, 2], [1, 4], [5, 6]], columns=['A', 'B'])
+ g_as = df.groupby('A', as_index=True)
+ g_not_as = df.groupby('A', as_index=False)
+
+ # as_index= False, much easier
+ assert_frame_equal(df.loc[[0, 2]], g_not_as.head(1))
+ assert_frame_equal(df.loc[[1, 2]], g_not_as.tail(1))
+
+ empty_not_as = DataFrame(columns=df.columns)
+ assert_frame_equal(empty_not_as, g_not_as.head(0))
+ assert_frame_equal(empty_not_as, g_not_as.tail(0))
+ assert_frame_equal(empty_not_as, g_not_as.head(-1))
+ assert_frame_equal(empty_not_as, g_not_as.tail(-1))
+
+ assert_frame_equal(df, g_not_as.head(7)) # contains all
+ assert_frame_equal(df, g_not_as.tail(7))
+
+ # as_index=True, yuck
+ # prepend the A column as an index, in a roundabout way
+ df_as = df.copy()
+ df_as.index = df.set_index('A', append=True,
+ drop=False).index.swaplevel(0, 1)
+
+ assert_frame_equal(df_as.loc[[0, 2]], g_as.head(1))
+ assert_frame_equal(df_as.loc[[1, 2]], g_as.tail(1))
+
+ empty_as = DataFrame(index=df_as.index[:0], columns=df.columns)
+ assert_frame_equal(empty_as, g_as.head(0))
+ assert_frame_equal(empty_as, g_as.tail(0))
+ assert_frame_equal(empty_as, g_as.head(-1))
+ assert_frame_equal(empty_as, g_as.tail(-1))
+
+ assert_frame_equal(df_as, g_as.head(7)) # contains all
+ assert_frame_equal(df_as, g_as.tail(7))
+
def test_groupby_multiple_key(self):
df = tm.makeTimeDataFrame()
grouped = df.groupby([lambda x: x.year,
| Try again with #5518.
Massive gains in groupby head and tail, adds more tests for these, slight speed improvement in size (not as much as I'd hoped, basically iterating through grouper.indices is slow :( ).
_As mentioned before, I added a helper function to prepend as_index to index (if that makes **any** sense), I think it could be faster, and also using it in apply may fix some bugs there..._
| https://api.github.com/repos/pandas-dev/pandas/pulls/5533 | 2013-11-17T04:47:17Z | 2013-11-20T01:42:36Z | 2013-11-20T01:42:36Z | 2014-07-16T08:40:40Z |
sphinxext py3 compatibility | diff --git a/doc/sphinxext/numpydoc/docscrape.py b/doc/sphinxext/numpydoc/docscrape.py
index 4ee0f2e400d0e..2c49ed84ad224 100755
--- a/doc/sphinxext/numpydoc/docscrape.py
+++ b/doc/sphinxext/numpydoc/docscrape.py
@@ -499,10 +499,14 @@ def splitlines_x(s):
for field, items in [('Methods', self.methods),
('Attributes', self.properties)]:
if not self[field]:
- self[field] = [
- (name, '',
- splitlines_x(pydoc.getdoc(getattr(self._cls, name))))
- for name in sorted(items)]
+ doc_list = []
+ for name in sorted(items):
+ try:
+ doc_item = pydoc.getdoc(getattr(self._cls, name))
+ doc_list.append((name, '', splitlines_x(doc_item)))
+ except AttributeError:
+ pass # method doesn't exist
+ self[field] = doc_list
@property
def methods(self):
| Temporary sphinxext py3 compatibility fix as discussed in #5479 before #5221 is resolved. So far test_docscrape.py passes on both Python 2.7 and 3.3 (which should be the typical developer interpreters).
| https://api.github.com/repos/pandas-dev/pandas/pulls/5530 | 2013-11-16T20:43:28Z | 2014-01-30T10:49:25Z | 2014-01-30T10:49:25Z | 2014-06-12T19:56:32Z |
BUG: Bug in getitem with a multi-index and iloc (GH5528) | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 24811bc7b1b45..8d39db39ad4a6 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -808,6 +808,7 @@ Bug Fixes
- performance improvements in ``isnull`` on larger size pandas objects
- Fixed various setitem with 1d ndarray that does not have a matching
length to the indexer (:issue:`5508`)
+ - Bug in getitem with a multi-index and ``iloc`` (:issue:`5528`)
pandas 0.12.0
-------------
diff --git a/pandas/core/index.py b/pandas/core/index.py
index 1f2e823833810..096aff548dc9c 100644
--- a/pandas/core/index.py
+++ b/pandas/core/index.py
@@ -2826,6 +2826,11 @@ def reindex(self, target, method=None, level=None, limit=None,
-------
(new_index, indexer, mask) : (MultiIndex, ndarray, ndarray)
"""
+
+ # a direct takeable
+ if takeable:
+ return self.take(target), target
+
if level is not None:
if method is not None:
raise TypeError('Fill method not supported if level passed')
diff --git a/pandas/tests/test_indexing.py b/pandas/tests/test_indexing.py
index e01fd6a763ceb..86c3808781694 100644
--- a/pandas/tests/test_indexing.py
+++ b/pandas/tests/test_indexing.py
@@ -389,6 +389,37 @@ def test_iloc_getitem_slice_dups(self):
assert_frame_equal(df.iloc[10:,:2],df2)
assert_frame_equal(df.iloc[10:,2:],df1)
+ def test_iloc_getitem_multiindex(self):
+
+ df = DataFrame(np.random.randn(3, 3),
+ columns=[[2,2,4],[6,8,10]],
+ index=[[4,4,8],[8,10,12]])
+
+ rs = df.iloc[2]
+ xp = df.irow(2)
+ assert_series_equal(rs, xp)
+
+ rs = df.iloc[:,2]
+ xp = df.icol(2)
+ assert_series_equal(rs, xp)
+
+ rs = df.iloc[2,2]
+ xp = df.values[2,2]
+ self.assert_(rs == xp)
+
+ # for multiple items
+ # GH 5528
+ rs = df.iloc[[0,1]]
+ xp = df.xs(4,drop_level=False)
+ assert_frame_equal(rs,xp)
+
+ tup = zip(*[['a','a','b','b'],['x','y','x','y']])
+ index = MultiIndex.from_tuples(tup)
+ df = DataFrame(np.random.randn(4, 4), index=index)
+ rs = df.iloc[[2, 3]]
+ xp = df.xs('b',drop_level=False)
+ assert_frame_equal(rs,xp)
+
def test_iloc_getitem_out_of_bounds(self):
# out-of-bounds slice
@@ -409,23 +440,6 @@ def test_iloc_setitem(self):
result = df.iloc[:,2:3]
assert_frame_equal(result, expected)
- def test_iloc_multiindex(self):
- df = DataFrame(np.random.randn(3, 3),
- columns=[[2,2,4],[6,8,10]],
- index=[[4,4,8],[8,10,12]])
-
- rs = df.iloc[2]
- xp = df.irow(2)
- assert_series_equal(rs, xp)
-
- rs = df.iloc[:,2]
- xp = df.icol(2)
- assert_series_equal(rs, xp)
-
- rs = df.iloc[2,2]
- xp = df.values[2,2]
- self.assert_(rs == xp)
-
def test_loc_getitem_int(self):
# int label
@@ -704,7 +718,7 @@ def test_iloc_setitem_series(self):
result = s.iloc[:4]
assert_series_equal(result, expected)
- def test_iloc_multiindex(self):
+ def test_iloc_getitem_multiindex(self):
mi_labels = DataFrame(np.random.randn(4, 3), columns=[['i', 'i', 'j'],
['A', 'A', 'B']],
index=[['i', 'i', 'j', 'k'], ['X', 'X', 'Y','Y']])
| closes #5528
| https://api.github.com/repos/pandas-dev/pandas/pulls/5529 | 2013-11-16T17:27:53Z | 2013-11-16T19:13:47Z | 2013-11-16T19:13:47Z | 2014-06-18T13:18:30Z |
StataWriter: Replace non-isalnum characters in variable names by _ inste... | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 3f148748081b9..df0a27169e6df 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -221,6 +221,7 @@ Improvements to existing features
MultiIndex and Hierarchical Rows. Set the ``merge_cells`` to ``False`` to
restore the previous behaviour. (:issue:`5254`)
- The FRED DataReader now accepts multiple series (:issue`3413`)
+ - StataWriter adjusts variable names to Stata's limitations
API Changes
~~~~~~~~~~~
diff --git a/pandas/io/stata.py b/pandas/io/stata.py
index 1d0d1d17ec631..52c1ba463fc00 100644
--- a/pandas/io/stata.py
+++ b/pandas/io/stata.py
@@ -957,11 +957,49 @@ def _write_descriptors(self, typlist=None, varlist=None, srtlist=None,
self._write(typ)
# varlist, length 33*nvar, char array, null terminated
+ converted_names = []
+ duplicate_var_id = 0
+ for j, name in enumerate(self.varlist):
+ orig_name = name
+ # Replaces all characters disallowed in .dta format by their integral representation.
+ for c in name:
+ if (c < 'A' or c > 'Z') and (c < 'a' or c > 'z') and (c < '0' or c > '9') and c != '_':
+ name = name.replace(c, '_')
+
+ # Variable name may not start with a number
+ if name[0] > '0' and name[0] < '9':
+ name = '_' + name
+
+ name = name[:min(len(name), 32)]
+
+ if not name == orig_name:
+ # check for duplicates
+ while self.varlist.count(name) > 0:
+ # prepend ascending number to avoid duplicates
+ name = '_' + str(duplicate_var_id) + name
+ name = name[:min(len(name), 32)]
+ duplicate_var_id += 1
+
+ converted_names.append('{0} -> {1}'.format(orig_name, name))
+ self.varlist[j] = name
+
for name in self.varlist:
name = self._null_terminate(name, True)
name = _pad_bytes(name[:32], 33)
self._write(name)
+ if converted_names:
+ from warnings import warn
+ warn("""Not all pandas column names were valid Stata variable names.
+ Made the following replacements:
+
+ {0}
+
+ If this is not what you expect, please make sure you have Stata-compliant
+ column names in your DataFrame (max 32 characters, only alphanumerics and
+ underscores)/
+ """.format('\n '.join(converted_names)))
+
# srtlist, 2*(nvar+1), int array, encoded by byteorder
srtlist = _pad_bytes("", (2*(nvar+1)))
self._write(srtlist)
diff --git a/pandas/io/tests/test_stata.py b/pandas/io/tests/test_stata.py
index 76dae396c04ed..24eb2dfbc0372 100644
--- a/pandas/io/tests/test_stata.py
+++ b/pandas/io/tests/test_stata.py
@@ -231,6 +231,42 @@ def test_encoding(self):
self.assert_(result == expected)
self.assert_(isinstance(result, unicode))
+ def test_read_write_dta11(self):
+ original = DataFrame([(1, 2, 3, 4)],
+ columns=['good', 'bäd', '8number', 'astringwithmorethan32characters______'])
+ if compat.PY3:
+ formatted = DataFrame([(1, 2, 3, 4)],
+ columns=['good', 'b_d', '_8number', 'astringwithmorethan32characters_'])
+ else:
+ formatted = DataFrame([(1, 2, 3, 4)],
+ columns=['good', 'b__d', '_8number', 'astringwithmorethan32characters_'])
+ formatted.index.name = 'index'
+
+ with tm.ensure_clean() as path:
+ with warnings.catch_warnings(record=True) as w:
+ original.to_stata(path, None, False)
+ np.testing.assert_equal(
+ len(w), 1) # should get a warning for that format.
+
+ written_and_read_again = self.read_dta(path)
+ tm.assert_frame_equal(written_and_read_again.set_index('index'), formatted)
+
+ def test_read_write_dta12(self):
+ original = DataFrame([(1, 2, 3, 4)],
+ columns=['astringwithmorethan32characters_1', 'astringwithmorethan32characters_2', '+', '-'])
+ formatted = DataFrame([(1, 2, 3, 4)],
+ columns=['astringwithmorethan32characters_', '_0astringwithmorethan32character', '_', '_1_'])
+ formatted.index.name = 'index'
+
+ with tm.ensure_clean() as path:
+ with warnings.catch_warnings(record=True) as w:
+ original.to_stata(path, None, False)
+ np.testing.assert_equal(
+ len(w), 1) # should get a warning for that format.
+
+ written_and_read_again = self.read_dta(path)
+ tm.assert_frame_equal(written_and_read_again.set_index('index'), formatted)
+
if __name__ == '__main__':
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
exit=False)
| ...ad of integral represantation of replaced character. Eliminate duplicates created by replacement.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5525 | 2013-11-15T19:43:26Z | 2013-12-04T13:02:57Z | 2013-12-04T13:02:57Z | 2014-07-09T17:56:15Z |
BUG/TST: Fixes isnull behavior on NaT in array. Closes #5443 | diff --git a/pandas/lib.pyx b/pandas/lib.pyx
index 56ef9a4fcb160..afd8ac87589be 100644
--- a/pandas/lib.pyx
+++ b/pandas/lib.pyx
@@ -170,7 +170,6 @@ cdef inline int64_t get_timedelta64_value(val):
cdef double INF = <double> np.inf
cdef double NEGINF = -INF
-
cpdef checknull(object val):
if util.is_float_object(val) or util.is_complex_object(val):
return val != val # and val != INF and val != NEGINF
@@ -183,7 +182,7 @@ cpdef checknull(object val):
elif is_array(val):
return False
else:
- return util._checknull(val)
+ return _checknull(val)
cpdef checknull_old(object val):
if util.is_float_object(val) or util.is_complex_object(val):
@@ -213,7 +212,8 @@ def isnullobj(ndarray[object] arr):
n = len(arr)
result = np.zeros(n, dtype=np.uint8)
for i from 0 <= i < n:
- result[i] = util._checknull(arr[i])
+ arobj = arr[i]
+ result[i] = arobj is NaT or _checknull(arobj)
return result.view(np.bool_)
@cython.wraparound(False)
diff --git a/pandas/src/util.pxd b/pandas/src/util.pxd
index 7a30f018e623e..d6f3c4caea306 100644
--- a/pandas/src/util.pxd
+++ b/pandas/src/util.pxd
@@ -67,7 +67,7 @@ cdef inline is_array(object o):
cdef inline bint _checknull(object val):
try:
- return val is None or (cpython.PyFloat_Check(val) and val != val)
+ return val is None or (cpython.PyFloat_Check(val) and val != val)
except ValueError:
return False
diff --git a/pandas/tests/test_common.py b/pandas/tests/test_common.py
index 7b4ea855f2f9d..9be485b143d5f 100644
--- a/pandas/tests/test_common.py
+++ b/pandas/tests/test_common.py
@@ -5,7 +5,7 @@
import nose
from nose.tools import assert_equal
import numpy as np
-from pandas.tslib import iNaT
+from pandas.tslib import iNaT, NaT
from pandas import Series, DataFrame, date_range, DatetimeIndex, Timestamp
from pandas import compat
@@ -114,6 +114,14 @@ def test_isnull_lists():
result = isnull([u('foo'), u('bar')])
assert(not result.any())
+def test_isnull_nat():
+ result = isnull([NaT])
+ exp = np.array([True])
+ assert(np.array_equal(result, exp))
+
+ result = isnull(np.array([NaT], dtype=object))
+ exp = np.array([True])
+ assert(np.array_equal(result, exp))
def test_isnull_datetime():
assert (not isnull(datetime.now()))
| I added a test case test_isnull_nat() to test_common.py and a check for NaT in lib.isnullobj. pd.isnull(np.array([pd.NaT])) now yields the correct results ([True]).
closes #5443
| https://api.github.com/repos/pandas-dev/pandas/pulls/5524 | 2013-11-15T16:31:06Z | 2014-01-06T23:44:31Z | 2014-01-06T23:44:31Z | 2014-06-25T08:45:15Z |
Ensure that we can get a commit number from git | diff --git a/setup.py b/setup.py
index 6ab478bfc2541..44229fa64d4cd 100755
--- a/setup.py
+++ b/setup.py
@@ -201,12 +201,12 @@ def build_extensions(self):
try:
import subprocess
try:
- pipe = subprocess.Popen(["git", "describe", "HEAD"],
+ pipe = subprocess.Popen(["git", "describe", "--always"],
stdout=subprocess.PIPE).stdout
except OSError:
# msysgit compatibility
pipe = subprocess.Popen(
- ["git.cmd", "describe", "HEAD"],
+ ["git.cmd", "describe", "--always"],
stdout=subprocess.PIPE).stdout
rev = pipe.read().strip()
# makes distutils blow up on Python 2.7
| Currently, git describe fails with "fatal: No names found, cannot describe anything."
| https://api.github.com/repos/pandas-dev/pandas/pulls/5520 | 2013-11-15T09:52:20Z | 2013-11-16T10:36:14Z | 2013-11-16T10:36:13Z | 2014-07-16T08:40:30Z |
PERF faster head, tail and size groupby methods | diff --git a/pandas/compat/__init__.py b/pandas/compat/__init__.py
index 982b5de49e6fa..8ec3adcdffd6f 100644
--- a/pandas/compat/__init__.py
+++ b/pandas/compat/__init__.py
@@ -245,6 +245,7 @@ def wrapper(cls):
class _OrderedDict(dict):
+
"""Dictionary that remembers insertion order"""
# An inherited dict maps keys to values.
# The inherited dict provides __getitem__, __len__, __contains__, and get.
@@ -505,6 +506,7 @@ def viewitems(self):
class _Counter(dict):
+
"""Dict subclass for counting hashable objects. Sometimes called a bag
or multiset. Elements are stored as dictionary keys and their counts
are stored as dictionary values.
diff --git a/pandas/computation/engines.py b/pandas/computation/engines.py
index 88efc9eeab5d5..9738cac58fb2d 100644
--- a/pandas/computation/engines.py
+++ b/pandas/computation/engines.py
@@ -10,6 +10,7 @@
class AbstractEngine(object):
+
"""Object serving as a base class for all engines."""
__metaclass__ = abc.ABCMeta
@@ -73,6 +74,7 @@ def _evaluate(self):
class NumExprEngine(AbstractEngine):
+
"""NumExpr engine class"""
has_neg_frac = True
@@ -105,6 +107,7 @@ def _evaluate(self):
class PythonEngine(AbstractEngine):
+
"""Evaluate an expression in Python space.
Mostly for testing purposes.
diff --git a/pandas/computation/expr.py b/pandas/computation/expr.py
index 1af41acd34ede..4c6ea3ecdae7d 100644
--- a/pandas/computation/expr.py
+++ b/pandas/computation/expr.py
@@ -70,6 +70,7 @@ def _raw_hex_id(obj, pad_size=2):
class Scope(StringMixin):
+
"""Object to hold scope, with a few bells to deal with some custom syntax
added by pandas.
@@ -324,6 +325,7 @@ def _node_not_implemented(node_name, cls):
"""Return a function that raises a NotImplementedError with a passed node
name.
"""
+
def f(self, *args, **kwargs):
raise NotImplementedError("{0!r} nodes are not "
"implemented".format(node_name))
@@ -356,6 +358,7 @@ def _op_maker(op_class, op_symbol):
-------
f : callable
"""
+
def f(self, node, *args, **kwargs):
"""Return a partial function with an Op subclass with an operator
already passed.
@@ -389,6 +392,7 @@ def f(cls):
@disallow(_unsupported_nodes)
@add_ops(_op_classes)
class BaseExprVisitor(ast.NodeVisitor):
+
"""Custom ast walker. Parsers of other engines should subclass this class
if necessary.
@@ -710,6 +714,7 @@ def visitor(x, y):
(_boolop_nodes | frozenset(['BoolOp', 'Attribute', 'In', 'NotIn',
'Tuple'])))
class PandasExprVisitor(BaseExprVisitor):
+
def __init__(self, env, engine, parser,
preparser=lambda x: _replace_locals(_replace_booleans(x))):
super(PandasExprVisitor, self).__init__(env, engine, parser, preparser)
@@ -717,12 +722,14 @@ def __init__(self, env, engine, parser,
@disallow(_unsupported_nodes | _python_not_supported | frozenset(['Not']))
class PythonExprVisitor(BaseExprVisitor):
+
def __init__(self, env, engine, parser, preparser=lambda x: x):
super(PythonExprVisitor, self).__init__(env, engine, parser,
preparser=preparser)
class Expr(StringMixin):
+
"""Object encapsulating an expression.
Parameters
@@ -734,6 +741,7 @@ class Expr(StringMixin):
truediv : bool, optional, default True
level : int, optional, default 2
"""
+
def __init__(self, expr, engine='numexpr', parser='pandas', env=None,
truediv=True, level=2):
self.expr = expr
diff --git a/pandas/computation/ops.py b/pandas/computation/ops.py
index 0510ee86760a3..8d7bd0a819e79 100644
--- a/pandas/computation/ops.py
+++ b/pandas/computation/ops.py
@@ -27,7 +27,9 @@
class UndefinedVariableError(NameError):
+
"""NameError subclass for local variables."""
+
def __init__(self, *args):
msg = 'name {0!r} is not defined'
subbed = _TAG_RE.sub('', args[0])
@@ -51,6 +53,7 @@ def _possibly_update_key(d, value, old_key, new_key=None):
class Term(StringMixin):
+
def __new__(cls, name, env, side=None, encoding=None):
klass = Constant if not isinstance(name, string_types) else cls
supr_new = super(Term, klass).__new__
@@ -195,6 +198,7 @@ def ndim(self):
class Constant(Term):
+
def __init__(self, value, env, side=None, encoding=None):
super(Constant, self).__init__(value, env, side=side,
encoding=encoding)
@@ -211,8 +215,10 @@ def name(self):
class Op(StringMixin):
+
"""Hold an operator of unknown arity
"""
+
def __init__(self, op, operands, *args, **kwargs):
self.op = _bool_op_map.get(op, op)
self.operands = operands
@@ -328,6 +334,7 @@ def is_term(obj):
class BinOp(Op):
+
"""Hold a binary operator and its operands
Parameters
@@ -336,6 +343,7 @@ class BinOp(Op):
left : Term or Op
right : Term or Op
"""
+
def __init__(self, op, lhs, rhs, **kwargs):
super(BinOp, self).__init__(op, (lhs, rhs))
self.lhs = lhs
@@ -452,6 +460,7 @@ def _disallow_scalar_only_bool_ops(self):
class Div(BinOp):
+
"""Div operator to special case casting.
Parameters
@@ -462,6 +471,7 @@ class Div(BinOp):
Whether or not to use true division. With Python 3 this happens
regardless of the value of ``truediv``.
"""
+
def __init__(self, lhs, rhs, truediv=True, *args, **kwargs):
super(Div, self).__init__('/', lhs, rhs, *args, **kwargs)
@@ -475,6 +485,7 @@ def __init__(self, lhs, rhs, truediv=True, *args, **kwargs):
class UnaryOp(Op):
+
"""Hold a unary operator and its operands
Parameters
@@ -489,6 +500,7 @@ class UnaryOp(Op):
ValueError
* If no function associated with the passed operator token is found.
"""
+
def __init__(self, op, operand):
super(UnaryOp, self).__init__(op, (operand,))
self.operand = operand
diff --git a/pandas/computation/pytables.py b/pandas/computation/pytables.py
index 8afe8e909a434..a521bfb3cfec9 100644
--- a/pandas/computation/pytables.py
+++ b/pandas/computation/pytables.py
@@ -30,6 +30,7 @@ def __init__(self, gbls=None, lcls=None, queryables=None, level=1):
class Term(ops.Term):
+
def __new__(cls, name, env, side=None, encoding=None):
klass = Constant if not isinstance(name, string_types) else cls
supr_new = StringMixin.__new__
@@ -57,6 +58,7 @@ def value(self):
class Constant(Term):
+
def __init__(self, value, env, side=None, encoding=None):
super(Constant, self).__init__(value, env, side=side,
encoding=encoding)
@@ -292,9 +294,9 @@ def __unicode__(self):
def invert(self):
""" invert the condition """
- #if self.condition is not None:
+ # if self.condition is not None:
# self.condition = "~(%s)" % self.condition
- #return self
+ # return self
raise NotImplementedError("cannot use an invert condition when "
"passing to numexpr")
diff --git a/pandas/computation/tests/test_eval.py b/pandas/computation/tests/test_eval.py
index 44e560b86a683..f2d75d3fd21c5 100644
--- a/pandas/computation/tests/test_eval.py
+++ b/pandas/computation/tests/test_eval.py
@@ -35,6 +35,7 @@
_series_frame_incompatible = _bool_ops_syms
_scalar_skip = 'in', 'not in'
+
def skip_if_no_ne(engine='numexpr'):
if not _USE_NUMEXPR and engine == 'numexpr':
raise nose.SkipTest("numexpr engine not installed or disabled")
@@ -104,6 +105,7 @@ def _is_py3_complex_incompat(result, expected):
class TestEvalNumexprPandas(unittest.TestCase):
+
@classmethod
def setUpClass(cls):
skip_if_no_ne()
@@ -201,7 +203,8 @@ def test_compound_invert_op(self):
@slow
def test_chained_cmp_op(self):
mids = self.lhses
- cmp_ops = '<', '>'# tuple(set(self.cmp_ops) - set(['==', '!=', '<=', '>=']))
+ # tuple(set(self.cmp_ops) - set(['==', '!=', '<=', '>=']))
+ cmp_ops = '<', '>'
for lhs, cmp1, mid, cmp2, rhs in product(self.lhses, cmp_ops,
mids, cmp_ops, self.rhses):
self.check_chained_cmp_op(lhs, cmp1, mid, cmp2, rhs)
@@ -231,7 +234,7 @@ def check_complex_cmp_op(self, lhs, cmp1, rhs, binop, cmp2):
engine=self.engine, parser=self.parser)
elif (np.isscalar(lhs) and np.isnan(lhs) and
not np.isscalar(rhs) and (cmp1 in skip_these or cmp2 in
- skip_these)):
+ skip_these)):
with tm.assertRaises(TypeError):
_eval_single_bin(lhs, binop, rhs, self.engine)
else:
@@ -243,19 +246,20 @@ def check_complex_cmp_op(self, lhs, cmp1, rhs, binop, cmp2):
# TODO: the code below should be added back when left and right
# hand side bool ops are fixed.
- #try:
- #self.assertRaises(Exception, pd.eval, ex,
+ # try:
+ # self.assertRaises(Exception, pd.eval, ex,
#local_dict={'lhs': lhs, 'rhs': rhs},
- #engine=self.engine, parser=self.parser)
- #except AssertionError:
+ # engine=self.engine, parser=self.parser)
+ # except AssertionError:
#import ipdb; ipdb.set_trace()
- #raise
+ # raise
elif (np.isscalar(lhs_new) and np.isnan(lhs_new) and
not np.isscalar(rhs_new) and binop in skip_these):
with tm.assertRaises(TypeError):
_eval_single_bin(lhs_new, binop, rhs_new, self.engine)
else:
- expected = _eval_single_bin(lhs_new, binop, rhs_new, self.engine)
+ expected = _eval_single_bin(
+ lhs_new, binop, rhs_new, self.engine)
result = pd.eval(ex, engine=self.engine, parser=self.parser)
assert_array_equal(result, expected)
@@ -306,7 +310,7 @@ def check_operands(left, right, cmp_op):
for ex in (ex1, ex2, ex3):
result = pd.eval(ex, engine=self.engine,
- parser=self.parser)
+ parser=self.parser)
assert_array_equal(result, expected)
@skip_incompatible_operand
@@ -314,8 +318,8 @@ def check_simple_cmp_op(self, lhs, cmp1, rhs):
ex = 'lhs {0} rhs'.format(cmp1)
if cmp1 in ('in', 'not in') and not com.is_list_like(rhs):
self.assertRaises(TypeError, pd.eval, ex, engine=self.engine,
- parser=self.parser, local_dict={'lhs': lhs,
- 'rhs': rhs})
+ parser=self.parser, local_dict={'lhs': lhs,
+ 'rhs': rhs})
else:
expected = _eval_single_bin(lhs, cmp1, rhs, self.engine)
result = pd.eval(ex, engine=self.engine, parser=self.parser)
@@ -396,7 +400,7 @@ def check_pow(self, lhs, arith1, rhs):
result = pd.eval(ex, engine=self.engine, parser=self.parser)
if (np.isscalar(lhs) and np.isscalar(rhs) and
- _is_py3_complex_incompat(result, expected)):
+ _is_py3_complex_incompat(result, expected)):
self.assertRaises(AssertionError, assert_array_equal, result,
expected)
else:
@@ -462,9 +466,9 @@ def ex(self, op, var_name='lhs'):
def test_frame_invert(self):
expr = self.ex('~')
- ## ~ ##
+ # ~ ##
# frame
- ## float always raises
+ # float always raises
lhs = DataFrame(randn(5, 2))
if self.engine == 'numexpr':
with tm.assertRaises(NotImplementedError):
@@ -473,7 +477,7 @@ def test_frame_invert(self):
with tm.assertRaises(TypeError):
result = pd.eval(expr, engine=self.engine, parser=self.parser)
- ## int raises on numexpr
+ # int raises on numexpr
lhs = DataFrame(randint(5, size=(5, 2)))
if self.engine == 'numexpr':
with tm.assertRaises(NotImplementedError):
@@ -483,13 +487,13 @@ def test_frame_invert(self):
result = pd.eval(expr, engine=self.engine, parser=self.parser)
assert_frame_equal(expect, result)
- ## bool always works
+ # bool always works
lhs = DataFrame(rand(5, 2) > 0.5)
expect = ~lhs
result = pd.eval(expr, engine=self.engine, parser=self.parser)
assert_frame_equal(expect, result)
- ## object raises
+ # object raises
lhs = DataFrame({'b': ['a', 1, 2.0], 'c': rand(3) > 0.5})
if self.engine == 'numexpr':
with tm.assertRaises(ValueError):
@@ -499,11 +503,11 @@ def test_frame_invert(self):
result = pd.eval(expr, engine=self.engine, parser=self.parser)
def test_series_invert(self):
- #### ~ ####
+ # ~ ####
expr = self.ex('~')
# series
- ## float raises
+ # float raises
lhs = Series(randn(5))
if self.engine == 'numexpr':
with tm.assertRaises(NotImplementedError):
@@ -512,7 +516,7 @@ def test_series_invert(self):
with tm.assertRaises(TypeError):
result = pd.eval(expr, engine=self.engine, parser=self.parser)
- ## int raises on numexpr
+ # int raises on numexpr
lhs = Series(randint(5, size=5))
if self.engine == 'numexpr':
with tm.assertRaises(NotImplementedError):
@@ -522,7 +526,7 @@ def test_series_invert(self):
result = pd.eval(expr, engine=self.engine, parser=self.parser)
assert_series_equal(expect, result)
- ## bool
+ # bool
lhs = Series(rand(5) > 0.5)
expect = ~lhs
result = pd.eval(expr, engine=self.engine, parser=self.parser)
@@ -661,19 +665,30 @@ def test_scalar_unary(self):
with tm.assertRaises(TypeError):
pd.eval('~1.0', engine=self.engine, parser=self.parser)
- self.assertEqual(pd.eval('-1.0', parser=self.parser, engine=self.engine), -1.0)
- self.assertEqual(pd.eval('+1.0', parser=self.parser, engine=self.engine), +1.0)
-
- self.assertEqual(pd.eval('~1', parser=self.parser, engine=self.engine), ~1)
- self.assertEqual(pd.eval('-1', parser=self.parser, engine=self.engine), -1)
- self.assertEqual(pd.eval('+1', parser=self.parser, engine=self.engine), +1)
-
- self.assertEqual(pd.eval('~True', parser=self.parser, engine=self.engine), ~True)
- self.assertEqual(pd.eval('~False', parser=self.parser, engine=self.engine), ~False)
- self.assertEqual(pd.eval('-True', parser=self.parser, engine=self.engine), -True)
- self.assertEqual(pd.eval('-False', parser=self.parser, engine=self.engine), -False)
- self.assertEqual(pd.eval('+True', parser=self.parser, engine=self.engine), +True)
- self.assertEqual(pd.eval('+False', parser=self.parser, engine=self.engine), +False)
+ self.assertEqual(
+ pd.eval('-1.0', parser=self.parser, engine=self.engine), -1.0)
+ self.assertEqual(
+ pd.eval('+1.0', parser=self.parser, engine=self.engine), +1.0)
+
+ self.assertEqual(
+ pd.eval('~1', parser=self.parser, engine=self.engine), ~1)
+ self.assertEqual(
+ pd.eval('-1', parser=self.parser, engine=self.engine), -1)
+ self.assertEqual(
+ pd.eval('+1', parser=self.parser, engine=self.engine), +1)
+
+ self.assertEqual(
+ pd.eval('~True', parser=self.parser, engine=self.engine), ~True)
+ self.assertEqual(
+ pd.eval('~False', parser=self.parser, engine=self.engine), ~False)
+ self.assertEqual(
+ pd.eval('-True', parser=self.parser, engine=self.engine), -True)
+ self.assertEqual(
+ pd.eval('-False', parser=self.parser, engine=self.engine), -False)
+ self.assertEqual(
+ pd.eval('+True', parser=self.parser, engine=self.engine), +True)
+ self.assertEqual(
+ pd.eval('+False', parser=self.parser, engine=self.engine), +False)
def test_disallow_scalar_bool_ops(self):
exprs = '1 or 2', '1 and 2'
@@ -689,6 +704,7 @@ def test_disallow_scalar_bool_ops(self):
class TestEvalNumexprPython(TestEvalNumexprPandas):
+
@classmethod
def setUpClass(cls):
skip_if_no_ne()
@@ -714,6 +730,7 @@ def check_chained_cmp_op(self, lhs, cmp1, mid, cmp2, rhs):
class TestEvalPythonPython(TestEvalNumexprPython):
+
@classmethod
def setUpClass(cls):
cls.engine = 'python'
@@ -741,6 +758,7 @@ def check_alignment(self, result, nlhs, ghs, op):
class TestEvalPythonPandas(TestEvalPythonPython):
+
@classmethod
def setUpClass(cls):
cls.engine = 'python'
@@ -782,9 +800,9 @@ def check_basic_frame_alignment(self, engine, parser):
self.index_types)
for lr_idx_type, rr_idx_type, c_idx_type in args:
df = mkdf(10, 10, data_gen_f=f, r_idx_type=lr_idx_type,
- c_idx_type=c_idx_type)
+ c_idx_type=c_idx_type)
df2 = mkdf(20, 10, data_gen_f=f, r_idx_type=rr_idx_type,
- c_idx_type=c_idx_type)
+ c_idx_type=c_idx_type)
res = pd.eval('df + df2', engine=engine, parser=parser)
assert_frame_equal(res, df + df2)
@@ -797,7 +815,7 @@ def check_frame_comparison(self, engine, parser):
args = product(self.lhs_index_types, repeat=2)
for r_idx_type, c_idx_type in args:
df = mkdf(10, 10, data_gen_f=f, r_idx_type=r_idx_type,
- c_idx_type=c_idx_type)
+ c_idx_type=c_idx_type)
res = pd.eval('df < 2', engine=engine, parser=parser)
assert_frame_equal(res, df < 2)
@@ -829,9 +847,10 @@ def test_medium_complex_frame_alignment(self):
def check_basic_frame_series_alignment(self, engine, parser):
skip_if_no_ne(engine)
+
def testit(r_idx_type, c_idx_type, index_name):
df = mkdf(10, 10, data_gen_f=f, r_idx_type=r_idx_type,
- c_idx_type=c_idx_type)
+ c_idx_type=c_idx_type)
index = getattr(df, index_name)
s = Series(np.random.randn(5), index[:5])
@@ -856,9 +875,10 @@ def test_basic_frame_series_alignment(self):
def check_basic_series_frame_alignment(self, engine, parser):
skip_if_no_ne(engine)
+
def testit(r_idx_type, c_idx_type, index_name):
df = mkdf(10, 7, data_gen_f=f, r_idx_type=r_idx_type,
- c_idx_type=c_idx_type)
+ c_idx_type=c_idx_type)
index = getattr(df, index_name)
s = Series(np.random.randn(5), index[:5])
@@ -873,12 +893,12 @@ def testit(r_idx_type, c_idx_type, index_name):
assert_frame_equal(res, expected)
# only test dt with dt, otherwise weird joins result
- args = product(['i','u','s'],['i','u','s'],('index', 'columns'))
+ args = product(['i', 'u', 's'], ['i', 'u', 's'], ('index', 'columns'))
for r_idx_type, c_idx_type, index_name in args:
testit(r_idx_type, c_idx_type, index_name)
# dt with dt
- args = product(['dt'],['dt'],('index', 'columns'))
+ args = product(['dt'], ['dt'], ('index', 'columns'))
for r_idx_type, c_idx_type, index_name in args:
testit(r_idx_type, c_idx_type, index_name)
@@ -892,7 +912,7 @@ def check_series_frame_commutativity(self, engine, parser):
('index', 'columns'))
for r_idx_type, c_idx_type, op, index_name in args:
df = mkdf(10, 10, data_gen_f=f, r_idx_type=r_idx_type,
- c_idx_type=c_idx_type)
+ c_idx_type=c_idx_type)
index = getattr(df, index_name)
s = Series(np.random.randn(5), index[:5])
@@ -1005,6 +1025,7 @@ def test_performance_warning_for_poor_alignment(self):
# slightly more complex ops
class TestOperationsNumExprPandas(unittest.TestCase):
+
@classmethod
def setUpClass(cls):
skip_if_no_ne()
@@ -1175,21 +1196,22 @@ def test_assignment_column(self):
# invalid assignees
self.assertRaises(SyntaxError, df.eval, 'd,c = a + b')
- self.assertRaises(SyntaxError, df.eval, 'Timestamp("20131001") = a + b')
+ self.assertRaises(
+ SyntaxError, df.eval, 'Timestamp("20131001") = a + b')
# single assignment - existing variable
expected = orig_df.copy()
expected['a'] = expected['a'] + expected['b']
df = orig_df.copy()
df.eval('a = a + b')
- assert_frame_equal(df,expected)
+ assert_frame_equal(df, expected)
# single assignment - new variable
expected = orig_df.copy()
expected['c'] = expected['a'] + expected['b']
df = orig_df.copy()
df.eval('c = a + b')
- assert_frame_equal(df,expected)
+ assert_frame_equal(df, expected)
# with a local name overlap
def f():
@@ -1201,9 +1223,10 @@ def f():
df = f()
expected = orig_df.copy()
expected['a'] = 1 + expected['b']
- assert_frame_equal(df,expected)
+ assert_frame_equal(df, expected)
df = orig_df.copy()
+
def f():
a = 1
df.eval('a=a+b')
@@ -1216,10 +1239,10 @@ def f():
# explicit targets
df = orig_df.copy()
- self.eval('c = df.a + df.b', local_dict={'df' : df}, target=df)
+ self.eval('c = df.a + df.b', local_dict={'df': df}, target=df)
expected = orig_df.copy()
expected['c'] = expected['a'] + expected['b']
- assert_frame_equal(df,expected)
+ assert_frame_equal(df, expected)
def test_basic_period_index_boolean_expression(self):
df = mkdf(2, 2, data_gen_f=f, c_idx_type='p', r_idx_type='i')
@@ -1311,6 +1334,7 @@ def test_simple_in_ops(self):
class TestOperationsNumExprPython(TestOperationsNumExprPandas):
+
@classmethod
def setUpClass(cls):
if not _USE_NUMEXPR:
@@ -1377,6 +1401,7 @@ def test_simple_bool_ops(self):
class TestOperationsPythonPython(TestOperationsNumExprPython):
+
@classmethod
def setUpClass(cls):
cls.engine = cls.parser = 'python'
@@ -1386,6 +1411,7 @@ def setUpClass(cls):
class TestOperationsPythonPandas(TestOperationsNumExprPandas):
+
@classmethod
def setUpClass(cls):
cls.engine = 'python'
@@ -1397,6 +1423,7 @@ def setUpClass(cls):
class TestScope(object):
+
def check_global_scope(self, e, engine, parser):
skip_if_no_ne(engine)
assert_array_equal(_var_s * 2, pd.eval(e, engine=engine,
@@ -1478,6 +1505,7 @@ def test_is_expr_names():
_parsers = {'python': PythonExprVisitor, 'pytables': pytables.ExprVisitor,
'pandas': PandasExprVisitor}
+
def check_disallowed_nodes(engine, parser):
skip_if_no_ne(engine)
VisitorClass = _parsers[parser]
diff --git a/pandas/core/array.py b/pandas/core/array.py
index 209b00cf8bb3c..f267771bb770f 100644
--- a/pandas/core/array.py
+++ b/pandas/core/array.py
@@ -35,7 +35,7 @@
NA = np.nan
-#### a series-like ndarray ####
+# a series-like ndarray ####
class SNDArray(Array):
diff --git a/pandas/core/base.py b/pandas/core/base.py
index a702e7c87c0a9..36c5a65163fad 100644
--- a/pandas/core/base.py
+++ b/pandas/core/base.py
@@ -7,6 +7,7 @@
class StringMixin(object):
+
"""implements string methods so long as object defines a `__unicode__`
method.
@@ -55,6 +56,7 @@ def __repr__(self):
class PandasObject(StringMixin):
+
"""baseclass for various pandas objects"""
@property
@@ -96,6 +98,7 @@ def _reset_cache(self, key=None):
class FrozenList(PandasObject, list):
+
"""
Container that doesn't allow setting item *but*
because it's technically non-hashable, will be used
diff --git a/pandas/core/categorical.py b/pandas/core/categorical.py
index fec9cd4ff4274..23fccc3719278 100644
--- a/pandas/core/categorical.py
+++ b/pandas/core/categorical.py
@@ -33,6 +33,7 @@ def f(self, other):
class Categorical(PandasObject):
+
"""
Represents a categorical variable in classic R / S-plus fashion
@@ -74,6 +75,7 @@ class Categorical(PandasObject):
array(['a', 'b', 'c', 'a', 'b', 'c'], dtype=object)
Levels (3): Index(['a', 'b', 'c'], dtype=object)
"""
+
def __init__(self, labels, levels=None, name=None):
if levels is None:
if name is None:
@@ -148,14 +150,14 @@ def _tidy_repr(self, max_vals=20):
footer=False)
result = '%s\n...\n%s' % (head, tail)
- #TODO: tidy_repr for footer since there may be a ton of levels?
+ # TODO: tidy_repr for footer since there may be a ton of levels?
result = '%s\n%s' % (result, self._repr_footer())
return compat.text_type(result)
def _repr_footer(self):
levheader = 'Levels (%d): ' % len(self.levels)
- #TODO: should max_line_width respect a setting?
+ # TODO: should max_line_width respect a setting?
levstring = np.array_repr(self.levels, max_line_width=60)
indent = ' ' * (levstring.find('[') + len(levheader) + 1)
lines = levstring.split('\n')
@@ -222,11 +224,11 @@ def describe(self):
"""
Returns a dataframe with frequency and counts by level.
"""
- #Hack?
+ # Hack?
from pandas.core.frame import DataFrame
grouped = DataFrame(self.labels).groupby(0)
counts = grouped.count().values.squeeze()
- freqs = counts/float(counts.sum())
+ freqs = counts / float(counts.sum())
return DataFrame.from_dict({
'counts': counts,
'freqs': freqs,
diff --git a/pandas/core/common.py b/pandas/core/common.py
index 6fc015d2cb575..d251a2617f98d 100644
--- a/pandas/core/common.py
+++ b/pandas/core/common.py
@@ -73,6 +73,7 @@ def _check(cls, inst):
class _ABCGeneric(type):
+
def __instancecheck__(cls, inst):
return hasattr(inst, "_data")
@@ -962,7 +963,8 @@ def changeit():
# if we are trying to do something unsafe
# like put a bigger dtype in a smaller one, use the smaller one
- if change.dtype.itemsize < r.dtype.itemsize: # pragma: no cover
+ # pragma: no cover
+ if change.dtype.itemsize < r.dtype.itemsize:
raise AssertionError(
"cannot change dtype of input to smaller size")
change.dtype = r.dtype
@@ -2469,8 +2471,8 @@ def _pprint_dict(seq, _nest_lvl=0, **kwds):
nitems = get_option("max_seq_items") or len(seq)
for k, v in list(seq.items())[:nitems]:
- pairs.append(pfmt % (pprint_thing(k, _nest_lvl+1, **kwds),
- pprint_thing(v, _nest_lvl+1, **kwds)))
+ pairs.append(pfmt % (pprint_thing(k, _nest_lvl + 1, **kwds),
+ pprint_thing(v, _nest_lvl + 1, **kwds)))
if nitems < len(seq):
return fmt % (", ".join(pairs) + ", ...")
diff --git a/pandas/core/config.py b/pandas/core/config.py
index 6eb947119578f..ac48232ec618f 100644
--- a/pandas/core/config.py
+++ b/pandas/core/config.py
@@ -66,11 +66,12 @@
class OptionError(AttributeError, KeyError):
+
"""Exception for pandas.options, backwards compatible with KeyError
checks"""
-##########################################
+#
# User API
def _get_single_key(pat, silent):
@@ -187,8 +188,10 @@ def get_default_val(pat):
class DictWrapper(object):
+
""" provide attribute-style access to a nested dict
"""
+
def __init__(self, d, prefix=""):
object.__setattr__(self, "d", d)
object.__setattr__(self, "prefix", prefix)
@@ -354,11 +357,12 @@ def __doc__(self):
describe_option = CallableDynamicDoc(_describe_option, _describe_option_tmpl)
options = DictWrapper(_global_config)
-######################################################
+#
# Functions for use by pandas developers, in addition to User - api
class option_context(object):
+
def __init__(self, *args):
if not (len(args) % 2 == 0 and len(args) >= 2):
raise AssertionError(
@@ -499,7 +503,7 @@ def deprecate_option(key, msg=None, rkey=None, removal_ver=None):
_deprecated_options[key] = DeprecatedOption(key, msg, rkey, removal_ver)
-################################
+#
# functions internal to the module
def _select_options(pat):
@@ -662,7 +666,7 @@ def pp(name, ks):
return s
-##############
+#
# helpers
from contextlib import contextmanager
diff --git a/pandas/core/config_init.py b/pandas/core/config_init.py
index b9b934769793f..5502dc94e24c1 100644
--- a/pandas/core/config_init.py
+++ b/pandas/core/config_init.py
@@ -17,7 +17,7 @@
from pandas.core.format import detect_console_encoding
-###########################################
+#
# options from the "display" namespace
pc_precision_doc = """
diff --git a/pandas/core/daterange.py b/pandas/core/daterange.py
index 9ddd76c471d44..bdaf546789c39 100644
--- a/pandas/core/daterange.py
+++ b/pandas/core/daterange.py
@@ -9,6 +9,7 @@
# DateRange class
class DateRange(Index):
+
"""Deprecated
"""
diff --git a/pandas/core/format.py b/pandas/core/format.py
index 9abfe3c43b8e5..7354600c78c67 100644
--- a/pandas/core/format.py
+++ b/pandas/core/format.py
@@ -64,6 +64,7 @@
class CategoricalFormatter(object):
+
def __init__(self, categorical, buf=None, length=True,
na_rep='NaN', name=False, footer=True):
self.categorical = categorical
@@ -246,6 +247,7 @@ def _get_formatter(self, i):
class DataFrameFormatter(TableFormatter):
+
"""
Render a DataFrame
@@ -886,7 +888,7 @@ def __init__(self, obj, path_or_buf, sep=",", na_rep='', float_format=None,
self.date_format = date_format
- #GH3457
+ # GH3457
if not self.obj.columns.is_unique and engine == 'python':
raise NotImplementedError("columns.is_unique == False not "
"supported with engine='python'")
@@ -1155,7 +1157,7 @@ def _save_header(self):
col_line.append(columns.names[i])
if isinstance(index_label, list) and len(index_label) > 1:
- col_line.extend([''] * (len(index_label)-1))
+ col_line.extend([''] * (len(index_label) - 1))
col_line.extend(columns.get_level_values(i))
@@ -1176,7 +1178,7 @@ def _save(self):
# write in chunksize bites
chunksize = self.chunksize
- chunks = int(nrows / chunksize)+1
+ chunks = int(nrows / chunksize) + 1
for i in range(chunks):
start_i = i * chunksize
@@ -1237,6 +1239,7 @@ def __init__(self, row, col, val,
class ExcelFormatter(object):
+
"""
Class for formatting a DataFrame to a list of ExcelCells,
@@ -1591,6 +1594,7 @@ def _format(x):
class FloatArrayFormatter(GenericArrayFormatter):
+
"""
"""
@@ -1860,6 +1864,7 @@ def get_console_size():
class EngFormatter(object):
+
"""
Formats float values according to engineering format.
diff --git a/pandas/core/frame.py b/pandas/core/frame.py
index b194c938b13cc..5e617671f5c49 100644
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -766,9 +766,9 @@ def from_records(cls, data, index=None, exclude=None, columns=None,
values = [first_row]
- #if unknown length iterable (generator)
+ # if unknown length iterable (generator)
if nrows is None:
- #consume whole generator
+ # consume whole generator
values += list(data)
else:
i = 1
@@ -1592,7 +1592,7 @@ def _ixs(self, i, axis=0, copy=False):
# a numpy error (as numpy should really raise)
values = self._data.iget(i)
if not len(values):
- values = np.array([np.nan]*len(self.index), dtype=object)
+ values = np.array([np.nan] * len(self.index), dtype=object)
return self._constructor_sliced.from_array(
values, index=self.index,
name=label, fastpath=True)
diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py
index 18f41917067f2..cfe3220102d54 100644
--- a/pandas/core/groupby.py
+++ b/pandas/core/groupby.py
@@ -52,7 +52,6 @@
_apply_whitelist = frozenset(['last', 'first',
'mean', 'sum', 'min', 'max',
- 'head', 'tail',
'cumsum', 'cumprod', 'cummin', 'cummax',
'resample',
'describe',
@@ -120,6 +119,7 @@ def _last(x):
class GroupBy(PandasObject):
+
"""
Class for grouping and aggregating relational data. See aggregate,
transform, and apply functions on this object.
@@ -185,6 +185,7 @@ class GroupBy(PandasObject):
len(grouped) : int
Number of groups
"""
+
def __init__(self, obj, keys=None, axis=0, level=None,
grouper=None, exclusions=None, selection=None, as_index=True,
sort=True, group_keys=True, squeeze=False):
@@ -480,8 +481,9 @@ def picker(arr):
return np.nan
return self.agg(picker)
- def cumcount(self):
- """Number each item in each group from 0 to the length of that group.
+ def cumcount(self, **kwargs):
+ '''
+ Number each item in each group from 0 to the length of that group.
Essentially this is equivalent to
@@ -509,13 +511,101 @@ def cumcount(self):
5 3
dtype: int64
- """
+ '''
+ ascending = kwargs.pop('ascending', True)
+
index = self.obj.index
- cumcounts = np.zeros(len(index), dtype='int64')
- for v in self.indices.values():
- cumcounts[v] = np.arange(len(v), dtype='int64')
+ rng = np.arange(self.grouper._max_groupsize, dtype='int64')
+ cumcounts = self._cumcount_array(rng, ascending=ascending)
return Series(cumcounts, index)
+ def head(self, n=5):
+ '''
+ Returns first n rows of each group.
+
+ Essentially equivalent to .apply(lambda x: x.head(n))
+
+ Example
+ -------
+
+ >>> df = DataFrame([[1, 2], [1, 4], [5, 6]],
+ columns=['A', 'B'])
+ >>> df.groupby('A', as_index=False).head(1)
+ A B
+ 0 1 2
+ 2 5 6
+ >>> df.groupby('A').head(1)
+ A B
+ A
+ 1 0 1 2
+ 5 2 5 6
+
+ '''
+ rng = np.arange(self.grouper._max_groupsize, dtype='int64')
+ in_head = self._cumcount_array(rng) < n
+ head = self.obj[in_head]
+ if self.as_index:
+ head.index = self._index_with_as_index(in_head)
+ return head
+
+ def tail(self, n=5):
+ '''
+ Returns first n rows of each group
+
+ Essentially equivalent to .apply(lambda x: x.tail(n))
+
+ Example
+ -------
+
+ >>> df = DataFrame([[1, 2], [1, 4], [5, 6]],
+ columns=['A', 'B'])
+ >>> df.groupby('A', as_index=False).tail(1)
+ A B
+ 0 1 2
+ 2 5 6
+ >>> df.groupby('A').head(1)
+ A B
+ A
+ 1 0 1 2
+ 5 2 5 6
+ '''
+ rng = np.arange(0, -self.grouper._max_groupsize, -1, dtype='int64')
+ in_tail = self._cumcount_array(rng, ascending=False) > -n
+ tail = self.obj[in_tail]
+ if self.as_index:
+ tail.index = self._index_with_as_index(in_tail)
+ return tail
+
+ def _cumcount_array(self, arr, **kwargs):
+ ascending = kwargs.pop('ascending', True)
+
+ len_index = len(self.obj.index)
+ cumcounts = np.zeros(len_index, dtype='int64')
+ if ascending:
+ for v in self.indices.values():
+ cumcounts[v] = arr[:len(v)]
+ else:
+ for v in self.indices.values():
+ cumcounts[v] = arr[len(v)-1::-1]
+ return cumcounts
+
+ def _index_with_as_index(self, b):
+ '''
+ Take boolean mask of index to be returned from apply, if as_index=True
+
+ '''
+ # TODO perf, it feels like this should already be somewhere...
+ from itertools import chain
+ original = self.obj.index
+ gp = self.grouper
+ levels = chain((gp.levels[i][gp.labels[i][b]]
+ for i in range(len(gp.groupings))),
+ (original.get_level_values(i)[b]
+ for i in range(original.nlevels)))
+ new = MultiIndex.from_arrays(list(levels))
+ new.names = gp.names + original.names
+ return new
+
def _try_cast(self, result, obj):
"""
try to cast the result to our obj original type,
@@ -653,9 +743,11 @@ def _is_indexed_like(obj, axes):
class Grouper(object):
+
"""
"""
+
def __init__(self, axis, groupings, sort=True, group_keys=True):
self.axis = axis
self.groupings = groupings
@@ -754,14 +846,28 @@ def names(self):
def size(self):
"""
Compute group sizes
+
"""
# TODO: better impl
labels, _, ngroups = self.group_info
- bin_counts = Series(labels).value_counts()
+ bin_counts = algos.value_counts(labels, sort=False)
bin_counts = bin_counts.reindex(np.arange(ngroups))
bin_counts.index = self.result_index
return bin_counts
+ @cache_readonly
+ def _max_groupsize(self):
+ '''
+ Compute size of largest group
+
+ '''
+ # For many items in each group this is much faster than
+ # self.size().max(), in worst case marginally slower
+ if self.indices:
+ return max(len(v) for v in self.indices.itervalues())
+ else:
+ return 0
+
@cache_readonly
def groups(self):
if len(self.groupings) == 1:
@@ -1209,6 +1315,7 @@ def agg_series(self, obj, func):
class Grouping(object):
+
"""
Holds the grouping information for a single key
@@ -1229,6 +1336,7 @@ class Grouping(object):
* group_index : unique groups
* groups : dict of {group -> label_list}
"""
+
def __init__(self, index, grouper=None, name=None, level=None,
sort=True):
@@ -1594,7 +1702,7 @@ def _get_index():
return index
if isinstance(values[0], dict):
- # # GH #823
+ # GH #823
index = _get_index()
return DataFrame(values, index=index).stack()
@@ -2522,6 +2630,7 @@ def _chop(self, sdata, slice_obj):
class FrameSplitter(DataSplitter):
+
def __init__(self, data, labels, ngroups, axis=0):
super(FrameSplitter, self).__init__(data, labels, ngroups, axis=axis)
@@ -2546,6 +2655,7 @@ def _chop(self, sdata, slice_obj):
class NDFrameSplitter(DataSplitter):
+
def __init__(self, data, labels, ngroups, axis=0):
super(NDFrameSplitter, self).__init__(data, labels, ngroups, axis=axis)
@@ -2679,9 +2789,11 @@ def _lexsort_indexer(keys, orders=None):
class _KeyMapper(object):
+
"""
Ease my suffering. Map compressed group id -> key tuple
"""
+
def __init__(self, comp_ids, ngroups, labels, levels):
self.levels = levels
self.labels = labels
diff --git a/pandas/core/index.py b/pandas/core/index.py
index 65eb8486c36d2..18d6a1a04e3f9 100644
--- a/pandas/core/index.py
+++ b/pandas/core/index.py
@@ -1726,6 +1726,7 @@ def _wrap_joined_index(self, joined, other):
class Float64Index(Index):
+
"""
Immutable ndarray implementing an ordered, sliceable set. The basic object
storing axis labels for all pandas objects. Float64Index is a special case
diff --git a/pandas/core/indexing.py b/pandas/core/indexing.py
index ab9000fd21a0a..6d0f57c6ddd57 100644
--- a/pandas/core/indexing.py
+++ b/pandas/core/indexing.py
@@ -22,7 +22,7 @@ def get_indexers_list():
('loc', _LocIndexer),
('at', _AtIndexer),
('iat', _iAtIndexer),
- ]
+ ]
# "null slice"
_NS = slice(None, None)
@@ -116,13 +116,13 @@ def _convert_tuple(self, key, is_setter=False):
def _convert_scalar_indexer(self, key, axis):
# if we are accessing via lowered dim, use the last dim
- ax = self.obj._get_axis(min(axis, self.ndim-1))
+ ax = self.obj._get_axis(min(axis, self.ndim - 1))
# a scalar
return ax._convert_scalar_indexer(key, typ=self.name)
def _convert_slice_indexer(self, key, axis):
# if we are accessing via lowered dim, use the last dim
- ax = self.obj._get_axis(min(axis, self.ndim-1))
+ ax = self.obj._get_axis(min(axis, self.ndim - 1))
return ax._convert_slice_indexer(key, typ=self.name)
def _has_valid_setitem_indexer(self, indexer):
@@ -494,7 +494,7 @@ def _align_series(self, indexer, ser):
# broadcast along other dims
ser = ser.values.copy()
for (axis, l) in broadcast:
- shape = [-1] * (len(broadcast)+1)
+ shape = [-1] * (len(broadcast) + 1)
shape[axis] = l
ser = np.tile(ser, l).reshape(shape)
@@ -820,7 +820,7 @@ def _reindex(keys, level=None):
# reindex with the specified axis
ndim = self.obj.ndim
- if axis+1 > ndim:
+ if axis + 1 > ndim:
raise AssertionError("invalid indexing error with "
"non-unique index")
@@ -980,6 +980,7 @@ def _get_slice_axis(self, slice_obj, axis=0):
class _IXIndexer(_NDFrameIndexer):
+
""" A primarily location based indexer, with integer fallback """
def _has_valid_type(self, key, axis):
@@ -1039,6 +1040,7 @@ def _get_slice_axis(self, slice_obj, axis=0):
class _LocIndexer(_LocationIndexer):
+
""" purely label based location based indexing """
_valid_types = ("labels (MUST BE IN THE INDEX), slices of labels (BOTH "
"endpoints included! Can be slices of integers if the "
@@ -1136,6 +1138,7 @@ def _getitem_axis(self, key, axis=0):
class _iLocIndexer(_LocationIndexer):
+
""" purely integer based location based indexing """
_valid_types = ("integer, integer slice (START point is INCLUDED, END "
"point is EXCLUDED), listlike of integers, boolean array")
@@ -1228,6 +1231,7 @@ def _convert_to_indexer(self, obj, axis=0, is_setter=False):
class _ScalarAccessIndexer(_NDFrameIndexer):
+
""" access scalars quickly """
def _convert_key(self, key):
@@ -1257,11 +1261,13 @@ def __setitem__(self, key, value):
class _AtIndexer(_ScalarAccessIndexer):
+
""" label based scalar accessor """
pass
class _iAtIndexer(_ScalarAccessIndexer):
+
""" integer based scalar accessor """
def _has_valid_setitem_indexer(self, indexer):
@@ -1301,7 +1307,7 @@ def _length_of_indexer(indexer, target=None):
step = 1
elif step < 0:
step = abs(step)
- return (stop-start) / step
+ return (stop - start) / step
elif isinstance(indexer, (ABCSeries, np.ndarray, list)):
return len(indexer)
elif not is_list_like(indexer):
@@ -1346,6 +1352,7 @@ def _crit(v):
class _SeriesIndexer(_IXIndexer):
+
"""
Class to support fancy indexing, potentially using labels
@@ -1504,11 +1511,11 @@ def _check_slice_bounds(slobj, values):
l = len(values)
start = slobj.start
if start is not None:
- if start < -l or start > l-1:
+ if start < -l or start > l - 1:
raise IndexError("out-of-bounds on slice (start)")
stop = slobj.stop
if stop is not None:
- if stop < -l-1 or stop > l:
+ if stop < -l - 1 or stop > l:
raise IndexError("out-of-bounds on slice (end)")
diff --git a/pandas/core/internals.py b/pandas/core/internals.py
index bb719722fd090..44a18ef3043b3 100644
--- a/pandas/core/internals.py
+++ b/pandas/core/internals.py
@@ -533,7 +533,7 @@ def to_native_types(self, slicer=None, na_rep='', **kwargs):
values[mask] = na_rep
return values.tolist()
- #### block actions ####
+ # block actions ####
def copy(self, deep=True, ref_items=None):
values = self.values
if deep:
@@ -667,7 +667,7 @@ def putmask(self, mask, new, align=True, inplace=False):
new = self._try_cast(new)
# pseudo-broadcast
- if isinstance(new, np.ndarray) and new.ndim == self.ndim-1:
+ if isinstance(new, np.ndarray) and new.ndim == self.ndim - 1:
new = np.repeat(new, self.shape[-1]).reshape(self.shape)
np.putmask(new_values, mask, new)
@@ -1026,7 +1026,7 @@ def where(self, other, cond, align=True, raise_on_error=True,
# pseodo broadcast (its a 2d vs 1d say and where needs it in a
# specific direction)
- if (other.ndim >= 1 and values.ndim-1 == other.ndim and
+ if (other.ndim >= 1 and values.ndim - 1 == other.ndim and
values.shape[0] != other.shape[0]):
other = _block_shape(other).T
else:
@@ -1201,7 +1201,7 @@ def _try_fill(self, value):
pass
elif com.is_integer(value):
# coerce to seconds of timedelta
- value = np.timedelta64(int(value*1e9))
+ value = np.timedelta64(int(value * 1e9))
elif isinstance(value, timedelta):
value = np.timedelta64(value)
@@ -3035,8 +3035,8 @@ def _add_new_block(self, item, value, loc=None):
# need to shift elements to the right
if self._ref_locs[loc] is not None:
- for i in reversed(lrange(loc+1, len(self._ref_locs))):
- self._ref_locs[i] = self._ref_locs[i-1]
+ for i in reversed(lrange(loc + 1, len(self._ref_locs))):
+ self._ref_locs[i] = self._ref_locs[i - 1]
self._ref_locs[loc] = (new_block, 0)
diff --git a/pandas/core/nanops.py b/pandas/core/nanops.py
index b6ebeb7f96489..3b7320b848f9b 100644
--- a/pandas/core/nanops.py
+++ b/pandas/core/nanops.py
@@ -23,6 +23,7 @@
class disallow(object):
+
def __init__(self, *dtypes):
super(disallow, self).__init__()
self.dtypes = tuple(np.dtype(dtype).type for dtype in dtypes)
@@ -44,6 +45,7 @@ def _f(*args, **kwargs):
class bottleneck_switch(object):
+
def __init__(self, zero_value=None, **kwargs):
self.zero_value = zero_value
self.kwargs = kwargs
diff --git a/pandas/core/ops.py b/pandas/core/ops.py
index 0836ac7bc22a6..b8f988e38f14b 100644
--- a/pandas/core/ops.py
+++ b/pandas/core/ops.py
@@ -230,6 +230,7 @@ def add_flex_arithmetic_methods(cls, flex_arith_method, radd_func=None,
class _TimeOp(object):
+
"""
Wrapper around Series datetime/time/timedelta arithmetic operations.
Generally, you should use classmethod ``maybe_convert_for_time_op`` as an
diff --git a/pandas/core/panelnd.py b/pandas/core/panelnd.py
index 8ac84c0d91adc..a7cfe49484d24 100644
--- a/pandas/core/panelnd.py
+++ b/pandas/core/panelnd.py
@@ -44,7 +44,7 @@ def create_nd_panel_factory(klass_name, orders, slices, slicer, aliases=None,
klass._constructor_sliced = slicer
- #### define the methods ####
+ # define the methods ####
def __init__(self, *args, **kwargs):
if not (kwargs.get('data') or len(args)):
raise Exception(
diff --git a/pandas/core/reshape.py b/pandas/core/reshape.py
index 24a4797759dab..1178a853c6619 100644
--- a/pandas/core/reshape.py
+++ b/pandas/core/reshape.py
@@ -22,6 +22,7 @@
class _Unstacker(object):
+
"""
Helper class to unstack data / pivot with multi-level index
@@ -57,6 +58,7 @@ class _Unstacker(object):
-------
unstacked : DataFrame
"""
+
def __init__(self, values, index, level=-1, value_columns=None):
if values.ndim == 1:
values = values[:, np.newaxis]
diff --git a/pandas/core/strings.py b/pandas/core/strings.py
index 0df9db2ebd06c..12f21df9e7c0e 100644
--- a/pandas/core/strings.py
+++ b/pandas/core/strings.py
@@ -405,7 +405,7 @@ def f(x):
else:
return None
else:
- empty_row = Series(regex.groups*[None])
+ empty_row = Series(regex.groups * [None])
def f(x):
if not isinstance(x, compat.string_types):
@@ -743,6 +743,7 @@ def do_copy(target):
class StringMethods(object):
+
"""
Vectorized string functions for Series. NAs stay NA unless handled
otherwise by a particular method. Patterned after Python's string methods,
@@ -753,6 +754,7 @@ class StringMethods(object):
>>> s.str.split('_')
>>> s.str.replace('_', '')
"""
+
def __init__(self, series):
self.series = series
diff --git a/pandas/tests/test_groupby.py b/pandas/tests/test_groupby.py
index 9df5541615cee..010a65738caa0 100644
--- a/pandas/tests/test_groupby.py
+++ b/pandas/tests/test_groupby.py
@@ -1203,24 +1203,53 @@ def test_groupby_as_index_apply(self):
g_not_as = df.groupby('user_id', as_index=False)
res_as = g_as.head(2).index
- exp_as = MultiIndex.from_tuples([(1, 0), (1, 2), (2, 1), (3, 4)])
+ exp_as = MultiIndex.from_tuples([(1, 0), (2, 1), (1, 2), (3, 4)])
assert_index_equal(res_as, exp_as)
res_not_as = g_not_as.head(2).index
- exp_not_as = Index([0, 2, 1, 4])
+ exp_not_as = Index([0, 1, 2, 4])
assert_index_equal(res_not_as, exp_not_as)
- res_as = g_as.apply(lambda x: x.head(2)).index
- assert_index_equal(res_not_as, exp_not_as)
+ res_as_apply = g_as.apply(lambda x: x.head(2)).index
+ res_not_as_apply = g_not_as.apply(lambda x: x.head(2)).index
- res_not_as = g_not_as.apply(lambda x: x.head(2)).index
- assert_index_equal(res_not_as, exp_not_as)
+ # apply doesn't maintain the original ordering
+ exp_not_as_apply = Index([0, 2, 1, 4])
+ exp_as_apply = MultiIndex.from_tuples([(1, 0), (1, 2), (2, 1), (3, 4)])
+
+ assert_index_equal(res_as_apply, exp_as_apply)
+ assert_index_equal(res_not_as_apply, exp_not_as_apply)
ind = Index(list('abcde'))
df = DataFrame([[1, 2], [2, 3], [1, 4], [1, 5], [2, 6]], index=ind)
res = df.groupby(0, as_index=False).apply(lambda x: x).index
assert_index_equal(res, ind)
+ def test_groupby_head_tail(self):
+ df = DataFrame([[1, 2], [1, 4], [5, 6]], columns=['A', 'B'])
+ g_as = df.groupby('A', as_index=True)
+ g_not_as = df.groupby('A', as_index=False)
+
+ # as_index= False much easier
+ exp_head_not_as = df.loc[[0, 2]]
+ res_head_not_as = g_not_as.head(1)
+ assert_frame_equal(exp_head_not_as, res_head_not_as)
+ exp_tail_not_as = df.loc[[1, 2]]
+ res_tail_not_as = g_not_as.tail(1)
+ assert_frame_equal(exp_tail_not_as, res_tail_not_as)
+
+ # as_index=True, yuck
+ res_head_as = g_as.head(1)
+ res_tail_as = g_as.tail(1)
+
+ # prepend the A column as an index, in a roundabout way
+ df.index = df.set_index('A', append=True, drop=False).index.swaplevel(0, 1)
+ exp_head_as = df.loc[[0, 2]]
+ exp_tail_as = df.loc[[1, 2]]
+
+ assert_frame_equal(exp_head_as, res_head_as)
+ assert_frame_equal(exp_tail_as, res_tail_as)
+
def test_groupby_multiple_key(self):
df = tm.makeTimeDataFrame()
grouped = df.groupby([lambda x: x.year,
| This is some low hanging fruit, significantly faster than master.
To give some numbers, before the change is below the new:
```
In [1]: df = pd.DataFrame(np.random.randint(0, 100, 1000), columns=['A'], index=[0] * 1000); g = df.groupby('A')
In [2]: %timeit g.head(2)
1000 loops, best of 3: 429 µs per loop
#100 loops, best of 3: 9.67 ms per loop
In [3]: %timeit g.tail(2)
1000 loops, best of 3: 398 µs per loop
#100 loops, best of 3: 9.68 ms per loop
In [4]: %timeit g.size()
10000 loops, best of 3: 119 µs per loop
#1000 loops, best of 3: 649 µs per loop
In [11]: df = pd.DataFrame(np.random.randint(0, 10, 1000), columns=['A'], index=[0] * 1000); g = df.groupby('A')
In [12]: %timeit g.head(2)
10000 loops, best of 3: 189 µs per loop
#100 loops, best of 3: 2.1 ms per loop
In [13]: %timeit g.tail(2)
10000 loops, best of 3: 160 µs per loop
#100 loops, best of 3: 2.11 ms per loop
In [14]: %timeit g.size()
10000 loops, best of 3: 41.9 µs per loop
#1000 loops, best of 3: 598 µs per loop
```
...It's a bit messy to keep track of the as_index stuff (which you get when you apply), see below - am I missing some way to grab out the final index ??
| https://api.github.com/repos/pandas-dev/pandas/pulls/5518 | 2013-11-15T00:30:38Z | 2013-11-17T04:41:20Z | null | 2014-08-18T13:12:49Z |
ENH: Have pivot and pivot_table take similar arguments | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 12a83f48706e5..f81369c60fdfd 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -124,6 +124,11 @@ API Changes
DataFrame returned by ``GroupBy.apply`` (:issue:`6124`). This facilitates
``DataFrame.stack`` operations where the name of the column index is used as
the name of the inserted column containing the pivoted data.
+
+- The :func:`pivot_table`/:meth:`DataFrame.pivot_table` and :func:`crosstab` functions
+ now take arguments ``index`` and ``columns`` instead of ``rows`` and ``cols``. A
+ ``FutureWarning`` is raised to alert that the old ``rows`` and ``cols`` arguments
+ will not be supported in a future release (:issue:`5505`)
Experimental Features
~~~~~~~~~~~~~~~~~~~~~
diff --git a/doc/source/v0.14.0.txt b/doc/source/v0.14.0.txt
index cfee48d62928b..8937b94be2b85 100644
--- a/doc/source/v0.14.0.txt
+++ b/doc/source/v0.14.0.txt
@@ -165,6 +165,11 @@ These are out-of-bounds selections
# New output, 4-level MultiIndex
df_multi.set_index([df_multi.index, df_multi.index])
+- The :func:`pivot_table`/:meth:`DataFrame.pivot_table` and :func:`crosstab` functions
+ now take arguments ``index`` and ``columns`` instead of ``rows`` and ``cols``. A
+ ``FutureWarning`` is raised to alert that the old ``rows`` and ``cols`` arguments
+ will not be supported in a future release (:issue:`5505`)
+
MultiIndexing Using Slicers
~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/pandas/tools/pivot.py b/pandas/tools/pivot.py
index a4b229e98ada9..59f1bf3453b1b 100644
--- a/pandas/tools/pivot.py
+++ b/pandas/tools/pivot.py
@@ -1,5 +1,7 @@
# pylint: disable=E1103
+import warnings
+
from pandas import Series, DataFrame
from pandas.core.index import MultiIndex
from pandas.tools.merge import concat
@@ -10,8 +12,8 @@
import numpy as np
-def pivot_table(data, values=None, rows=None, cols=None, aggfunc='mean',
- fill_value=None, margins=False, dropna=True):
+def pivot_table(data, values=None, index=None, columns=None, aggfunc='mean',
+ fill_value=None, margins=False, dropna=True, **kwarg):
"""
Create a spreadsheet-style pivot table as a DataFrame. The levels in the
pivot table will be stored in MultiIndex objects (hierarchical indexes) on
@@ -21,9 +23,9 @@ def pivot_table(data, values=None, rows=None, cols=None, aggfunc='mean',
----------
data : DataFrame
values : column to aggregate, optional
- rows : list of column names or arrays to group on
+ index : list of column names or arrays to group on
Keys to group on the x-axis of the pivot table
- cols : list of column names or arrays to group on
+ columns : list of column names or arrays to group on
Keys to group on the y-axis of the pivot table
aggfunc : function, default numpy.mean, or list of functions
If list of functions passed, the resulting pivot table will have
@@ -35,6 +37,8 @@ def pivot_table(data, values=None, rows=None, cols=None, aggfunc='mean',
Add all row / columns (e.g. for subtotal / grand totals)
dropna : boolean, default True
Do not include columns whose entries are all NaN
+ rows : kwarg only alias of index [deprecated]
+ cols : kwarg only alias of columns [deprecated]
Examples
--------
@@ -50,8 +54,8 @@ def pivot_table(data, values=None, rows=None, cols=None, aggfunc='mean',
7 bar two small 6
8 bar two large 7
- >>> table = pivot_table(df, values='D', rows=['A', 'B'],
- ... cols=['C'], aggfunc=np.sum)
+ >>> table = pivot_table(df, values='D', index=['A', 'B'],
+ ... columns=['C'], aggfunc=np.sum)
>>> table
small large
foo one 1 4
@@ -63,21 +67,43 @@ def pivot_table(data, values=None, rows=None, cols=None, aggfunc='mean',
-------
table : DataFrame
"""
- rows = _convert_by(rows)
- cols = _convert_by(cols)
+ # Parse old-style keyword arguments
+ rows = kwarg.pop('rows', None)
+ if rows is not None:
+ warnings.warn("rows is deprecated, use index", FutureWarning)
+ if index is None:
+ index = rows
+ else:
+ msg = "Can only specify either 'rows' or 'index'"
+ raise TypeError(msg)
+
+ cols = kwarg.pop('cols', None)
+ if cols is not None:
+ warnings.warn("cols is deprecated, use columns", FutureWarning)
+ if columns is None:
+ columns = cols
+ else:
+ msg = "Can only specify either 'cols' or 'columns'"
+ raise TypeError(msg)
+
+ if kwarg:
+ raise TypeError("Unexpected argument(s): %s" % kwarg.keys())
+
+ index = _convert_by(index)
+ columns = _convert_by(columns)
if isinstance(aggfunc, list):
pieces = []
keys = []
for func in aggfunc:
- table = pivot_table(data, values=values, rows=rows, cols=cols,
+ table = pivot_table(data, values=values, index=index, columns=columns,
fill_value=fill_value, aggfunc=func,
margins=margins)
pieces.append(table)
keys.append(func.__name__)
return concat(pieces, keys=keys, axis=1)
- keys = rows + cols
+ keys = index + columns
values_passed = values is not None
if values_passed:
@@ -106,7 +132,7 @@ def pivot_table(data, values=None, rows=None, cols=None, aggfunc='mean',
table = agged
if table.index.nlevels > 1:
to_unstack = [agged.index.names[i]
- for i in range(len(rows), len(keys))]
+ for i in range(len(index), len(keys))]
table = agged.unstack(to_unstack)
if not dropna:
@@ -132,14 +158,14 @@ def pivot_table(data, values=None, rows=None, cols=None, aggfunc='mean',
table = table.fillna(value=fill_value, downcast='infer')
if margins:
- table = _add_margins(table, data, values, rows=rows,
- cols=cols, aggfunc=aggfunc)
+ table = _add_margins(table, data, values, rows=index,
+ cols=columns, aggfunc=aggfunc)
# discard the top level
if values_passed and not values_multi:
table = table[values[0]]
- if len(rows) == 0 and len(cols) > 0:
+ if len(index) == 0 and len(columns) > 0:
table = table.T
return table
@@ -299,8 +325,8 @@ def _convert_by(by):
return by
-def crosstab(rows, cols, values=None, rownames=None, colnames=None,
- aggfunc=None, margins=False, dropna=True):
+def crosstab(index, columns, values=None, rownames=None, colnames=None,
+ aggfunc=None, margins=False, dropna=True, **kwarg):
"""
Compute a simple cross-tabulation of two (or more) factors. By default
computes a frequency table of the factors unless an array of values and an
@@ -308,9 +334,9 @@ def crosstab(rows, cols, values=None, rownames=None, colnames=None,
Parameters
----------
- rows : array-like, Series, or list of arrays/Series
+ index : array-like, Series, or list of arrays/Series
Values to group by in the rows
- cols : array-like, Series, or list of arrays/Series
+ columns : array-like, Series, or list of arrays/Series
Values to group by in the columns
values : array-like, optional
Array of values to aggregate according to the factors
@@ -324,6 +350,8 @@ def crosstab(rows, cols, values=None, rownames=None, colnames=None,
Add row/column margins (subtotals)
dropna : boolean, default True
Do not include columns whose entries are all NaN
+ rows : kwarg only alias of index [deprecated]
+ cols : kwarg only alias of columns [deprecated]
Notes
-----
@@ -353,26 +381,48 @@ def crosstab(rows, cols, values=None, rownames=None, colnames=None,
-------
crosstab : DataFrame
"""
- rows = com._maybe_make_list(rows)
- cols = com._maybe_make_list(cols)
+ # Parse old-style keyword arguments
+ rows = kwarg.pop('rows', None)
+ if rows is not None:
+ warnings.warn("rows is deprecated, use index", FutureWarning)
+ if index is None:
+ index = rows
+ else:
+ msg = "Can only specify either 'rows' or 'index'"
+ raise TypeError(msg)
+
+ cols = kwarg.pop('cols', None)
+ if cols is not None:
+ warnings.warn("cols is deprecated, use columns", FutureWarning)
+ if columns is None:
+ columns = cols
+ else:
+ msg = "Can only specify either 'cols' or 'columns'"
+ raise TypeError(msg)
+
+ if kwarg:
+ raise TypeError("Unexpected argument(s): %s" % kwarg.keys())
+
+ index = com._maybe_make_list(index)
+ columns = com._maybe_make_list(columns)
- rownames = _get_names(rows, rownames, prefix='row')
- colnames = _get_names(cols, colnames, prefix='col')
+ rownames = _get_names(index, rownames, prefix='row')
+ colnames = _get_names(columns, colnames, prefix='col')
data = {}
- data.update(zip(rownames, rows))
- data.update(zip(colnames, cols))
+ data.update(zip(rownames, index))
+ data.update(zip(colnames, columns))
if values is None:
df = DataFrame(data)
df['__dummy__'] = 0
- table = df.pivot_table('__dummy__', rows=rownames, cols=colnames,
+ table = df.pivot_table('__dummy__', index=rownames, columns=colnames,
aggfunc=len, margins=margins, dropna=dropna)
return table.fillna(0).astype(np.int64)
else:
data['__dummy__'] = values
df = DataFrame(data)
- table = df.pivot_table('__dummy__', rows=rownames, cols=colnames,
+ table = df.pivot_table('__dummy__', index=rownames, columns=colnames,
aggfunc=aggfunc, margins=margins, dropna=dropna)
return table
diff --git a/pandas/tools/tests/test_pivot.py b/pandas/tools/tests/test_pivot.py
index 2843433fc61e3..12f0ffa6e8aa5 100644
--- a/pandas/tools/tests/test_pivot.py
+++ b/pandas/tools/tests/test_pivot.py
@@ -1,4 +1,6 @@
import datetime
+import unittest
+import warnings
import numpy as np
from numpy.testing import assert_equal
@@ -30,39 +32,52 @@ def setUp(self):
'F': np.random.randn(11)})
def test_pivot_table(self):
- rows = ['A', 'B']
- cols = 'C'
- table = pivot_table(self.data, values='D', rows=rows, cols=cols)
+ index = ['A', 'B']
+ columns = 'C'
+ table = pivot_table(self.data, values='D', index=index, columns=columns)
- table2 = self.data.pivot_table(values='D', rows=rows, cols=cols)
+ table2 = self.data.pivot_table(values='D', index=index, columns=columns)
tm.assert_frame_equal(table, table2)
# this works
- pivot_table(self.data, values='D', rows=rows)
+ pivot_table(self.data, values='D', index=index)
- if len(rows) > 1:
- self.assertEqual(table.index.names, tuple(rows))
+ if len(index) > 1:
+ self.assertEqual(table.index.names, tuple(index))
else:
- self.assertEqual(table.index.name, rows[0])
+ self.assertEqual(table.index.name, index[0])
- if len(cols) > 1:
- self.assertEqual(table.columns.names, cols)
+ if len(columns) > 1:
+ self.assertEqual(table.columns.names, columns)
else:
- self.assertEqual(table.columns.name, cols[0])
+ self.assertEqual(table.columns.name, columns[0])
- expected = self.data.groupby(rows + [cols])['D'].agg(np.mean).unstack()
+ expected = self.data.groupby(index + [columns])['D'].agg(np.mean).unstack()
tm.assert_frame_equal(table, expected)
+ def test_pivot_table_warnings(self):
+ index = ['A', 'B']
+ columns = 'C'
+ with tm.assert_produces_warning(FutureWarning):
+ table = pivot_table(self.data, values='D', rows=index,
+ cols=columns)
+
+ with tm.assert_produces_warning(False):
+ table2 = pivot_table(self.data, values='D', index=index,
+ columns=columns)
+
+ tm.assert_frame_equal(table, table2)
+
def test_pivot_table_nocols(self):
df = DataFrame({'rows': ['a', 'b', 'c'],
'cols': ['x', 'y', 'z'],
'values': [1,2,3]})
- rs = df.pivot_table(cols='cols', aggfunc=np.sum)
- xp = df.pivot_table(rows='cols', aggfunc=np.sum).T
+ rs = df.pivot_table(columns='cols', aggfunc=np.sum)
+ xp = df.pivot_table(index='cols', aggfunc=np.sum).T
tm.assert_frame_equal(rs, xp)
- rs = df.pivot_table(cols='cols', aggfunc={'values': 'mean'})
- xp = df.pivot_table(rows='cols', aggfunc={'values': 'mean'}).T
+ rs = df.pivot_table(columns='cols', aggfunc={'values': 'mean'})
+ xp = df.pivot_table(index='cols', aggfunc={'values': 'mean'}).T
tm.assert_frame_equal(rs, xp)
def test_pivot_table_dropna(self):
@@ -92,22 +107,22 @@ def test_pivot_table_dropna(self):
def test_pass_array(self):
- result = self.data.pivot_table('D', rows=self.data.A, cols=self.data.C)
- expected = self.data.pivot_table('D', rows='A', cols='C')
+ result = self.data.pivot_table('D', index=self.data.A, columns=self.data.C)
+ expected = self.data.pivot_table('D', index='A', columns='C')
tm.assert_frame_equal(result, expected)
def test_pass_function(self):
- result = self.data.pivot_table('D', rows=lambda x: x // 5,
- cols=self.data.C)
- expected = self.data.pivot_table('D', rows=self.data.index // 5,
- cols='C')
+ result = self.data.pivot_table('D', index=lambda x: x // 5,
+ columns=self.data.C)
+ expected = self.data.pivot_table('D', index=self.data.index // 5,
+ columns='C')
tm.assert_frame_equal(result, expected)
def test_pivot_table_multiple(self):
- rows = ['A', 'B']
- cols = 'C'
- table = pivot_table(self.data, rows=rows, cols=cols)
- expected = self.data.groupby(rows + [cols]).agg(np.mean).unstack()
+ index = ['A', 'B']
+ columns = 'C'
+ table = pivot_table(self.data, index=index, columns=columns)
+ expected = self.data.groupby(index + [columns]).agg(np.mean).unstack()
tm.assert_frame_equal(table, expected)
def test_pivot_dtypes(self):
@@ -116,7 +131,7 @@ def test_pivot_dtypes(self):
f = DataFrame({'a' : ['cat', 'bat', 'cat', 'bat'], 'v' : [1,2,3,4], 'i' : ['a','b','a','b']})
self.assertEqual(f.dtypes['v'], 'int64')
- z = pivot_table(f, values='v', rows=['a'], cols=['i'], fill_value=0, aggfunc=np.sum)
+ z = pivot_table(f, values='v', index=['a'], columns=['i'], fill_value=0, aggfunc=np.sum)
result = z.get_dtype_counts()
expected = Series(dict(int64 = 2))
tm.assert_series_equal(result, expected)
@@ -125,21 +140,21 @@ def test_pivot_dtypes(self):
f = DataFrame({'a' : ['cat', 'bat', 'cat', 'bat'], 'v' : [1.5,2.5,3.5,4.5], 'i' : ['a','b','a','b']})
self.assertEqual(f.dtypes['v'], 'float64')
- z = pivot_table(f, values='v', rows=['a'], cols=['i'], fill_value=0, aggfunc=np.mean)
+ z = pivot_table(f, values='v', index=['a'], columns=['i'], fill_value=0, aggfunc=np.mean)
result = z.get_dtype_counts()
expected = Series(dict(float64 = 2))
tm.assert_series_equal(result, expected)
def test_pivot_multi_values(self):
result = pivot_table(self.data, values=['D', 'E'],
- rows='A', cols=['B', 'C'], fill_value=0)
+ index='A', columns=['B', 'C'], fill_value=0)
expected = pivot_table(self.data.drop(['F'], axis=1),
- rows='A', cols=['B', 'C'], fill_value=0)
+ index='A', columns=['B', 'C'], fill_value=0)
tm.assert_frame_equal(result, expected)
def test_pivot_multi_functions(self):
f = lambda func: pivot_table(self.data, values=['D', 'E'],
- rows=['A', 'B'], cols='C',
+ index=['A', 'B'], columns='C',
aggfunc=func)
result = f([np.mean, np.std])
means = f(np.mean)
@@ -149,7 +164,7 @@ def test_pivot_multi_functions(self):
# margins not supported??
f = lambda func: pivot_table(self.data, values=['D', 'E'],
- rows=['A', 'B'], cols='C',
+ index=['A', 'B'], columns='C',
aggfunc=func, margins=True)
result = f([np.mean, np.std])
means = f(np.mean)
@@ -169,14 +184,14 @@ def test_pivot_index_with_nan(self):
tm.assert_frame_equal(result, expected)
def test_margins(self):
- def _check_output(res, col, rows=['A', 'B'], cols=['C']):
+ def _check_output(res, col, index=['A', 'B'], columns=['C']):
cmarg = res['All'][:-1]
- exp = self.data.groupby(rows)[col].mean()
+ exp = self.data.groupby(index)[col].mean()
tm.assert_series_equal(cmarg, exp)
res = res.sortlevel()
rmarg = res.xs(('All', ''))[:-1]
- exp = self.data.groupby(cols)[col].mean()
+ exp = self.data.groupby(columns)[col].mean()
tm.assert_series_equal(rmarg, exp)
gmarg = res['All']['All', '']
@@ -184,12 +199,12 @@ def _check_output(res, col, rows=['A', 'B'], cols=['C']):
self.assertEqual(gmarg, exp)
# column specified
- table = self.data.pivot_table('D', rows=['A', 'B'], cols='C',
+ table = self.data.pivot_table('D', index=['A', 'B'], columns='C',
margins=True, aggfunc=np.mean)
_check_output(table, 'D')
# no column specified
- table = self.data.pivot_table(rows=['A', 'B'], cols='C',
+ table = self.data.pivot_table(index=['A', 'B'], columns='C',
margins=True, aggfunc=np.mean)
for valcol in table.columns.levels[0]:
_check_output(table[valcol], valcol)
@@ -198,18 +213,18 @@ def _check_output(res, col, rows=['A', 'B'], cols=['C']):
# to help with a buglet
self.data.columns = [k * 2 for k in self.data.columns]
- table = self.data.pivot_table(rows=['AA', 'BB'], margins=True,
+ table = self.data.pivot_table(index=['AA', 'BB'], margins=True,
aggfunc=np.mean)
for valcol in table.columns:
gmarg = table[valcol]['All', '']
self.assertEqual(gmarg, self.data[valcol].mean())
# this is OK
- table = self.data.pivot_table(rows=['AA', 'BB'], margins=True,
+ table = self.data.pivot_table(index=['AA', 'BB'], margins=True,
aggfunc='mean')
# no rows
- rtable = self.data.pivot_table(cols=['AA', 'BB'], margins=True,
+ rtable = self.data.pivot_table(columns=['AA', 'BB'], margins=True,
aggfunc=np.mean)
tm.assert_isinstance(rtable, Series)
for item in ['DD', 'EE', 'FF']:
@@ -223,10 +238,10 @@ def test_pivot_integer_columns(self):
data = list(product(['foo', 'bar'], ['A', 'B', 'C'], ['x1', 'x2'],
[d + datetime.timedelta(i) for i in range(20)], [1.0]))
df = pandas.DataFrame(data)
- table = df.pivot_table(values=4, rows=[0, 1, 3], cols=[2])
+ table = df.pivot_table(values=4, index=[0, 1, 3], columns=[2])
df2 = df.rename(columns=str)
- table2 = df2.pivot_table(values='4', rows=['0', '1', '3'], cols=['2'])
+ table2 = df2.pivot_table(values='4', index=['0', '1', '3'], columns=['2'])
tm.assert_frame_equal(table, table2, check_names=False)
@@ -238,7 +253,7 @@ def test_pivot_no_level_overlap(self):
'c': (['foo'] * 4 + ['bar'] * 4) * 2,
'value': np.random.randn(16)})
- table = data.pivot_table('value', rows='a', cols=['b', 'c'])
+ table = data.pivot_table('value', index='a', columns=['b', 'c'])
grouped = data.groupby(['a', 'b', 'c'])['value'].mean()
expected = grouped.unstack('b').unstack('c').dropna(axis=1, how='all')
@@ -283,8 +298,8 @@ def test_pivot_columns_lexsorted(self):
df = DataFrame(items)
- pivoted = df.pivot_table('Price', rows=['Month', 'Day'],
- cols=['Index', 'Symbol', 'Year'],
+ pivoted = df.pivot_table('Price', index=['Month', 'Day'],
+ columns=['Index', 'Symbol', 'Year'],
aggfunc='mean')
self.assert_(pivoted.columns.is_monotonic)
@@ -292,30 +307,30 @@ def test_pivot_columns_lexsorted(self):
def test_pivot_complex_aggfunc(self):
f = {'D': ['std'], 'E': ['sum']}
expected = self.data.groupby(['A', 'B']).agg(f).unstack('B')
- result = self.data.pivot_table(rows='A', cols='B', aggfunc=f)
+ result = self.data.pivot_table(index='A', columns='B', aggfunc=f)
tm.assert_frame_equal(result, expected)
def test_margins_no_values_no_cols(self):
# Regression test on pivot table: no values or cols passed.
- result = self.data[['A', 'B']].pivot_table(rows=['A', 'B'], aggfunc=len, margins=True)
+ result = self.data[['A', 'B']].pivot_table(index=['A', 'B'], aggfunc=len, margins=True)
result_list = result.tolist()
self.assertEqual(sum(result_list[:-1]), result_list[-1])
def test_margins_no_values_two_rows(self):
# Regression test on pivot table: no values passed but rows are a multi-index
- result = self.data[['A', 'B', 'C']].pivot_table(rows=['A', 'B'], cols='C', aggfunc=len, margins=True)
+ result = self.data[['A', 'B', 'C']].pivot_table(index=['A', 'B'], columns='C', aggfunc=len, margins=True)
self.assertEqual(result.All.tolist(), [3.0, 1.0, 4.0, 3.0, 11.0])
def test_margins_no_values_one_row_one_col(self):
# Regression test on pivot table: no values passed but row and col defined
- result = self.data[['A', 'B']].pivot_table(rows='A', cols='B', aggfunc=len, margins=True)
+ result = self.data[['A', 'B']].pivot_table(index='A', columns='B', aggfunc=len, margins=True)
self.assertEqual(result.All.tolist(), [4.0, 7.0, 11.0])
def test_margins_no_values_two_row_two_cols(self):
# Regression test on pivot table: no values passed but rows and cols are multi-indexed
self.data['D'] = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k']
- result = self.data[['A', 'B', 'C', 'D']].pivot_table(rows=['A', 'B'], cols=['C', 'D'], aggfunc=len, margins=True)
+ result = self.data[['A', 'B', 'C', 'D']].pivot_table(index=['A', 'B'], columns=['C', 'D'], aggfunc=len, margins=True)
self.assertEqual(result.All.tolist(), [3.0, 1.0, 4.0, 3.0, 11.0])
@@ -415,7 +430,7 @@ def test_crosstab_pass_values(self):
df = DataFrame({'foo': a, 'bar': b, 'baz': c, 'values': values})
- expected = df.pivot_table('values', rows=['foo', 'bar'], cols='baz',
+ expected = df.pivot_table('values', index=['foo', 'bar'], cols='baz',
aggfunc=np.sum)
tm.assert_frame_equal(table, expected)
| Right now, there is
```
df.pivot(index=foo, columns=bar, values=baz)
```
and
```
df.pivot_table(rows=foo, cols=bar, values=baz)
```
Because of dirtyness in my data I occasionally have to go back and forth between the two forms (and use `df.pivot_table(..., aggfunc='count')` to see who had the bad data). It would be nice if I didn't have to change the keyword arguments each time and one had an alias of the other. It would also be easier to remember, especially in the trivial case of `cols` vs `columns`. Finally, the two are related operations and having an option for consistent keyword parameters makes sense.
I could make a PR to solve this easy enough, if this is an enhancement you are interested in. I'm not really sure what your stance is on redundant keyword arguments.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5505 | 2013-11-14T23:27:59Z | 2014-03-14T22:41:31Z | 2014-03-14T22:41:31Z | 2014-06-12T15:38:56Z |
CLN: Add more methods to whitelist (for now) | diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py
index 668c665613c0d..c0c94c46a6930 100644
--- a/pandas/core/groupby.py
+++ b/pandas/core/groupby.py
@@ -57,8 +57,14 @@
'resample',
'describe',
'rank', 'quantile', 'count',
- 'fillna', 'dtype']) | _plotting_methods
-
+ 'fillna', 'dtype'
+ 'value_counts',
+ 'mad',
+ 'any', 'all',
+ 'irow', 'take',
+ 'shift', 'tshift',
+ 'ffill', 'bfill',
+ 'pct_change', 'skew']) | _plotting_methods
class GroupByError(Exception):
| No test cases because goal is just to make sure this is not blocked in
0.13. Can do more tweaks later. If I have time I will try to pull
together something to cover what we were discussing in #5480.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5514 | 2013-11-14T12:20:58Z | 2013-12-05T23:35:54Z | null | 2014-06-27T15:02:57Z |
BUG: Fixed various setitem with iterable that does not have a matching length to the indexer (GH5508) | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 59ff48887269e..9516b67d4ca47 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -805,6 +805,8 @@ Bug Fixes
- ``pd.to_timedelta`` of a scalar returns a scalar (:issue:`5410`)
- ``pd.to_timedelta`` accepts ``NaN`` and ``NaT``, returning ``NaT`` instead of raising (:issue:`5437`)
- performance improvements in ``isnull`` on larger size pandas objects
+ - Fixed various setitem with 1d ndarray that does not have a matching
+ length to the indexer (:issue:`5508`)
pandas 0.12.0
-------------
diff --git a/pandas/core/indexing.py b/pandas/core/indexing.py
index c854e0b086994..b462624dde1f5 100644
--- a/pandas/core/indexing.py
+++ b/pandas/core/indexing.py
@@ -365,6 +365,10 @@ def can_do_equal_len():
# per label values
else:
+ if len(labels) != len(value):
+ raise ValueError('Must have equal len keys and value when'
+ ' setting with an iterable')
+
for item, v in zip(labels, value):
setter(item, v)
else:
diff --git a/pandas/tests/test_indexing.py b/pandas/tests/test_indexing.py
index dacac6ef64b29..e01fd6a763ceb 100644
--- a/pandas/tests/test_indexing.py
+++ b/pandas/tests/test_indexing.py
@@ -650,6 +650,35 @@ def test_iloc_getitem_frame(self):
# trying to use a label
self.assertRaises(ValueError, df.iloc.__getitem__, tuple(['j','D']))
+ def test_setitem_ndarray_1d(self):
+ # GH5508
+
+ # len of indexer vs length of the 1d ndarray
+ df = DataFrame(index=Index(lrange(1,11)))
+ df['foo'] = np.zeros(10, dtype=np.float64)
+ df['bar'] = np.zeros(10, dtype=np.complex)
+
+ # invalid
+ def f():
+ df.ix[2:5, 'bar'] = np.array([2.33j, 1.23+0.1j, 2.2])
+ self.assertRaises(ValueError, f)
+
+ # valid
+ df.ix[2:5, 'bar'] = np.array([2.33j, 1.23+0.1j, 2.2, 1.0])
+
+ result = df.ix[2:5, 'bar']
+ expected = Series([2.33j, 1.23+0.1j, 2.2, 1.0],index=[2,3,4,5])
+ assert_series_equal(result,expected)
+
+ # dtype getting changed?
+ df = DataFrame(index=Index(lrange(1,11)))
+ df['foo'] = np.zeros(10, dtype=np.float64)
+ df['bar'] = np.zeros(10, dtype=np.complex)
+
+ def f():
+ df[2:5] = np.arange(1,4)*1j
+ self.assertRaises(ValueError, f)
+
def test_iloc_setitem_series(self):
""" originally from test_series.py """
df = DataFrame(np.random.randn(10, 4), index=list('abcdefghij'), columns=list('ABCD'))
| closes #5508
| https://api.github.com/repos/pandas-dev/pandas/pulls/5512 | 2013-11-14T00:32:11Z | 2013-11-14T01:06:31Z | 2013-11-14T01:06:30Z | 2014-06-24T20:52:21Z |
ENH add cumcount groupby method | diff --git a/doc/source/groupby.rst b/doc/source/groupby.rst
index 7b769eeccbe68..e666bad2317df 100644
--- a/doc/source/groupby.rst
+++ b/doc/source/groupby.rst
@@ -705,3 +705,16 @@ can be used as group keys. If so, the order of the levels will be preserved:
factor = qcut(data, [0, .25, .5, .75, 1.])
data.groupby(factor).mean()
+
+Enumerate group items
+~~~~~~~~~~~~~~~~~~~~~
+
+To see the order in which each row appears within its group, use the
+``cumcount`` method:
+
+.. ipython:: python
+
+ df = pd.DataFrame(list('aaabba'), columns=['A'])
+ df
+
+ df.groupby('A').cumcount()
\ No newline at end of file
diff --git a/doc/source/release.rst b/doc/source/release.rst
index 59ff48887269e..36bc02da3e68d 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -64,6 +64,7 @@ New features
- ``to_csv()`` now outputs datetime objects according to a specified format
string via the ``date_format`` keyword (:issue:`4313`)
- Added ``LastWeekOfMonth`` DateOffset (:issue:`4637`)
+ - Added ``cumcount`` groupby method (:issue:`4646`)
- Added ``FY5253``, and ``FY5253Quarter`` DateOffsets (:issue:`4511`)
- Added ``mode()`` method to ``Series`` and ``DataFrame`` to get the
statistical mode(s) of a column/series. (:issue:`5367`)
diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py
index 668c665613c0d..f37b94cd7f689 100644
--- a/pandas/core/groupby.py
+++ b/pandas/core/groupby.py
@@ -468,6 +468,7 @@ def ohlc(self):
Compute sum of values, excluding missing values
For multiple groupings, the result index will be a MultiIndex
+
"""
return self._cython_agg_general('ohlc')
@@ -480,9 +481,49 @@ def picker(arr):
return np.nan
return self.agg(picker)
+ def cumcount(self):
+ '''
+ Number each item in each group from 0 to the length of that group.
+
+ Essentially this is equivalent to
+
+ >>> self.apply(lambda x: Series(np.arange(len(x)), x.index)).
+
+ Example
+ -------
+
+ >>> df = pd.DataFrame([['a'], ['a'], ['a'], ['b'], ['b'], ['a']], columns=['A'])
+ >>> df
+ A
+ 0 a
+ 1 a
+ 2 a
+ 3 b
+ 4 b
+ 5 a
+ >>> df.groupby('A').cumcount()
+ 0 0
+ 1 1
+ 2 2
+ 3 0
+ 4 1
+ 5 3
+ dtype: int64
+
+ '''
+ index = self.obj.index
+ cumcounts = np.zeros(len(index), dtype='int64')
+ for v in self.indices.values():
+ cumcounts[v] = np.arange(len(v), dtype='int64')
+ return Series(cumcounts, index)
+
+
def _try_cast(self, result, obj):
- """ try to cast the result to our obj original type,
- we may have roundtripped thru object in the mean-time """
+ """
+ try to cast the result to our obj original type,
+ we may have roundtripped thru object in the mean-time
+
+ """
if obj.ndim > 1:
dtype = obj.values.dtype
else:
diff --git a/pandas/tests/test_groupby.py b/pandas/tests/test_groupby.py
index ca74f46122d88..9df5541615cee 100644
--- a/pandas/tests/test_groupby.py
+++ b/pandas/tests/test_groupby.py
@@ -2560,6 +2560,57 @@ def test_groupby_with_empty(self):
grouped = series.groupby(grouper)
assert next(iter(grouped), None) is None
+ def test_cumcount(self):
+ df = DataFrame([['a'], ['a'], ['a'], ['b'], ['a']], columns=['A'])
+ g = df.groupby('A')
+ sg = g.A
+
+ expected = Series([0, 1, 2, 0, 3])
+
+ assert_series_equal(expected, g.cumcount())
+ assert_series_equal(expected, sg.cumcount())
+
+ def test_cumcount_empty(self):
+ ge = DataFrame().groupby()
+ se = Series().groupby()
+
+ e = Series(dtype='int') # edge case, as this is usually considered float
+
+ assert_series_equal(e, ge.cumcount())
+ assert_series_equal(e, se.cumcount())
+
+ def test_cumcount_dupe_index(self):
+ df = DataFrame([['a'], ['a'], ['a'], ['b'], ['a']], columns=['A'], index=[0] * 5)
+ g = df.groupby('A')
+ sg = g.A
+
+ expected = Series([0, 1, 2, 0, 3], index=[0] * 5)
+
+ assert_series_equal(expected, g.cumcount())
+ assert_series_equal(expected, sg.cumcount())
+
+ def test_cumcount_mi(self):
+ mi = MultiIndex.from_tuples([[0, 1], [1, 2], [2, 2], [2, 2], [1, 0]])
+ df = DataFrame([['a'], ['a'], ['a'], ['b'], ['a']], columns=['A'], index=mi)
+ g = df.groupby('A')
+ sg = g.A
+
+ expected = Series([0, 1, 2, 0, 3], index=mi)
+
+ assert_series_equal(expected, g.cumcount())
+ assert_series_equal(expected, sg.cumcount())
+
+ def test_cumcount_groupby_not_col(self):
+ df = DataFrame([['a'], ['a'], ['a'], ['b'], ['a']], columns=['A'], index=[0] * 5)
+ g = df.groupby([0, 0, 0, 1, 0])
+ sg = g.A
+
+ expected = Series([0, 1, 2, 0, 3], index=[0] * 5)
+
+ assert_series_equal(expected, g.cumcount())
+ assert_series_equal(expected, sg.cumcount())
+
+
def test_filter_series(self):
import pandas as pd
s = pd.Series([1, 3, 20, 5, 22, 24, 7])
@@ -3180,7 +3231,7 @@ def test_tab_completion(self):
'min','name','ngroups','nth','ohlc','plot', 'prod',
'size','std','sum','transform','var', 'count', 'head', 'describe',
'cummax', 'dtype', 'quantile', 'rank', 'cumprod', 'tail',
- 'resample', 'cummin', 'fillna', 'cumsum'])
+ 'resample', 'cummin', 'fillna', 'cumsum', 'cumcount'])
self.assertEqual(results, expected)
def assert_fp_equal(a, b):
| closes #4646
Happy to hear ways to make this faster, but I think this is a good convenience function as is.
Update: made significantly faster...
| https://api.github.com/repos/pandas-dev/pandas/pulls/5510 | 2013-11-14T00:13:44Z | 2013-11-14T22:04:00Z | 2013-11-14T22:04:00Z | 2014-06-14T09:29:13Z |
BUG: bug in to_msgpack for timezone aware datetime index | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 17fe4be734f4d..59ff48887269e 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -85,7 +85,7 @@ Experimental Features
(:issue:`4897`).
- Add msgpack support via ``pd.read_msgpack()`` and ``pd.to_msgpack()`` /
``df.to_msgpack()`` for serialization of arbitrary pandas (and python
- objects) in a lightweight portable binary format (:issue:`686`)
+ objects) in a lightweight portable binary format (:issue:`686`, :issue:`5506`)
- Added PySide support for the qtpandas DataFrameModel and DataFrameWidget.
- Added :mod:`pandas.io.gbq` for reading from (and writing to) Google
BigQuery into a DataFrame. (:issue:`4140`)
diff --git a/pandas/core/generic.py b/pandas/core/generic.py
index ba2ba1b482dee..efa083e239f63 100644
--- a/pandas/core/generic.py
+++ b/pandas/core/generic.py
@@ -842,7 +842,7 @@ def to_hdf(self, path_or_buf, key, **kwargs):
from pandas.io import pytables
return pytables.to_hdf(path_or_buf, key, self, **kwargs)
- def to_msgpack(self, path_or_buf, **kwargs):
+ def to_msgpack(self, path_or_buf=None, **kwargs):
"""
msgpack (serialize) object to input file path
diff --git a/pandas/io/packers.py b/pandas/io/packers.py
index adb70a92b8a54..08299738f31a2 100644
--- a/pandas/io/packers.py
+++ b/pandas/io/packers.py
@@ -100,13 +100,14 @@ def to_msgpack(path_or_buf, *args, **kwargs):
def writer(fh):
for a in args:
fh.write(pack(a, **kwargs))
- return fh
if isinstance(path_or_buf, compat.string_types):
with open(path_or_buf, mode) as fh:
writer(fh)
elif path_or_buf is None:
- return writer(compat.BytesIO())
+ buf = compat.BytesIO()
+ writer(buf)
+ return buf.getvalue()
else:
writer(path_or_buf)
@@ -263,17 +264,23 @@ def encode(obj):
return {'typ': 'period_index',
'klass': obj.__class__.__name__,
'name': getattr(obj, 'name', None),
- 'freq': obj.freqstr,
+ 'freq': getattr(obj,'freqstr',None),
'dtype': obj.dtype.num,
'data': convert(obj.asi8)}
elif isinstance(obj, DatetimeIndex):
+ tz = getattr(obj,'tz',None)
+
+ # store tz info and data as UTC
+ if tz is not None:
+ tz = tz.zone
+ obj = obj.tz_convert('UTC')
return {'typ': 'datetime_index',
'klass': obj.__class__.__name__,
'name': getattr(obj, 'name', None),
'dtype': obj.dtype.num,
'data': convert(obj.asi8),
- 'freq': obj.freqstr,
- 'tz': obj.tz}
+ 'freq': getattr(obj,'freqstr',None),
+ 'tz': tz }
elif isinstance(obj, MultiIndex):
return {'typ': 'multi_index',
'klass': obj.__class__.__name__,
@@ -440,7 +447,13 @@ def decode(obj):
return globals()[obj['klass']](data, name=obj['name'], freq=obj['freq'])
elif typ == 'datetime_index':
data = unconvert(obj['data'], np.int64, obj.get('compress'))
- return globals()[obj['klass']](data, freq=obj['freq'], tz=obj['tz'], name=obj['name'])
+ result = globals()[obj['klass']](data, freq=obj['freq'], name=obj['name'])
+ tz = obj['tz']
+
+ # reverse tz conversion
+ if tz is not None:
+ result = result.tz_localize('UTC').tz_convert(tz)
+ return result
elif typ == 'series':
dtype = dtype_for(obj['dtype'])
index = obj['index']
diff --git a/pandas/io/tests/test_packers.py b/pandas/io/tests/test_packers.py
index e5938ecf87b68..6b986fa87ccce 100644
--- a/pandas/io/tests/test_packers.py
+++ b/pandas/io/tests/test_packers.py
@@ -61,18 +61,26 @@ def test_string_io(self):
df = DataFrame(np.random.randn(10,2))
s = df.to_msgpack(None)
- result = read_msgpack(s.getvalue())
+ result = read_msgpack(s)
+ tm.assert_frame_equal(result,df)
+
+ s = df.to_msgpack()
+ result = read_msgpack(s)
+ tm.assert_frame_equal(result,df)
+
+ s = df.to_msgpack()
+ result = read_msgpack(compat.BytesIO(s))
tm.assert_frame_equal(result,df)
s = to_msgpack(None,df)
- result = read_msgpack(s.getvalue())
+ result = read_msgpack(s)
tm.assert_frame_equal(result, df)
with ensure_clean(self.path) as p:
- s = df.to_msgpack(None)
+ s = df.to_msgpack()
fh = open(p,'wb')
- fh.write(s.getvalue())
+ fh.write(s)
fh.close()
result = read_msgpack(p)
tm.assert_frame_equal(result, df)
@@ -80,10 +88,6 @@ def test_string_io(self):
def test_iterator_with_string_io(self):
dfs = [ DataFrame(np.random.randn(10,2)) for i in range(5) ]
- s = to_msgpack(None,*dfs)
- for i, result in enumerate(read_msgpack(s.getvalue(),iterator=True)):
- tm.assert_frame_equal(result,dfs[i])
-
s = to_msgpack(None,*dfs)
for i, result in enumerate(read_msgpack(s,iterator=True)):
tm.assert_frame_equal(result,dfs[i])
@@ -98,7 +102,7 @@ def test_numpy_scalar_float(self):
def test_numpy_scalar_complex(self):
x = np.complex64(np.random.rand() + 1j * np.random.rand())
x_rec = self.encode_decode(x)
- tm.assert_almost_equal(x,x_rec)
+ self.assert_(np.allclose(x, x_rec))
def test_scalar_float(self):
x = np.random.rand()
@@ -108,10 +112,9 @@ def test_scalar_float(self):
def test_scalar_complex(self):
x = np.random.rand() + 1j * np.random.rand()
x_rec = self.encode_decode(x)
- tm.assert_almost_equal(x,x_rec)
+ self.assert_(np.allclose(x, x_rec))
def test_list_numpy_float(self):
- raise nose.SkipTest('buggy test')
x = [np.float32(np.random.rand()) for i in range(5)]
x_rec = self.encode_decode(x)
tm.assert_almost_equal(x,x_rec)
@@ -120,13 +123,11 @@ def test_list_numpy_float_complex(self):
if not hasattr(np, 'complex128'):
raise nose.SkipTest('numpy cant handle complex128')
- # buggy test
- raise nose.SkipTest('buggy test')
x = [np.float32(np.random.rand()) for i in range(5)] + \
[np.complex128(np.random.rand() + 1j * np.random.rand())
for i in range(5)]
x_rec = self.encode_decode(x)
- tm.assert_almost_equal(x,x_rec)
+ self.assert_(np.allclose(x, x_rec))
def test_list_float(self):
x = [np.random.rand() for i in range(5)]
@@ -137,7 +138,7 @@ def test_list_float_complex(self):
x = [np.random.rand() for i in range(5)] + \
[(np.random.rand() + 1j * np.random.rand()) for i in range(5)]
x_rec = self.encode_decode(x)
- tm.assert_almost_equal(x,x_rec)
+ self.assert_(np.allclose(x, x_rec))
def test_dict_float(self):
x = {'foo': 1.0, 'bar': 2.0}
@@ -147,7 +148,8 @@ def test_dict_float(self):
def test_dict_complex(self):
x = {'foo': 1.0 + 1.0j, 'bar': 2.0 + 2.0j}
x_rec = self.encode_decode(x)
- tm.assert_almost_equal(x,x_rec)
+ self.assert_(all(map(lambda x, y: x == y, x.values(), x_rec.values())) and
+ all(map(lambda x, y: type(x) == type(y), x.values(), x_rec.values())))
def test_dict_numpy_float(self):
x = {'foo': np.float32(1.0), 'bar': np.float32(2.0)}
@@ -158,7 +160,9 @@ def test_dict_numpy_complex(self):
x = {'foo': np.complex128(
1.0 + 1.0j), 'bar': np.complex128(2.0 + 2.0j)}
x_rec = self.encode_decode(x)
- tm.assert_almost_equal(x,x_rec)
+ self.assert_(all(map(lambda x, y: x == y, x.values(), x_rec.values())) and
+ all(map(lambda x, y: type(x) == type(y), x.values(), x_rec.values())))
+
def test_numpy_array_float(self):
@@ -173,7 +177,8 @@ def test_numpy_array_float(self):
def test_numpy_array_complex(self):
x = (np.random.rand(5) + 1j * np.random.rand(5)).astype(np.complex128)
x_rec = self.encode_decode(x)
- tm.assert_almost_equal(x,x_rec)
+ self.assert_(all(map(lambda x, y: x == y, x, x_rec)) and
+ x.dtype == x_rec.dtype)
def test_list_mixed(self):
x = [1.0, np.float32(3.5), np.complex128(4.25), u('foo')]
@@ -235,6 +240,16 @@ def test_basic_index(self):
i_rec = self.encode_decode(i)
self.assert_(i.equals(i_rec))
+ # datetime with no freq (GH5506)
+ i = Index([Timestamp('20130101'),Timestamp('20130103')])
+ i_rec = self.encode_decode(i)
+ self.assert_(i.equals(i_rec))
+
+ # datetime with timezone
+ i = Index([Timestamp('20130101 9:00:00'),Timestamp('20130103 11:00:00')]).tz_localize('US/Eastern')
+ i_rec = self.encode_decode(i)
+ self.assert_(i.equals(i_rec))
+
def test_multi_index(self):
for s, i in self.mi.items():
| BUG: bug in to_msgpack for no freqstr datetime index (GH5506)
closes #5506
| https://api.github.com/repos/pandas-dev/pandas/pulls/5507 | 2013-11-13T18:48:54Z | 2013-11-13T19:53:52Z | 2013-11-13T19:53:52Z | 2014-07-16T08:40:20Z |
API/ENH: pass thru store creation arguments for HDFStore; can be used to support in-memory stores | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 6ae7493fb4b72..17fe4be734f4d 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -289,6 +289,7 @@ API Changes
- ``flush`` now accepts an ``fsync`` parameter, which defaults to ``False``
(:issue:`5364`)
- ``unicode`` indices not supported on ``table`` formats (:issue:`5386`)
+ - pass thru store creation arguments; can be used to support in-memory stores
- ``JSON``
- added ``date_unit`` parameter to specify resolution of timestamps.
diff --git a/doc/source/v0.13.0.txt b/doc/source/v0.13.0.txt
index 73800c06669f5..70fc0572ad8fb 100644
--- a/doc/source/v0.13.0.txt
+++ b/doc/source/v0.13.0.txt
@@ -373,6 +373,7 @@ HDFStore API Changes
- add the keyword ``dropna=True`` to ``append`` to change whether ALL nan rows are not written
to the store (default is ``True``, ALL nan rows are NOT written), also settable
via the option ``io.hdf.dropna_table`` (:issue:`4625`)
+- pass thru store creation arguments; can be used to support in-memory stores
Enhancements
~~~~~~~~~~~~
diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py
index bc2f41502614d..49f60a7051ba9 100644
--- a/pandas/io/pytables.py
+++ b/pandas/io/pytables.py
@@ -376,7 +376,7 @@ def __init__(self, path, mode=None, complevel=None, complib=None,
self._complib = complib
self._fletcher32 = fletcher32
self._filters = None
- self.open(mode=mode)
+ self.open(mode=mode, **kwargs)
@property
def root(self):
@@ -465,7 +465,7 @@ def items(self):
iteritems = items
- def open(self, mode='a'):
+ def open(self, mode='a', **kwargs):
"""
Open the file in the specified mode
@@ -502,11 +502,11 @@ def open(self, mode='a'):
fletcher32=self._fletcher32)
try:
- self._handle = tables.openFile(self._path, self._mode)
+ self._handle = tables.openFile(self._path, self._mode, **kwargs)
except (IOError) as e: # pragma: no cover
if 'can not be written' in str(e):
print('Opening %s in read-only mode' % self._path)
- self._handle = tables.openFile(self._path, 'r')
+ self._handle = tables.openFile(self._path, 'r', **kwargs)
else:
raise
except (Exception) as e:
diff --git a/pandas/io/tests/test_pytables.py b/pandas/io/tests/test_pytables.py
index 737acef209a50..759f63a962e57 100644
--- a/pandas/io/tests/test_pytables.py
+++ b/pandas/io/tests/test_pytables.py
@@ -489,6 +489,28 @@ def test_reopen_handle(self):
store.close()
self.assert_(not store.is_open)
+ def test_open_args(self):
+
+ with ensure_clean_path(self.path) as path:
+
+ df = tm.makeDataFrame()
+
+ # create an in memory store
+ store = HDFStore(path,mode='a',driver='H5FD_CORE',driver_core_backing_store=0)
+ store['df'] = df
+ store.append('df2',df)
+
+ tm.assert_frame_equal(store['df'],df)
+ tm.assert_frame_equal(store['df2'],df)
+
+ store.close()
+
+ # only supported on pytable >= 3.0.0
+ if LooseVersion(tables.__version__) >= '3.0.0':
+
+ # the file should not have actually been written
+ self.assert_(os.path.exists(path) is False)
+
def test_flush(self):
with ensure_clean_store(self.path) as store:
| https://api.github.com/repos/pandas-dev/pandas/pulls/5499 | 2013-11-12T17:25:52Z | 2013-11-12T18:09:27Z | 2013-11-12T18:09:27Z | 2014-07-16T08:40:12Z | |
PERF: msgpack encoding changes to use to/from string for speed boosts | diff --git a/pandas/core/common.py b/pandas/core/common.py
index 7f1fe50048599..42964c9d48537 100644
--- a/pandas/core/common.py
+++ b/pandas/core/common.py
@@ -1871,8 +1871,12 @@ def _asarray_tuplesafe(values, dtype=None):
else:
# Making a 1D array that safely contains tuples is a bit tricky
# in numpy, leading to the following
- result = np.empty(len(values), dtype=object)
- result[:] = values
+ try:
+ result = np.empty(len(values), dtype=object)
+ result[:] = values
+ except (ValueError):
+ # we have a list-of-list
+ result[:] = [ tuple(x) for x in values ]
return result
diff --git a/pandas/core/generic.py b/pandas/core/generic.py
index bc80988eb612c..ba2ba1b482dee 100644
--- a/pandas/core/generic.py
+++ b/pandas/core/generic.py
@@ -851,8 +851,8 @@ def to_msgpack(self, path_or_buf, **kwargs):
Parameters
----------
- path : string File path
- args : an object or objects to serialize
+ path : string File path, buffer-like, or None
+ if None, return generated string
append : boolean whether to append to an existing msgpack
(default is False)
compress : type of compressor (zlib or blosc), default to None (no compression)
diff --git a/pandas/io/packers.py b/pandas/io/packers.py
index d6aa1ebeb896a..adb70a92b8a54 100644
--- a/pandas/io/packers.py
+++ b/pandas/io/packers.py
@@ -40,12 +40,13 @@
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
+import os
from datetime import datetime, date, timedelta
from dateutil.parser import parse
import numpy as np
from pandas import compat
-from pandas.compat import u
+from pandas.compat import u, PY3
from pandas import (
Timestamp, Period, Series, DataFrame, Panel, Panel4D,
Index, MultiIndex, Int64Index, PeriodIndex, DatetimeIndex, Float64Index, NaT
@@ -54,6 +55,7 @@
from pandas.sparse.array import BlockIndex, IntIndex
from pandas.core.generic import NDFrame
from pandas.core.common import needs_i8_conversion
+from pandas.io.common import get_filepath_or_buffer
from pandas.core.internals import BlockManager, make_block
import pandas.core.internals as internals
@@ -71,7 +73,7 @@
compressor = None
-def to_msgpack(path, *args, **kwargs):
+def to_msgpack(path_or_buf, *args, **kwargs):
"""
msgpack (serialize) object to input file path
@@ -80,7 +82,8 @@ def to_msgpack(path, *args, **kwargs):
Parameters
----------
- path : string File path
+ path_or_buf : string File path, buffer-like, or None
+ if None, return generated string
args : an object or objects to serialize
append : boolean whether to append to an existing msgpack
(default is False)
@@ -90,17 +93,24 @@ def to_msgpack(path, *args, **kwargs):
compressor = kwargs.pop('compress', None)
append = kwargs.pop('append', None)
if append:
- f = open(path, 'a+b')
+ mode = 'a+b'
else:
- f = open(path, 'wb')
- try:
- for a in args:
- f.write(pack(a, **kwargs))
- finally:
- f.close()
+ mode = 'wb'
+ def writer(fh):
+ for a in args:
+ fh.write(pack(a, **kwargs))
+ return fh
+
+ if isinstance(path_or_buf, compat.string_types):
+ with open(path_or_buf, mode) as fh:
+ writer(fh)
+ elif path_or_buf is None:
+ return writer(compat.BytesIO())
+ else:
+ writer(path_or_buf)
-def read_msgpack(path, iterator=False, **kwargs):
+def read_msgpack(path_or_buf, iterator=False, **kwargs):
"""
Load msgpack pandas object from the specified
file path
@@ -110,8 +120,7 @@ def read_msgpack(path, iterator=False, **kwargs):
Parameters
----------
- path : string
- File path
+ path_or_buf : string File path, BytesIO like or string
iterator : boolean, if True, return an iterator to the unpacker
(default is False)
@@ -120,15 +129,40 @@ def read_msgpack(path, iterator=False, **kwargs):
obj : type of object stored in file
"""
+ path_or_buf, _ = get_filepath_or_buffer(path_or_buf)
if iterator:
- return Iterator(path)
+ return Iterator(path_or_buf)
- with open(path, 'rb') as fh:
+ def read(fh):
l = list(unpack(fh))
if len(l) == 1:
return l[0]
return l
+ # see if we have an actual file
+ if isinstance(path_or_buf, compat.string_types):
+
+ try:
+ path_exists = os.path.exists(path_or_buf)
+ except (TypeError):
+ path_exists = False
+
+ if path_exists:
+ with open(path_or_buf, 'rb') as fh:
+ return read(fh)
+
+ # treat as a string-like
+ if not hasattr(path_or_buf,'read'):
+
+ try:
+ fh = compat.BytesIO(path_or_buf)
+ return read(fh)
+ finally:
+ fh.close()
+
+ # a buffer like
+ return read(path_or_buf)
+
dtype_dict = {21: np.dtype('M8[ns]'),
u('datetime64[ns]'): np.dtype('M8[ns]'),
u('datetime64[us]'): np.dtype('M8[us]'),
@@ -168,6 +202,10 @@ def convert(values):
values = values.view('i8')
v = values.ravel()
+ # convert object
+ if dtype == np.object_:
+ return v.tolist()
+
if compressor == 'zlib':
# return string arrays like they are
@@ -189,12 +227,7 @@ def convert(values):
return blosc.compress(v, typesize=dtype.itemsize)
# ndarray (on original dtype)
- if dtype == 'float64' or dtype == 'int64':
- return v
-
- # as a list
- return v.tolist()
-
+ return v.tostring()
def unconvert(values, dtype, compress=None):
@@ -216,9 +249,8 @@ def unconvert(values, dtype, compress=None):
return np.frombuffer(values, dtype=dtype)
- # as a list
- return np.array(values, dtype=dtype)
-
+ # from a string
+ return np.fromstring(values.encode('latin1'),dtype=dtype)
def encode(obj):
"""
@@ -253,19 +285,20 @@ def encode(obj):
'klass': obj.__class__.__name__,
'name': getattr(obj, 'name', None),
'dtype': obj.dtype.num,
- 'data': obj.tolist()}
+ 'data': convert(obj.values)}
elif isinstance(obj, Series):
if isinstance(obj, SparseSeries):
- d = {'typ': 'sparse_series',
- 'klass': obj.__class__.__name__,
- 'dtype': obj.dtype.num,
- 'index': obj.index,
- 'sp_index': obj.sp_index,
- 'sp_values': convert(obj.sp_values),
- 'compress': compressor}
- for f in ['name', 'fill_value', 'kind']:
- d[f] = getattr(obj, f, None)
- return d
+ raise NotImplementedError("msgpack sparse series is not implemented")
+ #d = {'typ': 'sparse_series',
+ # 'klass': obj.__class__.__name__,
+ # 'dtype': obj.dtype.num,
+ # 'index': obj.index,
+ # 'sp_index': obj.sp_index,
+ # 'sp_values': convert(obj.sp_values),
+ # 'compress': compressor}
+ #for f in ['name', 'fill_value', 'kind']:
+ # d[f] = getattr(obj, f, None)
+ #return d
else:
return {'typ': 'series',
'klass': obj.__class__.__name__,
@@ -276,23 +309,25 @@ def encode(obj):
'compress': compressor}
elif issubclass(tobj, NDFrame):
if isinstance(obj, SparseDataFrame):
- d = {'typ': 'sparse_dataframe',
- 'klass': obj.__class__.__name__,
- 'columns': obj.columns}
- for f in ['default_fill_value', 'default_kind']:
- d[f] = getattr(obj, f, None)
- d['data'] = dict([(name, ss)
- for name, ss in compat.iteritems(obj)])
- return d
+ raise NotImplementedError("msgpack sparse frame is not implemented")
+ #d = {'typ': 'sparse_dataframe',
+ # 'klass': obj.__class__.__name__,
+ # 'columns': obj.columns}
+ #for f in ['default_fill_value', 'default_kind']:
+ # d[f] = getattr(obj, f, None)
+ #d['data'] = dict([(name, ss)
+ # for name, ss in compat.iteritems(obj)])
+ #return d
elif isinstance(obj, SparsePanel):
- d = {'typ': 'sparse_panel',
- 'klass': obj.__class__.__name__,
- 'items': obj.items}
- for f in ['default_fill_value', 'default_kind']:
- d[f] = getattr(obj, f, None)
- d['data'] = dict([(name, df)
- for name, df in compat.iteritems(obj)])
- return d
+ raise NotImplementedError("msgpack sparse frame is not implemented")
+ #d = {'typ': 'sparse_panel',
+ # 'klass': obj.__class__.__name__,
+ # 'items': obj.items}
+ #for f in ['default_fill_value', 'default_kind']:
+ # d[f] = getattr(obj, f, None)
+ #d['data'] = dict([(name, df)
+ # for name, df in compat.iteritems(obj)])
+ #return d
else:
data = obj._data
@@ -354,7 +389,7 @@ def encode(obj):
'klass': obj.__class__.__name__,
'indices': obj.indices,
'length': obj.length}
- elif isinstance(obj, np.ndarray) and obj.dtype not in ['float64', 'int64']:
+ elif isinstance(obj, np.ndarray):
return {'typ': 'ndarray',
'shape': obj.shape,
'ndim': obj.ndim,
@@ -394,14 +429,18 @@ def decode(obj):
return Period(ordinal=obj['ordinal'], freq=obj['freq'])
elif typ == 'index':
dtype = dtype_for(obj['dtype'])
- data = obj['data']
+ data = unconvert(obj['data'], np.typeDict[obj['dtype']], obj.get('compress'))
return globals()[obj['klass']](data, dtype=dtype, name=obj['name'])
elif typ == 'multi_index':
- return globals()[obj['klass']].from_tuples(obj['data'], names=obj['names'])
+ data = unconvert(obj['data'], np.typeDict[obj['dtype']], obj.get('compress'))
+ data = [ tuple(x) for x in data ]
+ return globals()[obj['klass']].from_tuples(data, names=obj['names'])
elif typ == 'period_index':
- return globals()[obj['klass']](obj['data'], name=obj['name'], freq=obj['freq'])
+ data = unconvert(obj['data'], np.int64, obj.get('compress'))
+ return globals()[obj['klass']](data, name=obj['name'], freq=obj['freq'])
elif typ == 'datetime_index':
- return globals()[obj['klass']](obj['data'], freq=obj['freq'], tz=obj['tz'], name=obj['name'])
+ data = unconvert(obj['data'], np.int64, obj.get('compress'))
+ return globals()[obj['klass']](data, freq=obj['freq'], tz=obj['tz'], name=obj['name'])
elif typ == 'series':
dtype = dtype_for(obj['dtype'])
index = obj['index']
@@ -425,17 +464,17 @@ def create_block(b):
return timedelta(*obj['data'])
elif typ == 'timedelta64':
return np.timedelta64(int(obj['data']))
- elif typ == 'sparse_series':
- dtype = dtype_for(obj['dtype'])
- return globals(
- )[obj['klass']](unconvert(obj['sp_values'], dtype, obj['compress']), sparse_index=obj['sp_index'],
- index=obj['index'], fill_value=obj['fill_value'], kind=obj['kind'], name=obj['name'])
- elif typ == 'sparse_dataframe':
- return globals()[obj['klass']](obj['data'],
- columns=obj['columns'], default_fill_value=obj['default_fill_value'], default_kind=obj['default_kind'])
- elif typ == 'sparse_panel':
- return globals()[obj['klass']](obj['data'],
- items=obj['items'], default_fill_value=obj['default_fill_value'], default_kind=obj['default_kind'])
+ #elif typ == 'sparse_series':
+ # dtype = dtype_for(obj['dtype'])
+ # return globals(
+ # )[obj['klass']](unconvert(obj['sp_values'], dtype, obj['compress']), sparse_index=obj['sp_index'],
+ # index=obj['index'], fill_value=obj['fill_value'], kind=obj['kind'], name=obj['name'])
+ #elif typ == 'sparse_dataframe':
+ # return globals()[obj['klass']](obj['data'],
+ # columns=obj['columns'], default_fill_value=obj['default_fill_value'], default_kind=obj['default_kind'])
+ #elif typ == 'sparse_panel':
+ # return globals()[obj['klass']](obj['data'],
+ # items=obj['items'], default_fill_value=obj['default_fill_value'], default_kind=obj['default_kind'])
elif typ == 'block_index':
return globals()[obj['klass']](obj['length'], obj['blocs'], obj['blengths'])
elif typ == 'int_index':
@@ -460,7 +499,7 @@ def create_block(b):
def pack(o, default=encode,
- encoding='utf-8', unicode_errors='strict', use_single_float=False):
+ encoding='latin1', unicode_errors='strict', use_single_float=False):
"""
Pack an object and return the packed bytes.
"""
@@ -471,7 +510,7 @@ def pack(o, default=encode,
def unpack(packed, object_hook=decode,
- list_hook=None, use_list=False, encoding='utf-8',
+ list_hook=None, use_list=False, encoding='latin1',
unicode_errors='strict', object_pairs_hook=None):
"""
Unpack a packed object, return an iterator
@@ -488,7 +527,7 @@ def unpack(packed, object_hook=decode,
class Packer(_Packer):
def __init__(self, default=encode,
- encoding='utf-8',
+ encoding='latin1',
unicode_errors='strict',
use_single_float=False):
super(Packer, self).__init__(default=default,
@@ -501,7 +540,7 @@ class Unpacker(_Unpacker):
def __init__(self, file_like=None, read_size=0, use_list=False,
object_hook=decode,
- object_pairs_hook=None, list_hook=None, encoding='utf-8',
+ object_pairs_hook=None, list_hook=None, encoding='latin1',
unicode_errors='strict', max_buffer_size=0):
super(Unpacker, self).__init__(file_like=file_like,
read_size=read_size,
@@ -525,10 +564,36 @@ def __init__(self, path, **kwargs):
def __iter__(self):
+ needs_closing = True
try:
- fh = open(self.path, 'rb')
+
+ # see if we have an actual file
+ if isinstance(self.path, compat.string_types):
+
+ try:
+ path_exists = os.path.exists(self.path)
+ except (TypeError):
+ path_exists = False
+
+ if path_exists:
+ fh = open(self.path, 'rb')
+ else:
+ fh = compat.BytesIO(self.path)
+
+ else:
+
+ if not hasattr(self.path,'read'):
+ fh = compat.BytesIO(self.path)
+
+ else:
+
+ # a file-like
+ needs_closing = False
+ fh = self.path
+
unpacker = unpack(fh)
for o in unpacker:
yield o
finally:
- fh.close()
+ if needs_closing:
+ fh.close()
diff --git a/pandas/io/tests/test_packers.py b/pandas/io/tests/test_packers.py
index 79b421ff7b047..e5938ecf87b68 100644
--- a/pandas/io/tests/test_packers.py
+++ b/pandas/io/tests/test_packers.py
@@ -55,36 +55,66 @@ def encode_decode(self, x, **kwargs):
to_msgpack(p, x, **kwargs)
return read_msgpack(p, **kwargs)
+class TestAPI(Test):
+
+ def test_string_io(self):
+
+ df = DataFrame(np.random.randn(10,2))
+ s = df.to_msgpack(None)
+ result = read_msgpack(s.getvalue())
+ tm.assert_frame_equal(result,df)
+
+ s = to_msgpack(None,df)
+ result = read_msgpack(s.getvalue())
+ tm.assert_frame_equal(result, df)
+
+ with ensure_clean(self.path) as p:
+
+ s = df.to_msgpack(None)
+ fh = open(p,'wb')
+ fh.write(s.getvalue())
+ fh.close()
+ result = read_msgpack(p)
+ tm.assert_frame_equal(result, df)
+
+ def test_iterator_with_string_io(self):
+
+ dfs = [ DataFrame(np.random.randn(10,2)) for i in range(5) ]
+ s = to_msgpack(None,*dfs)
+ for i, result in enumerate(read_msgpack(s.getvalue(),iterator=True)):
+ tm.assert_frame_equal(result,dfs[i])
+
+ s = to_msgpack(None,*dfs)
+ for i, result in enumerate(read_msgpack(s,iterator=True)):
+ tm.assert_frame_equal(result,dfs[i])
class TestNumpy(Test):
def test_numpy_scalar_float(self):
x = np.float32(np.random.rand())
x_rec = self.encode_decode(x)
- self.assert_(np.allclose(x, x_rec) and type(x) == type(x_rec))
+ tm.assert_almost_equal(x,x_rec)
def test_numpy_scalar_complex(self):
x = np.complex64(np.random.rand() + 1j * np.random.rand())
x_rec = self.encode_decode(x)
- self.assert_(np.allclose(x, x_rec) and type(x) == type(x_rec))
+ tm.assert_almost_equal(x,x_rec)
def test_scalar_float(self):
x = np.random.rand()
x_rec = self.encode_decode(x)
- self.assert_(np.allclose(x, x_rec) and type(x) == type(x_rec))
+ tm.assert_almost_equal(x,x_rec)
def test_scalar_complex(self):
x = np.random.rand() + 1j * np.random.rand()
x_rec = self.encode_decode(x)
- self.assert_(np.allclose(x, x_rec) and type(x) == type(x_rec))
+ tm.assert_almost_equal(x,x_rec)
def test_list_numpy_float(self):
raise nose.SkipTest('buggy test')
x = [np.float32(np.random.rand()) for i in range(5)]
x_rec = self.encode_decode(x)
- self.assert_(all(map(lambda x, y:
- x == y, x, x_rec)) and
- all(map(lambda x, y: type(x) == type(y), x, x_rec)))
+ tm.assert_almost_equal(x,x_rec)
def test_list_numpy_float_complex(self):
if not hasattr(np, 'complex128'):
@@ -96,65 +126,59 @@ def test_list_numpy_float_complex(self):
[np.complex128(np.random.rand() + 1j * np.random.rand())
for i in range(5)]
x_rec = self.encode_decode(x)
- self.assert_(all(map(lambda x, y: x == y, x, x_rec)) and
- all(map(lambda x, y: type(x) == type(y), x, x_rec)))
+ tm.assert_almost_equal(x,x_rec)
def test_list_float(self):
x = [np.random.rand() for i in range(5)]
x_rec = self.encode_decode(x)
- self.assert_(all(map(lambda x, y: x == y, x, x_rec)) and
- all(map(lambda x, y: type(x) == type(y), x, x_rec)))
+ tm.assert_almost_equal(x,x_rec)
def test_list_float_complex(self):
x = [np.random.rand() for i in range(5)] + \
[(np.random.rand() + 1j * np.random.rand()) for i in range(5)]
x_rec = self.encode_decode(x)
- self.assert_(all(map(lambda x, y: x == y, x, x_rec)) and
- all(map(lambda x, y: type(x) == type(y), x, x_rec)))
+ tm.assert_almost_equal(x,x_rec)
def test_dict_float(self):
x = {'foo': 1.0, 'bar': 2.0}
x_rec = self.encode_decode(x)
- self.assert_(all(map(lambda x, y: x == y, x.values(), x_rec.values())) and
- all(map(lambda x, y: type(x) == type(y), x.values(), x_rec.values())))
+ tm.assert_almost_equal(x,x_rec)
def test_dict_complex(self):
x = {'foo': 1.0 + 1.0j, 'bar': 2.0 + 2.0j}
x_rec = self.encode_decode(x)
- self.assert_(all(map(lambda x, y: x == y, x.values(), x_rec.values())) and
- all(map(lambda x, y: type(x) == type(y), x.values(), x_rec.values())))
+ tm.assert_almost_equal(x,x_rec)
def test_dict_numpy_float(self):
x = {'foo': np.float32(1.0), 'bar': np.float32(2.0)}
x_rec = self.encode_decode(x)
- self.assert_(all(map(lambda x, y: x == y, x.values(), x_rec.values())) and
- all(map(lambda x, y: type(x) == type(y), x.values(), x_rec.values())))
+ tm.assert_almost_equal(x,x_rec)
def test_dict_numpy_complex(self):
x = {'foo': np.complex128(
1.0 + 1.0j), 'bar': np.complex128(2.0 + 2.0j)}
x_rec = self.encode_decode(x)
- self.assert_(all(map(lambda x, y: x == y, x.values(), x_rec.values())) and
- all(map(lambda x, y: type(x) == type(y), x.values(), x_rec.values())))
+ tm.assert_almost_equal(x,x_rec)
def test_numpy_array_float(self):
- x = np.random.rand(5).astype(np.float32)
- x_rec = self.encode_decode(x)
- self.assert_(all(map(lambda x, y: x == y, x, x_rec)) and
- x.dtype == x_rec.dtype)
+
+ # run multiple times
+ for n in range(10):
+ x = np.random.rand(10)
+ for dtype in ['float32','float64']:
+ x = x.astype(dtype)
+ x_rec = self.encode_decode(x)
+ tm.assert_almost_equal(x,x_rec)
def test_numpy_array_complex(self):
x = (np.random.rand(5) + 1j * np.random.rand(5)).astype(np.complex128)
x_rec = self.encode_decode(x)
- self.assert_(all(map(lambda x, y: x == y, x, x_rec)) and
- x.dtype == x_rec.dtype)
+ tm.assert_almost_equal(x,x_rec)
def test_list_mixed(self):
x = [1.0, np.float32(3.5), np.complex128(4.25), u('foo')]
x_rec = self.encode_decode(x)
- self.assert_(all(map(lambda x, y: x == y, x, x_rec)) and
- all(map(lambda x, y: type(x) == type(y), x, x_rec)))
-
+ tm.assert_almost_equal(x,x_rec)
class TestBasic(Test):
@@ -219,8 +243,12 @@ def test_multi_index(self):
def test_unicode(self):
i = tm.makeUnicodeIndex(100)
- i_rec = self.encode_decode(i)
- self.assert_(i.equals(i_rec))
+
+ # this currently fails
+ self.assertRaises(UnicodeEncodeError, self.encode_decode, i)
+
+ #i_rec = self.encode_decode(i)
+ #self.assert_(i.equals(i_rec))
class TestSeries(Test):
@@ -255,9 +283,11 @@ def setUp(self):
def test_basic(self):
- for s, i in self.d.items():
- i_rec = self.encode_decode(i)
- assert_series_equal(i, i_rec)
+ # run multiple times here
+ for n in range(10):
+ for s, i in self.d.items():
+ i_rec = self.encode_decode(i)
+ assert_series_equal(i, i_rec)
class TestNDFrame(Test):
@@ -326,8 +356,10 @@ class TestSparse(Test):
def _check_roundtrip(self, obj, comparator, **kwargs):
- i_rec = self.encode_decode(obj)
- comparator(obj, i_rec, **kwargs)
+ # currently these are not implemetned
+ #i_rec = self.encode_decode(obj)
+ #comparator(obj, i_rec, **kwargs)
+ self.assertRaises(NotImplementedError, self.encode_decode, obj)
def test_sparse_series(self):
diff --git a/pandas/msgpack.pyx b/pandas/msgpack.pyx
index 2c8d7fd014b94..4413e2c0986ab 100644
--- a/pandas/msgpack.pyx
+++ b/pandas/msgpack.pyx
@@ -172,10 +172,6 @@ cdef class Packer(object):
cdef object dtype
cdef int n,i
- cdef double f8val
- cdef int64_t i8val
- cdef ndarray[float64_t,ndim=1] array_double
- cdef ndarray[int64_t,ndim=1] array_int
if nest_limit < 0:
raise PackValueError("recursion limit exceeded.")
@@ -241,44 +237,6 @@ cdef class Packer(object):
ret = self._pack(v, nest_limit-1)
if ret != 0: break
- # ndarray support ONLY (and float64/int64) for now
- elif isinstance(o, np.ndarray) and not hasattr(o,'values') and (o.dtype == 'float64' or o.dtype == 'int64'):
-
- ret = msgpack_pack_map(&self.pk, 5)
- if ret != 0: return -1
-
- dtype = o.dtype
- self.pack_pair('typ', 'ndarray', nest_limit)
- self.pack_pair('shape', o.shape, nest_limit)
- self.pack_pair('ndim', o.ndim, nest_limit)
- self.pack_pair('dtype', dtype.num, nest_limit)
-
- ret = self._pack('data', nest_limit-1)
- if ret != 0: return ret
-
- if dtype == 'float64':
- array_double = o.ravel()
- n = len(array_double)
- ret = msgpack_pack_array(&self.pk, n)
- if ret != 0: return ret
-
- for i in range(n):
-
- f8val = array_double[i]
- ret = msgpack_pack_double(&self.pk, f8val)
- if ret != 0: break
- elif dtype == 'int64':
- array_int = o.ravel()
- n = len(array_int)
- ret = msgpack_pack_array(&self.pk, n)
- if ret != 0: return ret
-
- for i in range(n):
-
- i8val = array_int[i]
- ret = msgpack_pack_long_long(&self.pk, i8val)
- if ret != 0: break
-
elif self._default:
o = self._default(o)
ret = self._pack(o, nest_limit-1)
| API: disable sparse structure encodings and unicode indexes
```
-------------------------------------------------------------------------------
Test name | head[ms] | base[ms] | ratio |
-------------------------------------------------------------------------------
packers_read_pack | 3.5113 | 17.8316 | 0.1969 |
packers_read_pickle | 0.6769 | 0.6770 | 0.9999 |
packers_write_pack | 1.8814 | 3.5230 | 0.5340 |
packers_write_pickle | 1.5387 | 1.4664 | 1.0493 |
packers_write_hdf_store | 12.1900 | 12.2033 | 0.9989 |
packers_read_csv | 52.3347 | 52.2310 | 1.0020 |
packers_write_csv | 536.2056 | 526.5187 | 1.0184 |
packers_write_hdf_table | 33.3436 | 32.4137 | 1.0287 |
packers_read_hdf_store | 8.3120 | 8.0493 | 1.0326 |
packers_read_hdf_table | 13.9607 | 12.9707 | 1.0763 |
-------------------------------------------------------------------------------
Test name | head[ms] | base[ms] | ratio |
-------------------------------------------------------------------------------
Ratio < 1.0 means the target commit is faster then the baseline.
Seed used: 1234
Target [381e86b] : PERF: msgpack encoding changnes to use to/from string for speed boosts
API: disable sparse structure encodings and unicode indexes
Base [46008ec] : DOC: add cookbook entry
```
```
In [1]: from pandas.io.packers import pack
In [2]: import cPickle as pkl
In [3]: df = pd.DataFrame(np.random.rand(1000, 100))
In [6]: %timeit buf = pack(df)
1000 loops, best of 3: 492 ᄉs per loop
In [7]: %timeit buf = pkl.dumps(df,pkl.HIGHEST_PROTOCOL)
1000 loops, best of 3: 681 ᄉs per loop
In [8]: df = pd.DataFrame(np.random.rand(100000, 100))
In [11]: %timeit buf = pack(df)
1 loops, best of 3: 184 ms per loop
In [12]: %timeit buf = pkl.dumps(df,pkl.HIGHEST_PROTOCOL)
10 loops, best of 3: 111 ms per loop
```
now pretty competitive with pickle
note on bigger frames, writing an in-memory hdf file is quite fast
```
In [3]: def f(x):
...: store = pd.HDFStore('test.h5',mode='w',driver='H5FD_CORE',driver_core_backing_store=0)
...: store['df'] = x
...: store.close()
...:
In [11]: df = pd.DataFrame(np.random.rand(100000, 100))
In [13]: %timeit -n 5 buf = pack(df)
5 loops, best of 3: 202 ms per loop
In [14]: %timeit -n 5 buf = pkl.dumps(df,pkl.HIGHEST_PROTOCOL)
5 loops, best of 3: 115 ms per loop
In [15]: %timeit -n 5 f(df)
5 loops, best of 3: 53.9 ms per loop
```
| https://api.github.com/repos/pandas-dev/pandas/pulls/5498 | 2013-11-12T15:39:50Z | 2013-11-13T14:13:45Z | 2013-11-13T14:13:45Z | 2021-10-26T16:20:50Z |
ENH: accept mutliple series for FRED DataReader | diff --git a/doc/source/release.rst b/doc/source/release.rst
index ccc34a4051508..07efacc0bf641 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -219,6 +219,7 @@ Improvements to existing features
option it is no longer possible to round trip Excel files with merged
MultiIndex and Hierarchical Rows. Set the ``merge_cells`` to ``False`` to
restore the previous behaviour. (:issue:`5254`)
+ - The FRED DataReader now accepts multiple series (:issue`3413`)
API Changes
~~~~~~~~~~~
diff --git a/doc/source/remote_data.rst b/doc/source/remote_data.rst
index b950876738852..1c9893ec7bd02 100644
--- a/doc/source/remote_data.rst
+++ b/doc/source/remote_data.rst
@@ -80,7 +80,9 @@ FRED
gdp=web.DataReader("GDP", "fred", start, end)
gdp.ix['2013-01-01']
-
+ # Multiple series:
+ inflation = web.DataReader(["CPIAUCSL", "CPILFESL"], "fred", start, end)
+ inflation.head()
.. _remote_data.ff:
Fama/French
diff --git a/pandas/io/data.py b/pandas/io/data.py
index cb9f096a1d07a..cf49515cac576 100644
--- a/pandas/io/data.py
+++ b/pandas/io/data.py
@@ -17,7 +17,7 @@
)
import pandas.compat as compat
from pandas import Panel, DataFrame, Series, read_csv, concat
-from pandas.core.common import PandasError
+from pandas.core.common import is_list_like, PandasError
from pandas.io.parsers import TextParser
from pandas.io.common import urlopen, ZipFile, urlencode
from pandas.util.testing import _network_error_classes
@@ -41,8 +41,9 @@ def DataReader(name, data_source=None, start=None, end=None,
Parameters
----------
- name : str
- the name of the dataset
+ name : str or list of strs
+ the name of the dataset. Some data sources (yahoo, google, fred) will
+ accept a list of names.
data_source: str
the data source ("yahoo", "google", "fred", or "ff")
start : {datetime, None}
@@ -436,24 +437,37 @@ def get_data_fred(name, start=dt.datetime(2010, 1, 1),
Date format is datetime
Returns a DataFrame.
+
+ If multiple names are passed for "series" then the index of the
+ DataFrame is the outer join of the indicies of each series.
"""
start, end = _sanitize_dates(start, end)
fred_URL = "http://research.stlouisfed.org/fred2/series/"
- url = fred_URL + '%s' % name + '/downloaddata/%s' % name + '.csv'
- with urlopen(url) as resp:
- data = read_csv(resp, index_col=0, parse_dates=True,
- header=None, skiprows=1, names=["DATE", name],
- na_values='.')
- try:
- return data.truncate(start, end)
- except KeyError:
- if data.ix[3].name[7:12] == 'Error':
- raise IOError("Failed to get the data. Check that {0!r} is "
- "a valid FRED series.".format(name))
- raise
+ if not is_list_like(name):
+ names = [name]
+ else:
+ names = name
+ urls = [fred_URL + '%s' % n + '/downloaddata/%s' % n + '.csv' for
+ n in names]
+
+ def fetch_data(url, name):
+ with urlopen(url) as resp:
+ data = read_csv(resp, index_col=0, parse_dates=True,
+ header=None, skiprows=1, names=["DATE", name],
+ na_values='.')
+ try:
+ return data.truncate(start, end)
+ except KeyError:
+ if data.ix[3].name[7:12] == 'Error':
+ raise IOError("Failed to get the data. Check that {0!r} is "
+ "a valid FRED series.".format(name))
+ raise
+ df = concat([fetch_data(url, n) for url, n in zip(urls, names)],
+ axis=1, join='outer')
+ return df
def get_data_famafrench(name):
# path of zip files
diff --git a/pandas/io/tests/test_data.py b/pandas/io/tests/test_data.py
index 4e2331f05001d..8ba770aa31939 100644
--- a/pandas/io/tests/test_data.py
+++ b/pandas/io/tests/test_data.py
@@ -16,6 +16,10 @@
import pandas.util.testing as tm
from numpy.testing import assert_array_equal
+if compat.PY3:
+ from urllib.error import HTTPError
+else:
+ from urllib2 import HTTPError
def _skip_if_no_lxml():
try:
@@ -422,6 +426,24 @@ def test_invalid_series(self):
name = "NOT A REAL SERIES"
self.assertRaises(Exception, web.get_data_fred, name)
+ @network
+ def test_fred_multi(self):
+ names = ['CPIAUCSL', 'CPALTT01USQ661S', 'CPILFESL']
+ start = datetime(2010, 1, 1)
+ end = datetime(2013, 1, 27)
+
+ received = web.DataReader(names, "fred", start, end).head(1)
+ expected = DataFrame([[217.478, 0.99701529, 220.544]], columns=names,
+ index=[pd.tslib.Timestamp('2010-01-01 00:00:00')])
+ expected.index.rename('DATE', inplace=True)
+ assert_frame_equal(received, expected, check_less_precise=True)
+
+ @network
+ def test_fred_multi_bad_series(self):
+
+ names = ['NOTAREALSERIES', 'CPIAUCSL', "ALSO FAKE"]
+ with tm.assertRaises(HTTPError):
+ DataReader(names, data_source="fred")
if __name__ == '__main__':
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
| closes #3413
Let me know if you want this for .13 or .14 and I'll fill in the release notes appropriately.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5492 | 2013-11-11T15:22:23Z | 2013-11-27T18:31:21Z | 2013-11-27T18:31:21Z | 2016-11-03T12:37:37Z |
print_versions.py fixes | diff --git a/ci/print_versions.py b/ci/print_versions.py
index 900c7c15db42e..463d31ac1d1d3 100755
--- a/ci/print_versions.py
+++ b/ci/print_versions.py
@@ -2,15 +2,15 @@
def show_versions():
- import subprocess
+ import imp
import os
fn = __file__
this_dir = os.path.dirname(fn)
- pandas_dir = os.path.dirname(this_dir)
- sv_path = os.path.join(pandas_dir, 'pandas', 'util',
- 'print_versions.py')
- return subprocess.check_call(['python', sv_path])
+ pandas_dir = os.path.abspath(os.path.join(this_dir,".."))
+ sv_path = os.path.join(pandas_dir, 'pandas','util')
+ mod = imp.load_module('pvmod', *imp.find_module('print_versions', [sv_path]))
+ return mod.show_versions()
if __name__ == '__main__':
- show_versions()
+ return show_versions()
| #4760
#4901
1. Path resolution was broken, so running the script outside the pandas root directory didn't work.
2. The use of `subprocess` to invoke the script from the source tree relied on system python,
ignoring the interpreter version actually used to invoke the scripts. Travis was unaffected since the system python there
always matches the python version of the env.
3. Using subprocess meant Ctrl-C didn't interrupt the script (meh).
cc @cpcloud
| https://api.github.com/repos/pandas-dev/pandas/pulls/5486 | 2013-11-10T21:48:16Z | 2013-11-10T21:48:36Z | 2013-11-10T21:48:36Z | 2014-07-16T08:40:00Z |
PERF: perf regression with mixed-type ops using numexpr (GH5481) | diff --git a/pandas/core/frame.py b/pandas/core/frame.py
index d8a722ff1439e..1222b5b93799d 100644
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -2810,11 +2810,28 @@ def _arith_op(left, right):
return func(left, right)
if this._is_mixed_type or other._is_mixed_type:
- # XXX no good for duplicate columns
- # but cannot outer join in align if dups anyways?
- result = {}
- for col in this:
- result[col] = _arith_op(this[col].values, other[col].values)
+
+ # unique
+ if this.columns.is_unique:
+
+ def f(col):
+ r = _arith_op(this[col].values, other[col].values)
+ return self._constructor_sliced(r,index=new_index,dtype=r.dtype)
+
+ result = dict([ (col, f(col)) for col in this ])
+
+ # non-unique
+ else:
+
+ def f(i):
+ r = _arith_op(this.iloc[:,i].values, other.iloc[:,i].values)
+ return self._constructor_sliced(r,index=new_index,dtype=r.dtype)
+
+ result = dict([ (i,f(i)) for i, col in enumerate(this.columns) ])
+ result = self._constructor(result, index=new_index, copy=False)
+ result.columns = new_columns
+ return result
+
else:
result = _arith_op(this.values, other.values)
@@ -2890,10 +2907,12 @@ def _compare(a, b):
# non-unique
else:
def _compare(a, b):
- return [func(a.iloc[:,i], b.iloc[:,i]) for i, col in enumerate(a.columns)]
+ return dict([(i,func(a.iloc[:,i], b.iloc[:,i])) for i, col in enumerate(a.columns)])
new_data = expressions.evaluate(_compare, str_rep, self, other)
- return self._constructor(data=new_data, index=self.columns,
- columns=self.index, copy=False).T
+ result = self._constructor(data=new_data, index=self.index,
+ copy=False)
+ result.columns = self.columns
+ return result
def _compare_frame(self, other, func, str_rep):
if not self._indexed_same(other):
diff --git a/pandas/tests/test_frame.py b/pandas/tests/test_frame.py
index ffc40ffbadc39..5762171b38918 100644
--- a/pandas/tests/test_frame.py
+++ b/pandas/tests/test_frame.py
@@ -3217,6 +3217,15 @@ def check(result, expected=None):
this_df['A'] = index
check(this_df, expected_df)
+ # operations
+ for op in ['__add__','__mul__','__sub__','__truediv__']:
+ df = DataFrame(dict(A = np.arange(10), B = np.random.rand(10)))
+ expected = getattr(df,op)(df)
+ expected.columns = ['A','A']
+ df.columns = ['A','A']
+ result = getattr(df,op)(df)
+ check(result,expected)
+
def test_column_dups_indexing(self):
def check(result, expected=None):
| closes #5481
BUG: non-unique ops not aligning correctly
these are bascially a trivial op in numpy, so numexpr is slightly slower (but the
the dtype inference issue is fixed). Essentially the recreation of an int64 ndarray had to check if its a datetime-like. In this case just passing in the dtype on the reconstructed series fixes it.
Also handles non-unique columns now (no tests before, and it would fail).
```
In [1]: df = pd.DataFrame({"A": np.arange(1000000), "B": np.arange(1000000, 0, -1), "C": np.random.randn(1000000)})
In [2]: pd.computation.expressions.set_use_numexpr(False)
In [3]: %timeit df*df
100 loops, best of 3: 11 ms per loop
In [4]: pd.computation.expressions.set_use_numexpr(True)
In [5]: %timeit df*df
100 loops, best of 3: 15.7 ms per loop
In [6]: df = df.astype(float)
In [7]: pd.computation.expressions.set_use_numexpr(False)
In [8]: %timeit df*df
100 loops, best of 3: 5.16 ms per loop
In [9]: pd.computation.expressions.set_use_numexpr(True)
In [10]: %timeit df*df
100 loops, best of 3: 5.37 ms per loop
```
| https://api.github.com/repos/pandas-dev/pandas/pulls/5482 | 2013-11-10T17:44:26Z | 2013-11-10T18:47:39Z | 2013-11-10T18:47:39Z | 2014-06-18T10:04:21Z |
VIS/ENH Hexbin plot | diff --git a/doc/source/release.rst b/doc/source/release.rst
index be6d5d464cb36..35ce6c9359d56 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -53,6 +53,8 @@ pandas 0.14.0
New features
~~~~~~~~~~~~
+- Hexagonal bin plots from ``DataFrame.plot`` with ``kind='hexbin'`` (:issue:`5478`)
+
API Changes
~~~~~~~~~~~
diff --git a/doc/source/v0.14.0.txt b/doc/source/v0.14.0.txt
index d181df4c6b89b..ea9fbadeeaf4e 100644
--- a/doc/source/v0.14.0.txt
+++ b/doc/source/v0.14.0.txt
@@ -154,6 +154,7 @@ Enhancements
- ``plot(legend='reverse')`` will now reverse the order of legend labels for
most plot kinds. (:issue:`6014`)
- improve performance of slice indexing on Series with string keys (:issue:`6341`)
+- Hexagonal bin plots from ``DataFrame.plot`` with ``kind='hexbin'`` (:issue:`5478`)
Performance
~~~~~~~~~~~
diff --git a/doc/source/visualization.rst b/doc/source/visualization.rst
index 3af83b4d80c8c..081dfd0292cdc 100644
--- a/doc/source/visualization.rst
+++ b/doc/source/visualization.rst
@@ -414,6 +414,59 @@ setting `kind='kde'`:
@savefig kde_plot.png
ser.plot(kind='kde')
+.. _visualization.hexbin
+
+Hexagonal Bin plot
+~~~~~~~~~~~~~~~~~~
+*New in .14* You can create hexagonal bin plots with ``DataFrame.plot`` and
+``kind='hexbin'``.
+Hexbin plots can be a useful alternative to scatter plots if your data are
+too dense to plot each point individually.
+
+.. ipython:: python
+ :suppress:
+
+ plt.figure();
+
+.. ipython:: python
+
+ df = DataFrame(randn(1000, 2), columns=['a', 'b'])
+ df['b'] = df['b'] = df['b'] + np.arange(1000)
+
+ @savefig hexbin_plot.png
+ df.plot(kind='hexbin', x='a', y='b', gridsize=25)
+
+
+A useful keyword argument is ``gridsize``; it controls the number of hexagons
+in the x-direction, and defaults to 100. A larger ``gridsize`` means more, smaller
+bins.
+
+By default, a histogram of the counts around each ``(x, y)`` point is computed.
+You can specify alternative aggregations by passing values to the ``C`` and
+``reduce_C_function`` arguments. ``C`` specifies the value at each ``(x, y)`` point
+and ``reduce_C_function`` is a function of one argument that reduces all the
+values in a bin to a single number (e.g. ``mean``, ``max``, ``sum``, ``std``). In this
+example the positions are given by columns ``a`` and ``b``, while the value is
+given by column ``z``. The bins are aggregated with numpy's ``max`` function.
+
+.. ipython:: python
+ :suppress:
+
+ plt.figure();
+
+.. ipython:: python
+
+ df = DataFrame(randn(1000, 2), columns=['a', 'b'])
+ df['b'] = df['b'] = df['b'] + np.arange(1000)
+ df['z'] = np.random.uniform(0, 3, 1000)
+
+ @savefig hexbin_plot_agg.png
+ df.plot(kind='hexbin', x='a', y='b', C='z', reduce_C_function=np.max,
+ gridsize=25)
+
+
+See the `matplotlib hexbin documenation <http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.hexbin>`__ for more.
+
.. _visualization.andrews_curves:
Andrews Curves
diff --git a/pandas/tests/test_graphics.py b/pandas/tests/test_graphics.py
index 2902621a1e944..041920e1de6ea 100644
--- a/pandas/tests/test_graphics.py
+++ b/pandas/tests/test_graphics.py
@@ -956,6 +956,65 @@ def test_invalid_kind(self):
with tm.assertRaises(ValueError):
df.plot(kind='aasdf')
+ @slow
+ def test_hexbin_basic(self):
+ df = DataFrame({"A": np.random.uniform(size=20),
+ "B": np.random.uniform(size=20),
+ "C": np.arange(20) + np.random.uniform(size=20)})
+
+ ax = df.plot(kind='hexbin', x='A', y='B', gridsize=10)
+ # TODO: need better way to test. This just does existence.
+ self.assert_(len(ax.collections) == 1)
+
+ @slow
+ def test_hexbin_with_c(self):
+ df = DataFrame({"A": np.random.uniform(size=20),
+ "B": np.random.uniform(size=20),
+ "C": np.arange(20) + np.random.uniform(size=20)})
+
+ ax = df.plot(kind='hexbin', x='A', y='B', C='C')
+ self.assert_(len(ax.collections) == 1)
+
+ ax = df.plot(kind='hexbin', x='A', y='B', C='C',
+ reduce_C_function=np.std)
+ self.assert_(len(ax.collections) == 1)
+
+ @slow
+ def test_hexbin_cmap(self):
+ df = DataFrame({"A": np.random.uniform(size=20),
+ "B": np.random.uniform(size=20),
+ "C": np.arange(20) + np.random.uniform(size=20)})
+
+ # Default to BuGn
+ ax = df.plot(kind='hexbin', x='A', y='B')
+ self.assertEquals(ax.collections[0].cmap.name, 'BuGn')
+
+ cm = 'cubehelix'
+ ax = df.plot(kind='hexbin', x='A', y='B', colormap=cm)
+ self.assertEquals(ax.collections[0].cmap.name, cm)
+
+ @slow
+ def test_no_color_bar(self):
+ df = DataFrame({"A": np.random.uniform(size=20),
+ "B": np.random.uniform(size=20),
+ "C": np.arange(20) + np.random.uniform(size=20)})
+
+ ax = df.plot(kind='hexbin', x='A', y='B', colorbar=None)
+ self.assertIs(ax.collections[0].colorbar, None)
+
+ @slow
+ def test_allow_cmap(self):
+ df = DataFrame({"A": np.random.uniform(size=20),
+ "B": np.random.uniform(size=20),
+ "C": np.arange(20) + np.random.uniform(size=20)})
+
+ ax = df.plot(kind='hexbin', x='A', y='B', cmap='YlGn')
+ self.assertEquals(ax.collections[0].cmap.name, 'YlGn')
+
+ with tm.assertRaises(TypeError):
+ df.plot(kind='hexbin', x='A', y='B', cmap='YlGn',
+ colormap='BuGn')
+
@tm.mplskip
class TestDataFrameGroupByPlots(tm.TestCase):
diff --git a/pandas/tools/plotting.py b/pandas/tools/plotting.py
index c11e2a891ec7a..7038284b6c2a0 100644
--- a/pandas/tools/plotting.py
+++ b/pandas/tools/plotting.py
@@ -835,7 +835,14 @@ def __init__(self, data, kind=None, by=None, subplots=False, sharex=True,
secondary_y = [secondary_y]
self.secondary_y = secondary_y
- self.colormap = colormap
+ # ugly TypeError if user passes matplotlib's `cmap` name.
+ # Probably better to accept either.
+ if 'cmap' in kwds and colormap:
+ raise TypeError("Only specify one of `cmap` and `colormap`.")
+ elif 'cmap' in kwds:
+ self.colormap = kwds.pop('cmap')
+ else:
+ self.colormap = colormap
self.kwds = kwds
@@ -1263,6 +1270,52 @@ def _post_plot_logic(self):
ax.set_xlabel(com.pprint_thing(x))
+class HexBinPlot(MPLPlot):
+ def __init__(self, data, x, y, C=None, **kwargs):
+ MPLPlot.__init__(self, data, **kwargs)
+
+ if x is None or y is None:
+ raise ValueError('hexbin requires and x and y column')
+ if com.is_integer(x) and not self.data.columns.holds_integer():
+ x = self.data.columns[x]
+ if com.is_integer(y) and not self.data.columns.holds_integer():
+ y = self.data.columns[y]
+
+ if com.is_integer(C) and not self.data.columns.holds_integer():
+ C = self.data.columns[C]
+
+ self.x = x
+ self.y = y
+ self.C = C
+
+ def _make_plot(self):
+ import matplotlib.pyplot as plt
+
+ x, y, data, C = self.x, self.y, self.data, self.C
+ ax = self.axes[0]
+ # pandas uses colormap, matplotlib uses cmap.
+ cmap = self.colormap or 'BuGn'
+ cmap = plt.cm.get_cmap(cmap)
+ cb = self.kwds.pop('colorbar', True)
+
+ if C is None:
+ c_values = None
+ else:
+ c_values = data[C].values
+
+ ax.hexbin(data[x].values, data[y].values, C=c_values, cmap=cmap,
+ **self.kwds)
+ if cb:
+ img = ax.collections[0]
+ self.fig.colorbar(img, ax=ax)
+
+ def _post_plot_logic(self):
+ ax = self.axes[0]
+ x, y = self.x, self.y
+ ax.set_ylabel(com.pprint_thing(y))
+ ax.set_xlabel(com.pprint_thing(x))
+
+
class LinePlot(MPLPlot):
def __init__(self, data, **kwargs):
@@ -1663,11 +1716,12 @@ def plot_frame(frame=None, x=None, y=None, subplots=False, sharex=True,
ax : matplotlib axis object, default None
style : list or dict
matplotlib line style per column
- kind : {'line', 'bar', 'barh', 'kde', 'density', 'scatter'}
+ kind : {'line', 'bar', 'barh', 'kde', 'density', 'scatter', 'hexbin'}
bar : vertical bar plot
barh : horizontal bar plot
kde/density : Kernel Density Estimation plot
scatter: scatter plot
+ hexbin: hexbin plot
logx : boolean, default False
For line plots, use log scaling on x axis
logy : boolean, default False
@@ -1695,6 +1749,17 @@ def plot_frame(frame=None, x=None, y=None, subplots=False, sharex=True,
Returns
-------
ax_or_axes : matplotlib.AxesSubplot or list of them
+
+ Notes
+ -----
+
+ If `kind`='hexbin', you can control the size of the bins with the
+ `gridsize` argument. By default, a histogram of the counts around each
+ `(x, y)` point is computed. You can specify alternative aggregations
+ by passing values to the `C` and `reduce_C_function` arguments.
+ `C` specifies the value at each `(x, y)` point and `reduce_C_function`
+ is a function of one argument that reduces all the values in a bin to
+ a single number (e.g. `mean`, `max`, `sum`, `std`).
"""
kind = _get_standard_kind(kind.lower().strip())
if kind == 'line':
@@ -1705,6 +1770,8 @@ def plot_frame(frame=None, x=None, y=None, subplots=False, sharex=True,
klass = KdePlot
elif kind == 'scatter':
klass = ScatterPlot
+ elif kind == 'hexbin':
+ klass = HexBinPlot
else:
raise ValueError('Invalid chart type given %s' % kind)
@@ -1717,6 +1784,16 @@ def plot_frame(frame=None, x=None, y=None, subplots=False, sharex=True,
figsize=figsize, logx=logx, logy=logy,
sort_columns=sort_columns, secondary_y=secondary_y,
**kwds)
+ elif kind == 'hexbin':
+ C = kwds.pop('C', None) # remove from kwargs so we can set default
+ plot_obj = klass(frame, x=x, y=y, kind=kind, subplots=subplots,
+ rot=rot,legend=legend, ax=ax, style=style,
+ fontsize=fontsize, use_index=use_index, sharex=sharex,
+ sharey=sharey, xticks=xticks, yticks=yticks,
+ xlim=xlim, ylim=ylim, title=title, grid=grid,
+ figsize=figsize, logx=logx, logy=logy,
+ sort_columns=sort_columns, secondary_y=secondary_y,
+ C=C, **kwds)
else:
if x is not None:
if com.is_integer(x) and not frame.columns.holds_integer():
| This is just 10 minutes of copy-paste cargo-culting to gauge interest, I haven't tested anything yet.
``` python
In [1]: df = pd.DataFrame(np.random.randn(1000, 2))
In [2]: df.plot(kind='hexbin', x=0, y=1)
Out[2]: <matplotlib.axes.AxesSubplot at 0x10eb76e10>
```

It's not terribly difficult to do this on your own, so my feeling wouldn't be hurt at all if people are -1 on this :)
EDIT: oops I branched from my `to_frame` branch. I'll clean up the commits.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5478 | 2013-11-09T15:31:46Z | 2014-02-14T14:46:40Z | 2014-02-14T14:46:40Z | 2016-11-03T12:37:49Z |
API: make sure _is_copy on NDFrame is always available (GH5475) | diff --git a/pandas/core/generic.py b/pandas/core/generic.py
index 3c1942e300729..bc80988eb612c 100644
--- a/pandas/core/generic.py
+++ b/pandas/core/generic.py
@@ -74,6 +74,7 @@ class NDFrame(PandasObject):
'_data', 'name', '_cacher', '_is_copy', '_subtyp', '_index', '_default_kind', '_default_fill_value']
_internal_names_set = set(_internal_names)
_metadata = []
+ _is_copy = None
def __init__(self, data, axes=None, copy=False, dtype=None, fastpath=False):
diff --git a/pandas/tests/test_indexing.py b/pandas/tests/test_indexing.py
index d6d340a695231..dacac6ef64b29 100644
--- a/pandas/tests/test_indexing.py
+++ b/pandas/tests/test_indexing.py
@@ -1736,6 +1736,16 @@ def f():
df = DataFrame({'A':['aaa','bbb','ccc'],'B':[1,2,3]})
df.loc[0]['A'] = 111
+ # make sure that _is_copy is picked up reconstruction
+ # GH5475
+ df = DataFrame({"A": [1,2]})
+ self.assert_(df._is_copy is False)
+ with tm.ensure_clean('__tmp__pickle') as path:
+ df.to_pickle(path)
+ df2 = pd.read_pickle(path)
+ df2["B"] = df2["A"]
+ df2["B"] = df2["A"]
+
def test_floating_index_doc_example(self):
index = Index([1.5, 2, 3, 4.5, 5])
| closes #5475
| https://api.github.com/repos/pandas-dev/pandas/pulls/5477 | 2013-11-09T01:43:33Z | 2013-11-09T01:56:27Z | 2013-11-09T01:56:27Z | 2014-07-04T19:23:41Z |
TST: win32 fixes | diff --git a/pandas/computation/tests/test_eval.py b/pandas/computation/tests/test_eval.py
index b8de54ade31db..44e560b86a683 100644
--- a/pandas/computation/tests/test_eval.py
+++ b/pandas/computation/tests/test_eval.py
@@ -180,6 +180,11 @@ def test_floor_division(self):
self.check_floor_division(lhs, '//', rhs)
def test_pow(self):
+ import platform
+ if platform.system() == 'Windows':
+ raise nose.SkipTest('not testing pow on Windows')
+
+ # odd failure on win32 platform, so skip
for lhs, rhs in product(self.lhses, self.rhses):
self.check_pow(lhs, '**', rhs)
@@ -867,8 +872,13 @@ def testit(r_idx_type, c_idx_type, index_name):
expected = s + df
assert_frame_equal(res, expected)
- args = product(self.lhs_index_types, self.index_types,
- ('index', 'columns'))
+ # only test dt with dt, otherwise weird joins result
+ args = product(['i','u','s'],['i','u','s'],('index', 'columns'))
+ for r_idx_type, c_idx_type, index_name in args:
+ testit(r_idx_type, c_idx_type, index_name)
+
+ # dt with dt
+ args = product(['dt'],['dt'],('index', 'columns'))
for r_idx_type, c_idx_type, index_name in args:
testit(r_idx_type, c_idx_type, index_name)
diff --git a/pandas/core/panel.py b/pandas/core/panel.py
index 5a370b71e3511..885ec2714c47a 100644
--- a/pandas/core/panel.py
+++ b/pandas/core/panel.py
@@ -537,7 +537,7 @@ def __setitem__(self, key, value):
if value.shape != shape[1:]:
raise ValueError('shape of value must be {0}, shape of given '
'object was {1}'.format(shape[1:],
- value.shape))
+ tuple(map(int, value.shape))))
mat = np.asarray(value)
elif np.isscalar(value):
dtype, value = _infer_dtype_from_scalar(value)
diff --git a/pandas/src/inference.pyx b/pandas/src/inference.pyx
index 2a3f85b550a7c..dce46c972fb3b 100644
--- a/pandas/src/inference.pyx
+++ b/pandas/src/inference.pyx
@@ -16,15 +16,14 @@ _TYPE_MAP = {
np.string_: 'string',
np.unicode_: 'unicode',
np.bool_: 'boolean',
- np.datetime64 : 'datetime64'
+ np.datetime64 : 'datetime64',
+ np.timedelta64 : 'timedelta64'
}
try:
_TYPE_MAP[np.float128] = 'floating'
_TYPE_MAP[np.complex256] = 'complex'
_TYPE_MAP[np.float16] = 'floating'
- _TYPE_MAP[np.datetime64] = 'datetime64'
- _TYPE_MAP[np.timedelta64] = 'timedelta64'
except AttributeError:
pass
diff --git a/pandas/tests/test_index.py b/pandas/tests/test_index.py
index a634cbd0ca2ed..9a18e3c8562f6 100644
--- a/pandas/tests/test_index.py
+++ b/pandas/tests/test_index.py
@@ -20,6 +20,7 @@
from pandas.util.testing import (assert_almost_equal, assertRaisesRegexp,
assert_copy)
from pandas import compat
+from pandas.compat import long
import pandas.util.testing as tm
import pandas.core.config as cf
@@ -1344,7 +1345,7 @@ def test_inplace_mutation_resets_values(self):
# make sure label setting works too
labels2 = [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]]
- exp_values = np.array([(1, 'a')] * 6, dtype=object)
+ exp_values = np.array([(long(1), 'a')] * 6, dtype=object)
new_values = mi2.set_labels(labels2).values
# not inplace shouldn't change
assert_almost_equal(mi2._tuples, vals2)
diff --git a/pandas/tests/test_indexing.py b/pandas/tests/test_indexing.py
index 5732d2ad56a4f..d6d340a695231 100644
--- a/pandas/tests/test_indexing.py
+++ b/pandas/tests/test_indexing.py
@@ -1687,7 +1687,7 @@ def test_detect_chained_assignment(self):
# work with the chain
expected = DataFrame([[-5,1],[-6,3]],columns=list('AB'))
- df = DataFrame(np.arange(4).reshape(2,2),columns=list('AB'))
+ df = DataFrame(np.arange(4).reshape(2,2),columns=list('AB'),dtype='int64')
self.assert_(not df._is_copy)
df['A'][0] = -5
@@ -1695,7 +1695,7 @@ def test_detect_chained_assignment(self):
assert_frame_equal(df, expected)
expected = DataFrame([[-5,2],[np.nan,3.]],columns=list('AB'))
- df = DataFrame({ 'A' : np.arange(2), 'B' : np.array(np.arange(2,4),dtype=np.float64)})
+ df = DataFrame({ 'A' : Series(range(2),dtype='int64'), 'B' : np.array(np.arange(2,4),dtype=np.float64)})
self.assert_(not df._is_copy)
df['A'][0] = -5
df['A'][1] = np.nan
@@ -1703,7 +1703,7 @@ def test_detect_chained_assignment(self):
self.assert_(not df['A']._is_copy)
# using a copy (the chain), fails
- df = DataFrame({ 'A' : np.arange(2), 'B' : np.array(np.arange(2,4),dtype=np.float64)})
+ df = DataFrame({ 'A' : Series(range(2),dtype='int64'), 'B' : np.array(np.arange(2,4),dtype=np.float64)})
def f():
df.loc[0]['A'] = -5
self.assertRaises(com.SettingWithCopyError, f)
@@ -1711,7 +1711,7 @@ def f():
# doc example
df = DataFrame({'a' : ['one', 'one', 'two',
'three', 'two', 'one', 'six'],
- 'c' : np.arange(7) })
+ 'c' : Series(range(7),dtype='int64') })
self.assert_(not df._is_copy)
expected = DataFrame({'a' : ['one', 'one', 'two',
'three', 'two', 'one', 'six'],
diff --git a/pandas/util/testing.py b/pandas/util/testing.py
index 5ff4718d97a92..2ea570d6f8e94 100644
--- a/pandas/util/testing.py
+++ b/pandas/util/testing.py
@@ -177,8 +177,14 @@ def get_locales(prefix=None, normalize=True,
For example::
locale.setlocale(locale.LC_ALL, locale_string)
+
+ On error will return None (no locale available, e.g. Windows)
+
"""
- raw_locales = locale_getter()
+ try:
+ raw_locales = locale_getter()
+ except:
+ return None
try:
raw_locales = str(raw_locales, encoding=pd.options.display.encoding)
| TST: test_indexing dtype comps, closes #5466
TST don't compare invalid indices in eval operations, closes #5467
TST: invalid assignment for np.timedelta64 closes #5465
TST: skip locale checks on windows cloes #5464
TST: dtype comp issue on windows in test_indexing (GH5466)
TST: skip test_pow on windows (GH5467)
| https://api.github.com/repos/pandas-dev/pandas/pulls/5474 | 2013-11-08T16:04:19Z | 2013-11-08T18:18:25Z | 2013-11-08T18:18:25Z | 2014-07-16T08:39:49Z |
BUG: DatetimeIndex.normalize now accounts for nanoseconds (#5461). | diff --git a/pandas/tseries/tests/test_timeseries.py b/pandas/tseries/tests/test_timeseries.py
index 51939ac22e956..a7bd2250f95e3 100644
--- a/pandas/tseries/tests/test_timeseries.py
+++ b/pandas/tseries/tests/test_timeseries.py
@@ -1420,6 +1420,11 @@ def test_normalize(self):
result = rng.normalize()
expected = date_range('1/1/2000', periods=10, freq='D')
self.assert_(result.equals(expected))
+
+ rng_ns = pd.DatetimeIndex(np.array([1380585623454345752, 1380585612343234312]).astype("datetime64[ns]"))
+ rng_ns_normalized = rng_ns.normalize()
+ expected = pd.DatetimeIndex(np.array([1380585600000000000, 1380585600000000000]).astype("datetime64[ns]"))
+ self.assert_(rng_ns_normalized.equals(expected))
self.assert_(result.is_normalized)
self.assert_(not rng.is_normalized)
diff --git a/pandas/tslib.pyx b/pandas/tslib.pyx
index 11b86db8b8d92..96391f703d1d7 100644
--- a/pandas/tslib.pyx
+++ b/pandas/tslib.pyx
@@ -2180,6 +2180,7 @@ cdef inline int64_t _normalized_stamp(pandas_datetimestruct *dts):
dts.min = 0
dts.sec = 0
dts.us = 0
+ dts.ps = 0
return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts)
| closes #5461
datetime64(ns) uses the dts->ps which was not being set to zero in the
normalize function.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5472 | 2013-11-08T12:04:03Z | 2013-11-08T12:46:21Z | 2013-11-08T12:46:21Z | 2014-07-15T19:20:42Z |
BUG: bool(NaT) was True | diff --git a/pandas/tslib.pyx b/pandas/tslib.pyx
index 11b86db8b8d92..913d8850c640c 100644
--- a/pandas/tslib.pyx
+++ b/pandas/tslib.pyx
@@ -358,6 +358,10 @@ class NaTType(_NaT):
def __hash__(self):
return iNaT
+ def __bool__(self):
+ return False
+ __nonzero__ = __bool__
+
def weekday(self):
return -1
| bool(NaT) evaluates to True. I am not sure if this is by design or if it is a bug, but I think it makes more sense to evaluate it to False.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5471 | 2013-11-08T08:52:18Z | 2013-11-08T16:51:27Z | null | 2013-11-08T16:51:27Z |
TST: Fix test case to use int64 and explicit float | diff --git a/pandas/tests/test_series.py b/pandas/tests/test_series.py
index f866c1b229fe5..b6f0387835c22 100644
--- a/pandas/tests/test_series.py
+++ b/pandas/tests/test_series.py
@@ -1724,7 +1724,7 @@ def test_mode(self):
exp = Series([11, 12])
assert_series_equal(s.mode(), exp)
- assert_series_equal(Series([1, 2, 3]).mode(), Series([], dtype=int))
+ assert_series_equal(Series([1, 2, 3]).mode(), Series([], dtype='int64'))
lst = [5] * 20 + [1] * 10 + [6] * 25
np.random.shuffle(lst)
@@ -1736,7 +1736,7 @@ def test_mode(self):
s = Series(lst)
s[0] = np.nan
- assert_series_equal(s.mode(), Series([6], dtype=float))
+ assert_series_equal(s.mode(), Series([6.]))
s = Series(list('adfasbasfwewefwefweeeeasdfasnbam'))
assert_series_equal(s.mode(), Series(['e']))
| #5468
| https://api.github.com/repos/pandas-dev/pandas/pulls/5469 | 2013-11-08T03:59:58Z | 2013-11-08T04:38:59Z | 2013-11-08T04:38:59Z | 2014-07-16T08:39:46Z |
PERF: performance improvements on isnull/notnull for large pandas objects | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 053f4b1f1b66e..6ae7493fb4b72 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -803,6 +803,7 @@ Bug Fixes
- Make tests create temp files in temp directory by default. (:issue:`5419`)
- ``pd.to_timedelta`` of a scalar returns a scalar (:issue:`5410`)
- ``pd.to_timedelta`` accepts ``NaN`` and ``NaT``, returning ``NaT`` instead of raising (:issue:`5437`)
+ - performance improvements in ``isnull`` on larger size pandas objects
pandas 0.12.0
-------------
diff --git a/pandas/core/common.py b/pandas/core/common.py
index 453227aec6e23..7f1fe50048599 100644
--- a/pandas/core/common.py
+++ b/pandas/core/common.py
@@ -128,7 +128,7 @@ def _isnull_new(obj):
elif isinstance(obj, (ABCSeries, np.ndarray)):
return _isnull_ndarraylike(obj)
elif isinstance(obj, ABCGeneric):
- return obj.apply(isnull)
+ return obj._constructor(obj._data.apply(lambda x: isnull(x.values)))
elif isinstance(obj, list) or hasattr(obj, '__array__'):
return _isnull_ndarraylike(np.asarray(obj))
else:
@@ -155,7 +155,7 @@ def _isnull_old(obj):
elif isinstance(obj, (ABCSeries, np.ndarray)):
return _isnull_ndarraylike_old(obj)
elif isinstance(obj, ABCGeneric):
- return obj.apply(_isnull_old)
+ return obj._constructor(obj._data.apply(lambda x: _isnull_old(x.values)))
elif isinstance(obj, list) or hasattr(obj, '__array__'):
return _isnull_ndarraylike_old(np.asarray(obj))
else:
diff --git a/pandas/core/generic.py b/pandas/core/generic.py
index 30dccb971ae18..3c1942e300729 100644
--- a/pandas/core/generic.py
+++ b/pandas/core/generic.py
@@ -2208,13 +2208,13 @@ def isnull(self):
"""
Return a boolean same-sized object indicating if the values are null
"""
- return self.__class__(isnull(self),**self._construct_axes_dict()).__finalize__(self)
+ return isnull(self).__finalize__(self)
def notnull(self):
"""
Return a boolean same-sized object indicating if the values are not null
"""
- return self.__class__(notnull(self),**self._construct_axes_dict()).__finalize__(self)
+ return notnull(self).__finalize__(self)
def clip(self, lower=None, upper=None, out=None):
"""
diff --git a/pandas/core/internals.py b/pandas/core/internals.py
index 51fe09a805903..c5e245d2e320c 100644
--- a/pandas/core/internals.py
+++ b/pandas/core/internals.py
@@ -2153,6 +2153,13 @@ def apply(self, f, *args, **kwargs):
continue
if callable(f):
applied = f(blk, *args, **kwargs)
+
+ # if we are no a block, try to coerce
+ if not isinstance(applied, Block):
+ applied = make_block(applied,
+ blk.items,
+ blk.ref_items)
+
else:
applied = getattr(blk, f)(*args, **kwargs)
diff --git a/pandas/tests/test_common.py b/pandas/tests/test_common.py
index dfedfd629f736..7b4ea855f2f9d 100644
--- a/pandas/tests/test_common.py
+++ b/pandas/tests/test_common.py
@@ -75,17 +75,28 @@ def test_isnull():
assert not isnull(np.inf)
assert not isnull(-np.inf)
+ # series
for s in [tm.makeFloatSeries(),tm.makeStringSeries(),
tm.makeObjectSeries(),tm.makeTimeSeries(),tm.makePeriodSeries()]:
assert(isinstance(isnull(s), Series))
- # call on DataFrame
- df = DataFrame(np.random.randn(10, 5))
- df['foo'] = 'bar'
- result = isnull(df)
- expected = result.apply(isnull)
- tm.assert_frame_equal(result, expected)
-
+ # frame
+ for df in [tm.makeTimeDataFrame(),tm.makePeriodFrame(),tm.makeMixedDataFrame()]:
+ result = isnull(df)
+ expected = df.apply(isnull)
+ tm.assert_frame_equal(result, expected)
+
+ # panel
+ for p in [ tm.makePanel(), tm.makePeriodPanel(), tm.add_nans(tm.makePanel()) ]:
+ result = isnull(p)
+ expected = p.apply(isnull)
+ tm.assert_panel_equal(result, expected)
+
+ # panel 4d
+ for p in [ tm.makePanel4D(), tm.add_nans_panel4d(tm.makePanel4D()) ]:
+ result = isnull(p)
+ expected = p.apply(isnull)
+ tm.assert_panel4d_equal(result, expected)
def test_isnull_lists():
result = isnull([[False]])
diff --git a/pandas/util/testing.py b/pandas/util/testing.py
index 895c651c0bfe7..5ff4718d97a92 100644
--- a/pandas/util/testing.py
+++ b/pandas/util/testing.py
@@ -531,6 +531,9 @@ def assert_copy(iter1, iter2, **eql_kwargs):
def getCols(k):
return string.ascii_uppercase[:k]
+def getArangeMat():
+ return np.arange(N * K).reshape((N, K))
+
# make index
def makeStringIndex(k=10):
@@ -601,24 +604,20 @@ def getTimeSeriesData(nper=None):
return dict((c, makeTimeSeries(nper)) for c in getCols(K))
+def getPeriodData(nper=None):
+ return dict((c, makePeriodSeries(nper)) for c in getCols(K))
+
+# make frame
def makeTimeDataFrame(nper=None):
data = getTimeSeriesData(nper)
return DataFrame(data)
-def getPeriodData(nper=None):
- return dict((c, makePeriodSeries(nper)) for c in getCols(K))
-
-# make frame
def makeDataFrame():
data = getSeriesData()
return DataFrame(data)
-def getArangeMat():
- return np.arange(N * K).reshape((N, K))
-
-
def getMixedTypeDict():
index = Index(['a', 'b', 'c', 'd', 'e'])
@@ -631,6 +630,8 @@ def getMixedTypeDict():
return index, data
+def makeMixedDataFrame():
+ return DataFrame(getMixedTypeDict()[1])
def makePeriodFrame(nper=None):
data = getPeriodData(nper)
@@ -827,13 +828,13 @@ def add_nans(panel):
dm = panel[item]
for j, col in enumerate(dm.columns):
dm[col][:i + j] = np.NaN
-
+ return panel
def add_nans_panel4d(panel4d):
for l, label in enumerate(panel4d.labels):
panel = panel4d[label]
add_nans(panel)
-
+ return panel4d
class TestSubDict(dict):
diff --git a/vb_suite/frame_methods.py b/vb_suite/frame_methods.py
index 3567ee2b09f99..b7754e28629d0 100644
--- a/vb_suite/frame_methods.py
+++ b/vb_suite/frame_methods.py
@@ -221,6 +221,9 @@ def f(K=100):
frame_xs_col = Benchmark('df.xs(50000,axis = 1)', setup)
+#----------------------------------------------------------------------
+# nulls/masking
+
## masking
setup = common_setup + """
data = np.random.randn(1000, 500)
@@ -230,8 +233,17 @@ def f(K=100):
mask = isnull(df)
"""
-mask_bools = Benchmark('bools.mask(mask)', setup,
- start_date=datetime(2013,1,1))
+frame_mask_bools = Benchmark('bools.mask(mask)', setup,
+ start_date=datetime(2013,1,1))
+
+frame_mask_floats = Benchmark('bools.astype(float).mask(mask)', setup,
+ start_date=datetime(2013,1,1))
+
+## isnull
+setup = common_setup + """
+data = np.random.randn(1000, 1000)
+df = DataFrame(data)
+"""
+frame_isnull = Benchmark('isnull(df)', setup,
+ start_date=datetime(2012,1,1))
-mask_floats = Benchmark('bools.astype(float).mask(mask)', setup,
- start_date=datetime(2013,1,1))
| ```
In [1]: df = DataFrame(np.random.randn(1000,1000))
In [2]: %timeit df.apply(pd.isnull)
10 loops, best of 3: 121 ms per loop
In [3]: %timeit pd.isnull(df)
100 loops, best of 3: 3.15 ms per loop
```
from 0.12
```
In [2]: %timeit df.apply(pd.isnull)
10 loops, best of 3: 74.3 ms per loop
In [3]: %timeit pd.isnull(df)
10 loops, best of 3: 81.8 ms per loop
```
now evaluates block-by-block rather than column-by-column (via apply)
| https://api.github.com/repos/pandas-dev/pandas/pulls/5462 | 2013-11-07T13:06:16Z | 2013-11-07T14:44:58Z | 2013-11-07T14:44:58Z | 2014-07-16T08:39:41Z |
DOC: add basic documentation to some of the GroupBy properties and methods | diff --git a/doc/source/api.rst b/doc/source/api.rst
index c2c2bc8710af2..4ecde7e05256a 100644
--- a/doc/source/api.rst
+++ b/doc/source/api.rst
@@ -1112,6 +1112,42 @@ Conversion
DatetimeIndex.to_pydatetime
+GroupBy
+-------
+.. currentmodule:: pandas.core.groupby
+
+GroupBy objects are returned by groupby calls: :func:`pandas.DataFrame.groupby`, :func:`pandas.Series.groupby`, etc.
+
+Indexing, iteration
+~~~~~~~~~~~~~~~~~~~
+.. autosummary::
+ :toctree: generated/
+
+ GroupBy.__iter__
+ GroupBy.groups
+ GroupBy.indices
+ GroupBy.get_group
+
+Function application
+~~~~~~~~~~~~~~~~~~~~
+.. autosummary::
+ :toctree: generated/
+
+ GroupBy.apply
+ GroupBy.aggregate
+ GroupBy.transform
+
+Computations / Descriptive Stats
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.. autosummary::
+ :toctree: generated/
+
+ GroupBy.mean
+ GroupBy.median
+ GroupBy.std
+ GroupBy.var
+ GroupBy.ohlc
+
..
HACK - see github issue #4539. To ensure old links remain valid, include
here the autosummaries with previous currentmodules as a comment and add
diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py
index 1d5691edb6313..5183ff6484d02 100644
--- a/pandas/core/groupby.py
+++ b/pandas/core/groupby.py
@@ -226,6 +226,7 @@ def __unicode__(self):
@property
def groups(self):
+ """ dict {group name -> group labels} """
return self.grouper.groups
@property
@@ -234,6 +235,7 @@ def ngroups(self):
@property
def indices(self):
+ """ dict {group name -> group indices} """
return self.grouper.indices
@property
@@ -310,6 +312,22 @@ def curried(x):
return wrapper
def get_group(self, name, obj=None):
+ """
+ Constructs NDFrame from group with provided name
+
+ Parameters
+ ----------
+ name : object
+ the name of the group to get as a DataFrame
+ obj : NDFrame, default None
+ the NDFrame to take the DataFrame out of. If
+ it is None, the object groupby was called on will
+ be used
+
+ Returns
+ -------
+ group : type of obj
+ """
if obj is None:
obj = self.obj
@@ -838,6 +856,7 @@ def apply(self, f, data, axis=0):
@cache_readonly
def indices(self):
+ """ dict {group name -> group indices} """
if len(self.groupings) == 1:
return self.groupings[0].indices
else:
@@ -884,6 +903,7 @@ def _max_groupsize(self):
@cache_readonly
def groups(self):
+ """ dict {group name -> group labels} """
if len(self.groupings) == 1:
return self.groupings[0].groups
else:
| I added some simple documentation to the GroupBy and Grouper classes
| https://api.github.com/repos/pandas-dev/pandas/pulls/5459 | 2013-11-07T01:45:06Z | 2013-11-27T20:00:21Z | 2013-11-27T20:00:21Z | 2014-06-14T22:38:30Z |
DOC: small error in cookbook (doc build warning) | diff --git a/doc/source/cookbook.rst b/doc/source/cookbook.rst
index 84cca1c4b7ae9..9a295865fbd82 100644
--- a/doc/source/cookbook.rst
+++ b/doc/source/cookbook.rst
@@ -335,7 +335,7 @@ The :ref:`CSV <io.read_csv_table>` docs
<http://stackoverflow.com/questions/11622652/large-persistent-dataframe-in-pandas/12193309#12193309>`__
`Reading only certain rows of a csv chunk-by-chunk
-<http://stackoverflow.com/questions/19674212/pandas-data-frame-select-rows-and-clear-memory>``__
+<http://stackoverflow.com/questions/19674212/pandas-data-frame-select-rows-and-clear-memory>`__
`Reading the first few lines of a frame
<http://stackoverflow.com/questions/15008970/way-to-read-first-few-lines-for-pandas-dataframe>`__
| https://api.github.com/repos/pandas-dev/pandas/pulls/5454 | 2013-11-06T16:23:22Z | 2013-11-06T16:34:26Z | 2013-11-06T16:34:26Z | 2014-07-16T08:39:33Z | |
add optional default value to GroupBy.get_group | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 96da62077436f..b27d5cc089b5d 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -221,6 +221,9 @@ Improvements to existing features
MultiIndex and Hierarchical Rows. Set the ``merge_cells`` to ``False`` to
restore the previous behaviour. (:issue:`5254`)
- The FRED DataReader now accepts multiple series (:issue`3413`)
+ - ``GroupBy.get_group()`` now accepts an optional ``default``
+ argument which is used to generate a default NDFrame in the event
+ that the provided ``name`` is not found. (:issue:`5452`)
API Changes
~~~~~~~~~~~
diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py
index c635baa0e2739..a3878ce479aa4 100644
--- a/pandas/core/groupby.py
+++ b/pandas/core/groupby.py
@@ -311,10 +311,10 @@ def curried(x):
return wrapper
- def get_group(self, name, obj=None):
+ def get_group(self, name, obj=None, default=None):
"""
Constructs NDFrame from group with provided name
-
+
Parameters
----------
name : object
@@ -323,15 +323,45 @@ def get_group(self, name, obj=None):
the NDFrame to take the DataFrame out of. If
it is None, the object groupby was called on will
be used
-
+ default : indicies, default None
+ If None, a KeyError will be raised if name isn't
+ in the GroupBy. Otherwise, default should be a
+ list of indicies into the original obj to take in
+ the event that name isn't in the GroupBy.
+ If [] is provided, an empty object will be returned
+ in the event that the name isn't in the GroupBy.
+
Returns
-------
group : type of obj
+
+ Example
+ --------
+
+ >>> data = pd.DataFrame({
+ ... 'name' : ['a','a','b','d'],
+ ... 'count' : [3,4,3,2],
+ ... })
+ >>> g = data.groupby('name')
+ >>> g.get_group('a', default = [])['count'].sum()
+ 7
+ >>> g.get_group('c', default = [])['count'].sum()
+ 0
"""
if obj is None:
obj = self.obj
- inds = self.indices[name]
+ if default is not None and not com.is_list_like(default) :
+ raise TypeError('default must be list like')
+
+ try :
+ inds = self.indices[name]
+ except KeyError :
+ if default is None :
+ raise
+
+ inds = default
+
return obj.take(inds, axis=self.axis, convert=False)
def __iter__(self):
diff --git a/pandas/tests/test_groupby.py b/pandas/tests/test_groupby.py
index d9bdc3adcd041..73f45deb749d5 100644
--- a/pandas/tests/test_groupby.py
+++ b/pandas/tests/test_groupby.py
@@ -414,6 +414,29 @@ def test_get_group(self):
expected = wp.reindex(major=[x for x in wp.major_axis if x.month == 1])
assert_panel_equal(gp, expected)
+ def test_get_group_default(self):
+ wp = tm.makePanel()
+ grouped = wp.groupby(lambda x: x.month, axis='major')
+
+ gp = grouped.get_group(-1, default=[])
+ expected = wp.take([], axis='major')
+ assert_panel_equal(gp, expected)
+
+ def test_get_group_default_string(self):
+ wp = tm.makePanel()
+ grouped = wp.groupby(lambda x: x.month, axis='major')
+
+ self.assertRaises(TypeError, grouped.get_group, -1, default='string')
+
+ def test_get_group_default_index(self):
+ data = DataFrame({
+ 'name' : ['other', 'a', 'a', 'b', 'd'],
+ 'count' : [1,3,4,3,2],
+ })
+ g = data.groupby('name')
+ self.assertEqual(g.get_group('a', default = [])['count'].sum(), 7)
+ self.assertEqual(g.get_group('c', default = [0])['count'].sum(), 1)
+
def test_agg_apply_corner(self):
# nothing to group, all NA
grouped = self.ts.groupby(self.ts * np.nan)
| I've used a try except block as opposed to and if else (below) to keep the non-default code path fast. What I didn't do:
```
if default is None :
inds = self.indices[name]
else :
inds = self.indices.get(name, default)
```
Here is an example use case:
```
def foo(df, keys) :
g = df.groupby('key')
for key in keys :
for x in g.get_group(key, default=[]).x :
yield key, x
```
vs
```
def foo(df, keys) :
g = df.groupby('key')
for key in keys :
if key in g.indices :
for x in g.get_group(key).x :
yield key, x
```
Many of the simple cases are actually handled by other higher level functions
| https://api.github.com/repos/pandas-dev/pandas/pulls/5452 | 2013-11-06T14:38:00Z | 2015-01-18T21:39:57Z | null | 2015-01-18T21:39:57Z |
DOC: remove docstring of flags attribute during doc building process (#5331) | diff --git a/doc/source/conf.py b/doc/source/conf.py
index a500289b27ab1..695a954f78cfb 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -246,3 +246,12 @@
'GH'),
'wiki': ('https://github.com/pydata/pandas/wiki/%s',
'wiki ')}
+
+# remove the docstring of the flags attribute (inherited from numpy ndarray)
+# because these give doc build errors (see GH issue 5331)
+def remove_flags_docstring(app, what, name, obj, options, lines):
+ if what == "attribute" and name.endswith(".flags"):
+ del lines[:]
+
+def setup(app):
+ app.connect("autodoc-process-docstring", remove_flags_docstring)
| Further fixes #5331 with @jtratner 's suggestion (https://github.com/pydata/pandas/issues/5142#issuecomment-27871973).
This removes the docstring of all attributes with the name `flags` during the doc building process.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5450 | 2013-11-06T14:05:13Z | 2013-11-06T15:31:36Z | 2013-11-06T15:31:36Z | 2014-07-09T18:47:42Z |
PERF: Fixed decoding perf issue on py3 (GH5441) | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 926e8f1d0c5ea..e137a93af07a9 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -531,6 +531,7 @@ Bug Fixes
names weren't strings (:issue:`4956`)
- A zero length series written in Fixed format not deserializing properly.
(:issue:`4708`)
+ - Fixed decoding perf issue on pyt3 (:issue:`5441`)
- Fixed bug in tslib.tz_convert(vals, tz1, tz2): it could raise IndexError
exception while trying to access trans[pos + 1] (:issue:`4496`)
- The ``by`` argument now works correctly with the ``layout`` argument
diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py
index 975d04c185d51..bc2f41502614d 100644
--- a/pandas/io/pytables.py
+++ b/pandas/io/pytables.py
@@ -3972,8 +3972,11 @@ def _unconvert_string_array(data, nan_rep=None, encoding=None):
# where the passed encoding is actually None)
encoding = _ensure_encoding(encoding)
if encoding is not None and len(data):
- f = np.vectorize(lambda x: x.decode(encoding), otypes=[np.object])
- data = f(data)
+ try:
+ data = data.astype(str).astype(object)
+ except:
+ f = np.vectorize(lambda x: x.decode(encoding), otypes=[np.object])
+ data = f(data)
if nan_rep is None:
nan_rep = 'nan'
| closes #5441
| https://api.github.com/repos/pandas-dev/pandas/pulls/5448 | 2013-11-06T12:39:07Z | 2013-11-06T13:59:15Z | 2013-11-06T13:59:15Z | 2014-06-16T19:05:47Z |
DOC: fix build error in to_latex and release notes | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 136829e692c8f..d9924a2457e7c 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -386,6 +386,7 @@ API Changes
division.
.. code-block:: python
+
In [3]: arr = np.array([1, 2, 3, 4])
In [4]: arr2 = np.array([5, 3, 2, 1])
diff --git a/doc/source/v0.13.0.txt b/doc/source/v0.13.0.txt
index c736a52cd1e71..acd6baf4d6551 100644
--- a/doc/source/v0.13.0.txt
+++ b/doc/source/v0.13.0.txt
@@ -60,6 +60,7 @@ API changes
division.
.. code-block:: python
+
In [3]: arr = np.array([1, 2, 3, 4])
In [4]: arr2 = np.array([5, 3, 2, 1])
diff --git a/pandas/core/frame.py b/pandas/core/frame.py
index 60bd36d58f0de..89219e76444a5 100644
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -1295,7 +1295,9 @@ def to_html(self, buf=None, columns=None, col_space=None, colSpace=None,
justify=None, force_unicode=None, bold_rows=True,
classes=None, escape=True):
"""
- to_html-specific options
+ Render a DataFrame as an HTML table.
+
+ `to_html`-specific options:
bold_rows : boolean, default True
Make the row labels bold in the output
@@ -1303,8 +1305,6 @@ def to_html(self, buf=None, columns=None, col_space=None, colSpace=None,
CSS class(es) to apply to the resulting html table
escape : boolean, default True
Convert the characters <, >, and & to HTML-safe sequences.
-
- Render a DataFrame as an HTML table.
"""
if force_unicode is not None: # pragma: no cover
@@ -1337,12 +1337,13 @@ def to_latex(self, buf=None, columns=None, col_space=None, colSpace=None,
float_format=None, sparsify=None, index_names=True,
bold_rows=True, force_unicode=None):
"""
- to_latex-specific options
- bold_rows : boolean, default True
- Make the row labels bold in the output
-
Render a DataFrame to a tabular environment table.
You can splice this into a LaTeX document.
+
+ `to_latex`-specific options:
+
+ bold_rows : boolean, default True
+ Make the row labels bold in the output
"""
if force_unicode is not None: # pragma: no cover
| This partly fixes #5331 (the `to_latex` part, not the 'Malformed table' one).
And in the same time, fixes a build error in the newly added docs on `truediv` in the release notes.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5447 | 2013-11-06T10:25:16Z | 2013-11-06T12:58:55Z | 2013-11-06T12:58:55Z | 2014-07-16T08:39:27Z |
PERF/ENH: Use xlsxwriter by default (and then fall back on openpyxl). | diff --git a/doc/source/io.rst b/doc/source/io.rst
index 1a879866c5516..29478d1fd7841 100644
--- a/doc/source/io.rst
+++ b/doc/source/io.rst
@@ -1825,8 +1825,10 @@ written. For example:
df.to_excel('path_to_file.xlsx', sheet_name='Sheet1')
-Files with a ``.xls`` extension will be written using ``xlwt`` and those with
-a ``.xlsx`` extension will be written using ``openpyxl``.
+Files with a ``.xls`` extension will be written using ``xlwt`` and those with a
+``.xlsx`` extension will be written using ``xlsxwriter`` (if available) or
+``openpyxl``.
+
The Panel class also has a ``to_excel`` instance method,
which writes each DataFrame in the Panel to a separate sheet.
@@ -1858,14 +1860,19 @@ Excel writer engines
1. the ``engine`` keyword argument
2. the filename extension (via the default specified in config options)
-By default, ``pandas`` uses `openpyxl <http://packages.python.org/openpyxl/>`__
-for ``.xlsx`` and ``.xlsm`` files and `xlwt <http://www.python-excel.org/>`__
-for ``.xls`` files. If you have multiple engines installed, you can set the
-default engine through :ref:`setting the config options <basics.working_with_options>`
-``io.excel.xlsx.writer`` and ``io.excel.xls.writer``.
+By default, ``pandas`` uses the `XlsxWriter`_ for ``.xlsx`` and `openpyxl`_
+for ``.xlsm`` files and `xlwt`_ for ``.xls`` files. If you have multiple
+engines installed, you can set the default engine through :ref:`setting the
+config options <basics.working_with_options>` ``io.excel.xlsx.writer`` and
+``io.excel.xls.writer``. pandas will fall back on `openpyxl`_ for ``.xlsx``
+files if `Xlsxwriter`_ is not available.
+
+.. _XlsxWriter: http://xlsxwriter.readthedocs.org
+.. _openpyxl: http://packages.python.org/openpyxl/
+.. _xlwt: http://www.python-excel.org
-For example if the `XlsxWriter <http://xlsxwriter.readthedocs.org>`__
-module is installed you can use it as a xlsx writer engine as follows:
+To specify which writer you want to use, you can pass an engine keyword
+argument to ``to_excel`` and to ``ExcelWriter``.
.. code-block:: python
diff --git a/pandas/core/config_init.py b/pandas/core/config_init.py
index 13f7a3dbe7d4a..51eee0a5d6327 100644
--- a/pandas/core/config_init.py
+++ b/pandas/core/config_init.py
@@ -290,8 +290,7 @@ def use_inf_as_null_cb(key):
with cf.config_prefix('io.excel'):
# going forward, will be additional writers
for ext, options in [('xls', ['xlwt']),
- ('xlsm', ['openpyxl']),
- ('xlsx', ['openpyxl'])]:
+ ('xlsm', ['openpyxl'])]:
default = options.pop(0)
if options:
options = " " + ", ".join(options)
@@ -300,3 +299,17 @@ def use_inf_as_null_cb(key):
doc = writer_engine_doc.format(ext=ext, default=default,
others=options)
cf.register_option(ext + '.writer', default, doc, validator=str)
+ def _register_xlsx(engine, other):
+ cf.register_option('xlsx.writer', engine,
+ writer_engine_doc.format(ext='xlsx',
+ default=engine,
+ others=", '%s'" % other),
+ validator=str)
+
+ try:
+ # better memory footprint
+ import xlsxwriter
+ _register_xlsx('xlsxwriter', 'openpyxl')
+ except ImportError:
+ # fallback
+ _register_xlsx('openpyxl', 'xlsxwriter')
diff --git a/pandas/io/tests/test_excel.py b/pandas/io/tests/test_excel.py
index 8bcf5e461ce7c..1b94d1b02e741 100644
--- a/pandas/io/tests/test_excel.py
+++ b/pandas/io/tests/test_excel.py
@@ -14,7 +14,7 @@
from pandas.io.parsers import read_csv
from pandas.io.excel import (
ExcelFile, ExcelWriter, read_excel, _XlwtWriter, _OpenpyxlWriter,
- register_writer
+ register_writer, _XlsxWriter
)
from pandas.util.testing import ensure_clean
from pandas.core.config import set_option, get_option
@@ -1026,9 +1026,14 @@ def test_ExcelWriter_dispatch(self):
with tm.assertRaisesRegexp(ValueError, 'No engine'):
ExcelWriter('nothing')
- _skip_if_no_openpyxl()
+ try:
+ import xlsxwriter
+ writer_klass = _XlsxWriter
+ except ImportError:
+ _skip_if_no_openpyxl()
+ writer_klass = _OpenpyxlWriter
writer = ExcelWriter('apple.xlsx')
- tm.assert_isinstance(writer, _OpenpyxlWriter)
+ tm.assert_isinstance(writer, writer_klass)
_skip_if_no_xlwt()
writer = ExcelWriter('apple.xls')
| Since xlsxwriter has a smaller install base (because it's newer),
reasonable to assume that if you have it installed, you want xlsxwriter.
Plus, it has better performance characteristics in general (esp. in
terms of memory usage)
| https://api.github.com/repos/pandas-dev/pandas/pulls/5446 | 2013-11-06T02:34:52Z | 2013-11-07T03:23:10Z | 2013-11-07T03:23:10Z | 2014-07-16T08:39:26Z |
ENH: Always do true division on Python 2.X | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 5fef061b9e447..926e8f1d0c5ea 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -376,6 +376,25 @@ API Changes
dates are given (:issue:`5242`)
- ``Timestamp`` now supports ``now/today/utcnow`` class methods
(:issue:`5339`)
+ - **All** division with ``NDFrame`` - likes is now truedivision, regardless
+ of the future import. You can use ``//`` and ``floordiv`` to do integer
+ division.
+
+ .. code-block:: python
+ In [3]: arr = np.array([1, 2, 3, 4])
+
+ In [4]: arr2 = np.array([5, 3, 2, 1])
+
+ In [5]: arr / arr2
+ Out[5]: array([0, 0, 1, 4])
+
+ In [6]: pd.Series(arr) / pd.Series(arr2) # no future import required
+ Out[6]:
+ 0 0.200000
+ 1 0.666667
+ 2 1.500000
+ 3 4.000000
+ dtype: float64
Internal Refactoring
~~~~~~~~~~~~~~~~~~~~
diff --git a/doc/source/v0.13.0.txt b/doc/source/v0.13.0.txt
index 9b958d59d5a74..c736a52cd1e71 100644
--- a/doc/source/v0.13.0.txt
+++ b/doc/source/v0.13.0.txt
@@ -55,6 +55,26 @@ API changes
# and all methods take an inplace kwarg - but returns None
index.set_names(["bob", "cranberry"], inplace=True)
+- **All** division with ``NDFrame`` - likes is now truedivision, regardless
+ of the future import. You can use ``//`` and ``floordiv`` to do integer
+ division.
+
+ .. code-block:: python
+ In [3]: arr = np.array([1, 2, 3, 4])
+
+ In [4]: arr2 = np.array([5, 3, 2, 1])
+
+ In [5]: arr / arr2
+ Out[5]: array([0, 0, 1, 4])
+
+ In [6]: pd.Series(arr) / pd.Series(arr2) # no future import required
+ Out[6]:
+ 0 0.200000
+ 1 0.666667
+ 2 1.500000
+ 3 4.000000
+ dtype: float64
+
- Infer and downcast dtype if ``downcast='infer'`` is passed to ``fillna/ffill/bfill`` (:issue:`4604`)
- ``__nonzero__`` for all NDFrame objects, will now raise a ``ValueError``, this reverts back to (:issue:`1073`, :issue:`4633`)
behavior. See :ref:`gotchas<gotchas.truth>` for a more detailed discussion.
diff --git a/pandas/computation/expressions.py b/pandas/computation/expressions.py
index 3c1fb091ab823..f1007cbc81eb7 100644
--- a/pandas/computation/expressions.py
+++ b/pandas/computation/expressions.py
@@ -61,6 +61,7 @@ def _evaluate_standard(op, op_str, a, b, raise_on_error=True, **eval_kwargs):
_store_test_result(False)
return op(a, b)
+
def _can_use_numexpr(op, op_str, a, b, dtype_check):
""" return a boolean if we WILL be using numexpr """
if op_str is not None:
@@ -86,7 +87,8 @@ def _can_use_numexpr(op, op_str, a, b, dtype_check):
return False
-def _evaluate_numexpr(op, op_str, a, b, raise_on_error=False, **eval_kwargs):
+def _evaluate_numexpr(op, op_str, a, b, raise_on_error=False, truediv=True,
+ **eval_kwargs):
result = None
if _can_use_numexpr(op, op_str, a, b, 'evaluate'):
@@ -96,7 +98,8 @@ def _evaluate_numexpr(op, op_str, a, b, raise_on_error=False, **eval_kwargs):
result = ne.evaluate('a_value %s b_value' % op_str,
local_dict={'a_value': a_value,
'b_value': b_value},
- casting='safe', **eval_kwargs)
+ casting='safe', truediv=truediv,
+ **eval_kwargs)
except (ValueError) as detail:
if 'unknown type object' in str(detail):
pass
@@ -112,10 +115,12 @@ def _evaluate_numexpr(op, op_str, a, b, raise_on_error=False, **eval_kwargs):
return result
+
def _where_standard(cond, a, b, raise_on_error=True):
return np.where(_values_from_object(cond), _values_from_object(a),
_values_from_object(b))
+
def _where_numexpr(cond, a, b, raise_on_error=False):
result = None
@@ -190,10 +195,10 @@ def where(cond, a, b, raise_on_error=False, use_numexpr=True):
return _where_standard(cond, a, b, raise_on_error=raise_on_error)
-def set_test_mode(v = True):
+def set_test_mode(v=True):
"""
- Keeps track of whether numexpr was used. Stores an additional ``True`` for
- every successful use of evaluate with numexpr since the last
+ Keeps track of whether numexpr was used. Stores an additional ``True``
+ for every successful use of evaluate with numexpr since the last
``get_test_result``
"""
global _TEST_MODE, _TEST_RESULT
diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py
index 6ab6f15aaab15..2699dd0a25a2b 100644
--- a/pandas/core/algorithms.py
+++ b/pandas/core/algorithms.py
@@ -2,7 +2,7 @@
Generic data algorithms. This module is experimental at the moment and not
intended for public consumption
"""
-
+from __future__ import division
from warnings import warn
import numpy as np
diff --git a/pandas/core/frame.py b/pandas/core/frame.py
index 1cb0c4adcf5d4..1e843e40037b1 100644
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -8,7 +8,7 @@
alignment and a host of useful data manipulation methods having to do with the
labeling information
"""
-
+from __future__ import division
# pylint: disable=E1101,E1103
# pylint: disable=W0212,W0231,W0703,W0622
diff --git a/pandas/core/ops.py b/pandas/core/ops.py
index 0c647bb6ee7eb..9d227f0afffc6 100644
--- a/pandas/core/ops.py
+++ b/pandas/core/ops.py
@@ -3,6 +3,8 @@
This is not a public API.
"""
+# necessary to enforce truediv in Python 2.X
+from __future__ import division
import operator
import numpy as np
import pandas as pd
@@ -80,24 +82,10 @@ def names(x):
rmod=arith_method(lambda x, y: y % x, names('rmod'),
default_axis=default_axis),
)
- if not compat.PY3:
- new_methods["div"] = arith_method(operator.div, names('div'), op('/'),
- truediv=False, fill_zeros=np.inf,
- default_axis=default_axis)
- new_methods["rdiv"] = arith_method(lambda x, y: operator.div(y, x),
- names('rdiv'), truediv=False,
- fill_zeros=np.inf,
- default_axis=default_axis)
- else:
- new_methods["div"] = arith_method(operator.truediv, names('div'),
- op('/'), truediv=True,
- fill_zeros=np.inf,
- default_axis=default_axis)
- new_methods["rdiv"] = arith_method(lambda x, y: operator.truediv(y, x),
- names('rdiv'), truediv=False,
- fill_zeros=np.inf,
- default_axis=default_axis)
- # Comp methods never had a default axis set
+ new_methods['div'] = new_methods['truediv']
+ new_methods['rdiv'] = new_methods['rtruediv']
+
+ # Comp methods never had a default axis set
if comp_method:
new_methods.update(dict(
eq=comp_method(operator.eq, names('eq'), op('==')),
diff --git a/pandas/core/panel.py b/pandas/core/panel.py
index 6b50bfb76a3ea..5a370b71e3511 100644
--- a/pandas/core/panel.py
+++ b/pandas/core/panel.py
@@ -2,7 +2,7 @@
Contains data structures designed for manipulating panel (3-dimensional) data
"""
# pylint: disable=E1103,W0231,W0212,W0621
-
+from __future__ import division
from pandas.compat import map, zip, range, lrange, lmap, u, OrderedDict, OrderedDefaultdict
from pandas import compat
import sys
diff --git a/pandas/core/series.py b/pandas/core/series.py
index 3fe9540ba3fe0..e62bf2f36d209 100644
--- a/pandas/core/series.py
+++ b/pandas/core/series.py
@@ -1,6 +1,7 @@
"""
Data structure for 1-dimensional cross-sectional and time series data
"""
+from __future__ import division
# pylint: disable=E1101,E1103
# pylint: disable=W0703,W0622,W0613,W0201
diff --git a/pandas/sparse/array.py b/pandas/sparse/array.py
index bed4ede6ce5f3..141aef3051b23 100644
--- a/pandas/sparse/array.py
+++ b/pandas/sparse/array.py
@@ -1,7 +1,7 @@
"""
SparseArray data structure
"""
-
+from __future__ import division
# pylint: disable=E1101,E1103,W0231
from numpy import nan, ndarray
diff --git a/pandas/sparse/frame.py b/pandas/sparse/frame.py
index b577f5ba8f5ec..deb9065a2b5a6 100644
--- a/pandas/sparse/frame.py
+++ b/pandas/sparse/frame.py
@@ -2,7 +2,7 @@
Data structures for sparse float data. Life is made simpler by dealing only
with float64 data
"""
-
+from __future__ import division
# pylint: disable=E1101,E1103,W0231,E0202
from numpy import nan
diff --git a/pandas/tests/test_expressions.py b/pandas/tests/test_expressions.py
index 85f5ba1f08b1d..6284e4551e167 100644
--- a/pandas/tests/test_expressions.py
+++ b/pandas/tests/test_expressions.py
@@ -72,23 +72,21 @@ def run_arithmetic_test(self, df, other, assert_func, check_dtype=False,
if not compat.PY3:
operations.append('div')
for arith in operations:
- if test_flex:
- op = getattr(df, arith)
- else:
- op = getattr(operator, arith)
+ operator_name = arith
+ if arith == 'div':
+ operator_name = 'truediv'
+
if test_flex:
op = lambda x, y: getattr(df, arith)(y)
op.__name__ = arith
else:
- op = getattr(operator, arith)
+ op = getattr(operator, operator_name)
expr.set_use_numexpr(False)
expected = op(df, other)
expr.set_use_numexpr(True)
result = op(df, other)
try:
if check_dtype:
- if arith == 'div':
- assert expected.dtype.kind == df.dtype.kind
if arith == 'truediv':
assert expected.dtype.kind == 'f'
assert_func(expected, result)
@@ -103,7 +101,7 @@ def test_integer_arithmetic(self):
assert_series_equal, check_dtype=True)
@nose.tools.nottest
- def run_binary_test(self, df, other, assert_func, check_dtype=False,
+ def run_binary_test(self, df, other, assert_func,
test_flex=False, numexpr_ops=set(['gt', 'lt', 'ge',
'le', 'eq', 'ne'])):
"""
@@ -127,11 +125,6 @@ def run_binary_test(self, df, other, assert_func, check_dtype=False,
result = op(df, other)
used_numexpr = expr.get_test_result()
try:
- if check_dtype:
- if arith == 'div':
- assert expected.dtype.kind == result.dtype.kind
- if arith == 'truediv':
- assert result.dtype.kind == 'f'
if arith in numexpr_ops:
assert used_numexpr, "Did not use numexpr as expected."
else:
@@ -267,8 +260,10 @@ def testit():
for f, f2 in [ (self.frame, self.frame2), (self.mixed, self.mixed2) ]:
for op, op_str in [('add','+'),('sub','-'),('mul','*'),('div','/'),('pow','**')]:
-
- op = getattr(operator,op,None)
+ if op == 'div':
+ op = getattr(operator, 'truediv', None)
+ else:
+ op = getattr(operator, op, None)
if op is not None:
result = expr._can_use_numexpr(op, op_str, f, f, 'evaluate')
self.assert_(result == (not f._is_mixed_type))
diff --git a/pandas/tests/test_series.py b/pandas/tests/test_series.py
index 91fa1f1a19ffc..f866c1b229fe5 100644
--- a/pandas/tests/test_series.py
+++ b/pandas/tests/test_series.py
@@ -2032,7 +2032,12 @@ def check(series, other, check_reverse=False):
for opname in simple_ops:
op = getattr(Series, opname)
- alt = getattr(operator, opname)
+
+ if op == 'div':
+ alt = operator.truediv
+ else:
+ alt = getattr(operator, opname)
+
result = op(series, other)
expected = alt(series, other)
tm.assert_almost_equal(result, expected)
@@ -2079,11 +2084,11 @@ def test_modulo(self):
def test_div(self):
- # integer div, but deal with the 0's
+ # no longer do integer div for any ops, but deal with the 0's
p = DataFrame({'first': [3, 4, 5, 8], 'second': [0, 0, 0, 3]})
result = p['first'] / p['second']
expected = Series(
- p['first'].values / p['second'].values, dtype='float64')
+ p['first'].values.astype(float) / p['second'].values, dtype='float64')
expected.iloc[0:3] = np.inf
assert_series_equal(result, expected)
@@ -2098,10 +2103,7 @@ def test_div(self):
p = DataFrame({'first': [3, 4, 5, 8], 'second': [1, 1, 1, 1]})
result = p['first'] / p['second']
- if compat.PY3:
- assert_series_equal(result, p['first'].astype('float64'))
- else:
- assert_series_equal(result, p['first'])
+ assert_series_equal(result, p['first'].astype('float64'))
self.assertFalse(np.array_equal(result, p['second'] / p['first']))
def test_operators(self):
| Close #5356.
Note: this version actually forces `a / b` to always do truediv as well. It's
less complicated to maintain if we do it that way, but it's also possible to
have this `a / b` use div and `a.div(b)` use truediv, just might be strange.
This is definitely different from numpy behavior.
We also may need to add the division future import to more places.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5439 | 2013-11-05T11:46:16Z | 2013-11-05T22:53:10Z | 2013-11-05T22:53:10Z | 2014-06-23T22:30:35Z |
BUG: pd.to_timedelta handles missing data | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 4b33c20424b33..fde13941d0266 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -771,6 +771,7 @@ Bug Fixes
- Fix empty series not printing name in repr (:issue:`4651`)
- Make tests create temp files in temp directory by default. (:issue:`5419`)
- ``pd.to_timedelta`` of a scalar returns a scalar (:issue:`5410`)
+ - ``pd.to_timedelta`` accepts ``NaN`` and ``NaT``, returning ``NaT`` instead of raising (:issue:`5437`)
pandas 0.12.0
-------------
diff --git a/pandas/core/internals.py b/pandas/core/internals.py
index 62aa95d270924..3ce9b9288e8c7 100644
--- a/pandas/core/internals.py
+++ b/pandas/core/internals.py
@@ -1162,15 +1162,25 @@ def _try_fill(self, value):
def _try_coerce_args(self, values, other):
""" provide coercion to our input arguments
- we are going to compare vs i8, so coerce to integer
- values is always ndarra like, other may not be """
- values = values.view('i8')
+ we are going to compare vs i8, so coerce to floats
+ repring NaT with np.nan so nans propagate
+ values is always ndarray like, other may not be """
+ def masker(v):
+ mask = isnull(v)
+ v = v.view('i8').astype('float64')
+ v[mask] = np.nan
+ return v
+
+ values = masker(values)
+
if isnull(other) or (np.isscalar(other) and other == tslib.iNaT):
- other = tslib.iNaT
+ other = np.nan
elif isinstance(other, np.timedelta64):
other = _coerce_scalar_to_timedelta_type(other,unit='s').item()
+ if other == tslib.iNaT:
+ other = np.nan
else:
- other = other.view('i8')
+ other = masker(other)
return values, other
diff --git a/pandas/core/ops.py b/pandas/core/ops.py
index 0c647bb6ee7eb..5e800ffd82306 100644
--- a/pandas/core/ops.py
+++ b/pandas/core/ops.py
@@ -255,7 +255,7 @@ def __init__(self, left, right, name):
self.name = name
lvalues = self._convert_to_array(left, name=name)
- rvalues = self._convert_to_array(right, name=name)
+ rvalues = self._convert_to_array(right, name=name, other=lvalues)
self.is_timedelta_lhs = com.is_timedelta64_dtype(left)
self.is_datetime_lhs = com.is_datetime64_dtype(left)
@@ -317,7 +317,7 @@ def _validate(self):
'of a series/ndarray of type datetime64[ns] '
'or a timedelta')
- def _convert_to_array(self, values, name=None):
+ def _convert_to_array(self, values, name=None, other=None):
"""converts values to ndarray"""
from pandas.tseries.timedeltas import _possibly_cast_to_timedelta
@@ -325,9 +325,16 @@ def _convert_to_array(self, values, name=None):
if not is_list_like(values):
values = np.array([values])
inferred_type = lib.infer_dtype(values)
+
if inferred_type in ('datetime64', 'datetime', 'date', 'time'):
+ # if we have a other of timedelta, but use pd.NaT here we
+ # we are in the wrong path
+ if other is not None and other.dtype == 'timedelta64[ns]' and all(isnull(v) for v in values):
+ values = np.empty(values.shape,dtype=other.dtype)
+ values[:] = tslib.iNaT
+
# a datetlike
- if not (isinstance(values, (pa.Array, pd.Series)) and
+ elif not (isinstance(values, (pa.Array, pd.Series)) and
com.is_datetime64_dtype(values)):
values = tslib.array_to_datetime(values)
elif isinstance(values, pd.DatetimeIndex):
@@ -354,6 +361,15 @@ def _convert_to_array(self, values, name=None):
', '.join([com.pprint_thing(v)
for v in values[mask]])))
values = _possibly_cast_to_timedelta(os, coerce=coerce)
+ elif inferred_type == 'floating':
+
+ # all nan, so ok, use the other dtype (e.g. timedelta or datetime)
+ if isnull(values).all():
+ values = np.empty(values.shape,dtype=other.dtype)
+ values[:] = tslib.iNaT
+ else:
+ raise TypeError("incompatible type [{0}] for a datetime/timedelta"
+ " operation".format(pa.array(values).dtype))
else:
raise TypeError("incompatible type [{0}] for a datetime/timedelta"
" operation".format(pa.array(values).dtype))
@@ -452,6 +468,8 @@ def na_op(x, y):
def wrapper(left, right, name=name):
+ if isinstance(right, pd.DataFrame):
+ return NotImplemented
time_converted = _TimeOp.maybe_convert_for_time_op(left, right, name)
if time_converted is None:
@@ -488,8 +506,6 @@ def wrapper(left, right, name=name):
return left._constructor(wrap_results(arr), index=index,
name=name, dtype=dtype)
- elif isinstance(right, pd.DataFrame):
- return NotImplemented
else:
# scalars
if hasattr(lvalues, 'values'):
diff --git a/pandas/tseries/tests/test_timedeltas.py b/pandas/tseries/tests/test_timedeltas.py
index 199ad19986b39..df03851ca4ddb 100644
--- a/pandas/tseries/tests/test_timedeltas.py
+++ b/pandas/tseries/tests/test_timedeltas.py
@@ -195,6 +195,122 @@ def test_timedelta_ops(self):
expected = to_timedelta('00:00:08')
tm.assert_almost_equal(result, expected)
+ def test_to_timedelta_on_missing_values(self):
+ _skip_if_numpy_not_friendly()
+
+ # GH5438
+ timedelta_NaT = np.timedelta64('NaT')
+
+ actual = pd.to_timedelta(Series(['00:00:01', np.nan]))
+ expected = Series([np.timedelta64(1000000000, 'ns'), timedelta_NaT], dtype='<m8[ns]')
+ assert_series_equal(actual, expected)
+
+ actual = pd.to_timedelta(Series(['00:00:01', pd.NaT]))
+ assert_series_equal(actual, expected)
+
+ actual = pd.to_timedelta(np.nan)
+ self.assert_(actual == timedelta_NaT)
+
+ actual = pd.to_timedelta(pd.NaT)
+ self.assert_(actual == timedelta_NaT)
+
+ def test_timedelta_ops_with_missing_values(self):
+ _skip_if_numpy_not_friendly()
+
+ # setup
+ s1 = pd.to_timedelta(Series(['00:00:01']))
+ s2 = pd.to_timedelta(Series(['00:00:02']))
+ sn = pd.to_timedelta(Series([pd.NaT]))
+ df1 = DataFrame(['00:00:01']).apply(pd.to_timedelta)
+ df2 = DataFrame(['00:00:02']).apply(pd.to_timedelta)
+ dfn = DataFrame([pd.NaT]).apply(pd.to_timedelta)
+ scalar1 = pd.to_timedelta('00:00:01')
+ scalar2 = pd.to_timedelta('00:00:02')
+ timedelta_NaT = pd.to_timedelta('NaT')
+ NA = np.nan
+
+ actual = scalar1 + scalar1
+ self.assert_(actual == scalar2)
+ actual = scalar2 - scalar1
+ self.assert_(actual == scalar1)
+
+ actual = s1 + s1
+ assert_series_equal(actual, s2)
+ actual = s2 - s1
+ assert_series_equal(actual, s1)
+
+ actual = s1 + scalar1
+ assert_series_equal(actual, s2)
+ actual = s2 - scalar1
+ assert_series_equal(actual, s1)
+
+ actual = s1 + timedelta_NaT
+ assert_series_equal(actual, sn)
+ actual = s1 - timedelta_NaT
+ assert_series_equal(actual, sn)
+
+ actual = s1 + NA
+ assert_series_equal(actual, sn)
+ actual = s1 - NA
+ assert_series_equal(actual, sn)
+
+ actual = s1 + pd.NaT # NaT is datetime, not timedelta
+ assert_series_equal(actual, sn)
+ actual = s2 - pd.NaT
+ assert_series_equal(actual, sn)
+
+ actual = s1 + df1
+ assert_frame_equal(actual, df2)
+ actual = s2 - df1
+ assert_frame_equal(actual, df1)
+ actual = df1 + s1
+ assert_frame_equal(actual, df2)
+ actual = df2 - s1
+ assert_frame_equal(actual, df1)
+
+ actual = df1 + df1
+ assert_frame_equal(actual, df2)
+ actual = df2 - df1
+ assert_frame_equal(actual, df1)
+
+ actual = df1 + scalar1
+ assert_frame_equal(actual, df2)
+ actual = df2 - scalar1
+ assert_frame_equal(actual, df1)
+
+ actual = df1 + timedelta_NaT
+ assert_frame_equal(actual, dfn)
+ actual = df1 - timedelta_NaT
+ assert_frame_equal(actual, dfn)
+
+ actual = df1 + NA
+ assert_frame_equal(actual, dfn)
+ actual = df1 - NA
+ assert_frame_equal(actual, dfn)
+
+ actual = df1 + pd.NaT # NaT is datetime, not timedelta
+ assert_frame_equal(actual, dfn)
+ actual = df1 - pd.NaT
+ assert_frame_equal(actual, dfn)
+
+ def test_apply_to_timedelta(self):
+ _skip_if_numpy_not_friendly()
+
+ timedelta_NaT = pd.to_timedelta('NaT')
+
+ list_of_valid_strings = ['00:00:01', '00:00:02']
+ a = pd.to_timedelta(list_of_valid_strings)
+ b = Series(list_of_valid_strings).apply(pd.to_timedelta)
+ # Can't compare until apply on a Series gives the correct dtype
+ # assert_series_equal(a, b)
+
+ list_of_strings = ['00:00:01', np.nan, pd.NaT, timedelta_NaT]
+ a = pd.to_timedelta(list_of_strings)
+ b = Series(list_of_strings).apply(pd.to_timedelta)
+ # Can't compare until apply on a Series gives the correct dtype
+ # assert_series_equal(a, b)
+
+
if __name__ == '__main__':
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
exit=False)
diff --git a/pandas/tseries/timedeltas.py b/pandas/tseries/timedeltas.py
index 862dc8d410996..835401a13403f 100644
--- a/pandas/tseries/timedeltas.py
+++ b/pandas/tseries/timedeltas.py
@@ -9,7 +9,7 @@
import pandas.tslib as tslib
from pandas import compat, _np_version_under1p7
from pandas.core.common import (ABCSeries, is_integer, is_timedelta64_dtype,
- _values_from_object, is_list_like)
+ _values_from_object, is_list_like, isnull)
repr_timedelta = tslib.repr_timedelta64
repr_timedelta64 = tslib.repr_timedelta64
@@ -84,6 +84,8 @@ def conv(v):
r = conv(r)
elif r == tslib.iNaT:
return r
+ elif isnull(r):
+ return np.timedelta64('NaT')
elif isinstance(r, np.timedelta64):
r = r.astype("m8[{0}]".format(unit.lower()))
elif is_integer(r):
| closes #5437
**Updated**: Mostly following @jreback's suggestion, but we need `np.timedelta64('NaT')`, not `pd.tslib.iNaT`, because numpy cannot cast `np.datetime64('NaT')` as `np.timedelta64` type, and throws an `AssertionError`.
```
In [1]: pd.to_timedelta(Series(['00:00:01', '00:00:02']))
Out[1]:
0 00:00:01
1 00:00:02
dtype: timedelta64[ns]
In [2]: pd.to_timedelta(Series(['00:00:01', np.nan]))
Out[2]:
0 00:00:01
1 NaT
dtype: timedelta64[ns]
In [3]: pd.to_timedelta(Series(['00:00:01', pd.NaT]))
Out[3]:
0 00:00:01
1 NaT
dtype: timedelta64[ns]
```
| https://api.github.com/repos/pandas-dev/pandas/pulls/5438 | 2013-11-05T03:27:15Z | 2013-11-06T23:51:20Z | 2013-11-06T23:51:20Z | 2014-06-24T21:15:32Z |
BUG/TST: bug in the test apparatus when dtypes are equal in a Series but the values are not equal | diff --git a/pandas/src/testing.pyx b/pandas/src/testing.pyx
index 404b97879e2be..c573d8b2afbad 100644
--- a/pandas/src/testing.pyx
+++ b/pandas/src/testing.pyx
@@ -88,9 +88,10 @@ cpdef assert_almost_equal(a, b, bint check_less_precise=False):
return True
except:
pass
- else:
- for i in xrange(na):
- assert_almost_equal(a[i], b[i], check_less_precise)
+
+ for i in xrange(na):
+ assert_almost_equal(a[i], b[i], check_less_precise)
+
return True
elif isiterable(b):
assert False, (
diff --git a/pandas/tests/test_testing.py b/pandas/tests/test_testing.py
index 8431d91a8fff6..c3c1c4f5977e6 100644
--- a/pandas/tests/test_testing.py
+++ b/pandas/tests/test_testing.py
@@ -6,9 +6,9 @@
import nose
import numpy as np
import sys
-
+from pandas import Series
from pandas.util.testing import (
- assert_almost_equal, assertRaisesRegexp, raise_with_traceback
+ assert_almost_equal, assertRaisesRegexp, raise_with_traceback, assert_series_equal
)
# let's get meta.
@@ -127,3 +127,29 @@ def test_raise_with_traceback(self):
e = LookupError("error_text")
_, _, traceback = sys.exc_info()
raise_with_traceback(e, traceback)
+
+class TestAssertSeriesEqual(unittest.TestCase):
+ _multiprocess_can_split_ = True
+
+ def _assert_equal(self, x, y, **kwargs):
+ assert_series_equal(x,y,**kwargs)
+ assert_series_equal(y,x,**kwargs)
+
+ def _assert_not_equal(self, a, b, **kwargs):
+ self.assertRaises(AssertionError, assert_series_equal, a, b, **kwargs)
+ self.assertRaises(AssertionError, assert_series_equal, b, a, **kwargs)
+
+ def test_equal(self):
+ self._assert_equal(Series(range(3)),Series(range(3)))
+ self._assert_equal(Series(list('abc')),Series(list('abc')))
+
+ def test_not_equal(self):
+ self._assert_not_equal(Series(range(3)),Series(range(3))+1)
+ self._assert_not_equal(Series(list('abc')),Series(list('xyz')))
+ self._assert_not_equal(Series(range(3)),Series(range(4)))
+ self._assert_not_equal(Series(range(3)),Series(range(3),dtype='float64'))
+ self._assert_not_equal(Series(range(3)),Series(range(3),index=[1,2,4]))
+
+ # ATM meta data is not checked in assert_series_equal
+ # self._assert_not_equal(Series(range(3)),Series(range(3),name='foo'),check_names=True)
+
| noticed in #5429
| https://api.github.com/repos/pandas-dev/pandas/pulls/5434 | 2013-11-04T22:01:12Z | 2013-11-04T22:49:49Z | 2013-11-04T22:49:49Z | 2014-07-11T22:41:28Z |
BUG: fix Resampling a Series with a timezone using kind='period' (GH5430) | diff --git a/pandas/tseries/resample.py b/pandas/tseries/resample.py
index 96ff8c47abc1e..5377543ac8c54 100644
--- a/pandas/tseries/resample.py
+++ b/pandas/tseries/resample.py
@@ -192,7 +192,9 @@ def _get_time_period_bins(self, axis):
labels = binner = PeriodIndex(start=axis[0], end=axis[-1],
freq=self.freq)
- end_stamps = (labels + 1).asfreq('D', 's').to_timestamp()
+ end_stamps = (labels + 1).asfreq(self.freq, 's').to_timestamp()
+ if axis.tzinfo:
+ end_stamps = end_stamps.tz_localize(axis.tzinfo)
bins = axis.searchsorted(end_stamps, side='left')
return binner, bins, labels
diff --git a/pandas/tseries/tests/test_timeseries.py b/pandas/tseries/tests/test_timeseries.py
index b8144c2b5eab9..51939ac22e956 100644
--- a/pandas/tseries/tests/test_timeseries.py
+++ b/pandas/tseries/tests/test_timeseries.py
@@ -1836,6 +1836,37 @@ def test_concat_datetime_datetime64_frame(self):
# it works!
pd.concat([df1, df2_obj])
+ def test_period_resample(self):
+ # GH3609
+ s = Series(range(100),index=date_range('20130101', freq='s', periods=100), dtype='float')
+ s[10:30] = np.nan
+ expected = Series([34.5, 79.5], index=[Period('2013-01-01 00:00', 'T'), Period('2013-01-01 00:01', 'T')])
+ result = s.to_period().resample('T', kind='period')
+ assert_series_equal(result, expected)
+ result2 = s.resample('T', kind='period')
+ assert_series_equal(result2, expected)
+
+ def test_period_resample_with_local_timezone(self):
+ # GH5430
+ _skip_if_no_pytz()
+ import pytz
+
+ local_timezone = pytz.timezone('America/Los_Angeles')
+
+ start = datetime(year=2013, month=11, day=1, hour=0, minute=0, tzinfo=pytz.utc)
+ # 1 day later
+ end = datetime(year=2013, month=11, day=2, hour=0, minute=0, tzinfo=pytz.utc)
+
+ index = pd.date_range(start, end, freq='H')
+
+ series = pd.Series(1, index=index)
+ series = series.tz_convert(local_timezone)
+ result = series.resample('D', kind='period')
+ # Create the expected series
+ expected_index = (pd.period_range(start=start, end=end, freq='D') - 1) # Index is moved back a day with the timezone conversion from UTC to Pacific
+ expected = pd.Series(1, index=expected_index)
+ assert_series_equal(result, expected)
+
def _simple_ts(start, end, freq='D'):
rng = date_range(start, end, freq=freq)
| There's a failing test case and the patch in subsequent commits.
closes #5430
closes #3609
| https://api.github.com/repos/pandas-dev/pandas/pulls/5432 | 2013-11-04T20:11:40Z | 2013-11-06T00:23:40Z | 2013-11-06T00:23:40Z | 2014-07-16T08:39:13Z |
BUG: Excel writer doesn't handle "cols" option correctly | diff --git a/pandas/core/format.py b/pandas/core/format.py
index 5062fd9be6357..ae0d95b1c3074 100644
--- a/pandas/core/format.py
+++ b/pandas/core/format.py
@@ -1393,8 +1393,12 @@ def _format_regular_rows(self):
for idx, idxval in enumerate(index_values):
yield ExcelCell(self.rowcounter + idx, 0, idxval, header_style)
+ # Get a frame that will account for any duplicates in the column names.
+ col_mapped_frame = self.df.loc[:, self.columns]
+
+ # Write the body of the frame data series by series.
for colidx in range(len(self.columns)):
- series = self.df.iloc[:, colidx]
+ series = col_mapped_frame.iloc[:, colidx]
for i, val in enumerate(series):
yield ExcelCell(self.rowcounter + i, colidx + coloffset, val)
@@ -1461,8 +1465,12 @@ def _format_hierarchical_rows(self):
header_style)
gcolidx += 1
+ # Get a frame that will account for any duplicates in the column names.
+ col_mapped_frame = self.df.loc[:, self.columns]
+
+ # Write the body of the frame data series by series.
for colidx in range(len(self.columns)):
- series = self.df.iloc[:, colidx]
+ series = col_mapped_frame.iloc[:, colidx]
for i, val in enumerate(series):
yield ExcelCell(self.rowcounter + i, gcolidx + colidx, val)
diff --git a/pandas/io/tests/test_excel.py b/pandas/io/tests/test_excel.py
index 8bcf5e461ce7c..a126bd965e4b6 100644
--- a/pandas/io/tests/test_excel.py
+++ b/pandas/io/tests/test_excel.py
@@ -922,11 +922,25 @@ def test_duplicated_columns(self):
write_frame.columns = colnames
write_frame.to_excel(path, 'test1')
- read_frame = read_excel(path, 'test1').astype(np.int64)
+ read_frame = read_excel(path, 'test1')
read_frame.columns = colnames
tm.assert_frame_equal(write_frame, read_frame)
+ def test_swapped_columns(self):
+ # Test for issue #5427.
+ _skip_if_no_xlrd()
+
+ with ensure_clean(self.ext) as path:
+ write_frame = DataFrame({'A': [1, 1, 1],
+ 'B': [2, 2, 2]})
+ write_frame.to_excel(path, 'test1', cols=['B', 'A'])
+
+ read_frame = read_excel(path, 'test1', header=0)
+
+ tm.assert_series_equal(write_frame['A'], read_frame['A'])
+ tm.assert_series_equal(write_frame['B'], read_frame['B'])
+
class OpenpyxlTests(ExcelWriterBase, unittest.TestCase):
ext = '.xlsx'
| closes #5427
Notes on this PR:
- This fix addresses an issue introduced in #5235 (Issue with Excel writers when column names are duplicated).
- Basically it needs to handle 2 different use cases:
- The user uses duplicate column names
- The user specifies a different order via the `cols` option
``` python
# Case 1
df = pd.DataFrame([[1, 2, 3], [1, 2, 3], [1, 2, 3]])
df.columns = ['A', 'B', 'B']
```
``` python
# Case 2
df = pd.DataFrame({'A': ['a', 'a', 'a'],
'B': ['b', 'b', 'b']})
df.to_excel('frame.xlsx', sheet_name='Sheet1', cols=['B', 'A'])
```
The proposed solution is to iterate through self.columns in the default or user supplied order. If a duplicate column name is encountered (i.e. if `df['B']` returns more than one series) then we select the first series and keep track of that index. If the duplicate column name is encountered again then we select the next available series from `df['B']` up to the last series available. If the duplicate name is encountered again then we return the last series again.
The patch is slightly kludgy. I didn't know how to check if `df[col]` contained more than one series so I used `len(self.df[col_name].columns)` in a `try:catch`. Hopefully there is something cleaner.
The change is repeated twice in the code.
There is a new test for this issue and an existing test for the previous issue.
I don't think this needs a release note since it is a fix for an issue that was never released.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5429 | 2013-11-04T01:38:29Z | 2013-11-06T22:16:21Z | 2013-11-06T22:16:21Z | 2014-07-02T22:44:20Z |
BUG: not clearing the cache when reindexing issue when partial setting (GH5424) | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 6e10bd651d90a..19639e2e759e1 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -660,7 +660,7 @@ Bug Fixes
the ``by`` argument was passed (:issue:`4112`, :issue:`4113`).
- Fixed a bug in ``convert_objects`` for > 2 ndims (:issue:`4937`)
- Fixed a bug in DataFrame/Panel cache insertion and subsequent indexing
- (:issue:`4939`)
+ (:issue:`4939`, :issue:`5424`)
- Fixed string methods for ``FrozenNDArray`` and ``FrozenList``
(:issue:`4929`)
- Fixed a bug with setting invalid or out-of-range values in indexing
diff --git a/pandas/core/indexing.py b/pandas/core/indexing.py
index 0bc0afaf255f2..c854e0b086994 100644
--- a/pandas/core/indexing.py
+++ b/pandas/core/indexing.py
@@ -189,9 +189,13 @@ def _setitem_with_indexer(self, indexer, value):
return self.obj
# reindex the axis
+ # make sure to clear the cache because we are
+ # just replacing the block manager here
+ # so the object is the same
index = self.obj._get_axis(i)
labels = _safe_append_to_index(index, key)
self.obj._data = self.obj.reindex_axis(labels,i)._data
+ self.obj._maybe_update_cacher(clear=True)
if isinstance(labels,MultiIndex):
self.obj.sortlevel(inplace=True)
@@ -223,7 +227,8 @@ def _setitem_with_indexer(self, indexer, value):
if len(self.obj.values):
new_values = np.concatenate([self.obj.values, new_values])
- self.obj._data = self.obj._constructor(new_values, index=new_index, name=self.obj.name)
+ self.obj._data = self.obj._constructor(new_values,
+ index=new_index, name=self.obj.name)._data
self.obj._maybe_update_cacher(clear=True)
return self.obj
diff --git a/pandas/tests/test_frame.py b/pandas/tests/test_frame.py
index b73c7cdbb8f87..6b487cb006a80 100644
--- a/pandas/tests/test_frame.py
+++ b/pandas/tests/test_frame.py
@@ -3539,24 +3539,6 @@ def test_operators_timedelta64(self):
self.assertTrue(df['off1'].dtype == 'timedelta64[ns]')
self.assertTrue(df['off2'].dtype == 'timedelta64[ns]')
- def test__slice_consolidate_invalidate_item_cache(self):
- # #3970
- df = DataFrame({ "aa":lrange(5), "bb":[2.2]*5})
-
- # Creates a second float block
- df["cc"] = 0.0
-
- # caches a reference to the 'bb' series
- df["bb"]
-
- # repr machinery triggers consolidation
- repr(df)
-
- # Assignment to wrong series
- df['bb'].iloc[0] = 0.17
- df._clear_item_cache()
- self.assertAlmostEqual(df['bb'][0], 0.17)
-
def test_new_empty_index(self):
df1 = DataFrame(randn(0, 3))
df2 = DataFrame(randn(0, 3))
diff --git a/pandas/tests/test_indexing.py b/pandas/tests/test_indexing.py
index 2cb26804ea4be..2ad9f10d1b990 100644
--- a/pandas/tests/test_indexing.py
+++ b/pandas/tests/test_indexing.py
@@ -1645,6 +1645,41 @@ def test_cache_updating(self):
result = df.loc[(0,0),'z']
self.assert_(result == 2)
+ def test_slice_consolidate_invalidate_item_cache(self):
+ # #3970
+ df = DataFrame({ "aa":lrange(5), "bb":[2.2]*5})
+
+ # Creates a second float block
+ df["cc"] = 0.0
+
+ # caches a reference to the 'bb' series
+ df["bb"]
+
+ # repr machinery triggers consolidation
+ repr(df)
+
+ # Assignment to wrong series
+ df['bb'].iloc[0] = 0.17
+ df._clear_item_cache()
+ self.assertAlmostEqual(df['bb'][0], 0.17)
+
+ def test_setitem_cache_updating(self):
+ # GH 5424
+ cont = ['one', 'two','three', 'four', 'five', 'six', 'seven']
+
+ for do_ref in [False,False]:
+ df = DataFrame({'a' : cont, "b":cont[3:]+cont[:3] ,'c' : np.arange(7)})
+
+ # ref the cache
+ if do_ref:
+ df.ix[0,"c"]
+
+ # set it
+ df.ix[7,'c'] = 1
+
+ self.assert_(df.ix[0,'c'] == 0.0)
+ self.assert_(df.ix[7,'c'] == 1.0)
+
def test_floating_index_doc_example(self):
index = Index([1.5, 2, 3, 4.5, 5])
| closes #5424
| https://api.github.com/repos/pandas-dev/pandas/pulls/5426 | 2013-11-04T00:13:08Z | 2013-11-04T00:40:53Z | 2013-11-04T00:40:53Z | 2014-06-23T22:17:11Z |
TST: Use tempfiles in all tests. | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 6e10bd651d90a..04642c358d000 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -769,6 +769,7 @@ Bug Fixes
- The GroupBy methods ``transform`` and ``filter`` can be used on Series
and DataFrames that have repeated (non-unique) indices. (:issue:`4620`)
- Fix empty series not printing name in repr (:issue:`4651`)
+ - Make tests create temp files in temp directory by default. (:issue:`5419`)
pandas 0.12.0
-------------
diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py
index 97dc8dcdec73a..975d04c185d51 100644
--- a/pandas/io/pytables.py
+++ b/pandas/io/pytables.py
@@ -225,11 +225,6 @@ def _tables():
return _table_mod
-def h5_open(path, mode):
- tables = _tables()
- return tables.openFile(path, mode)
-
-
@contextmanager
def get_store(path, **kwargs):
"""
@@ -389,6 +384,10 @@ def root(self):
self._check_if_open()
return self._handle.root
+ @property
+ def filename(self):
+ return self._path
+
def __getitem__(self, key):
return self.get(key)
@@ -475,6 +474,8 @@ def open(self, mode='a'):
mode : {'a', 'w', 'r', 'r+'}, default 'a'
See HDFStore docstring or tables.openFile for info about modes
"""
+ tables = _tables()
+
if self._mode != mode:
# if we are chaning a write mode to read, ok
@@ -501,13 +502,20 @@ def open(self, mode='a'):
fletcher32=self._fletcher32)
try:
- self._handle = h5_open(self._path, self._mode)
- except IOError as e: # pragma: no cover
+ self._handle = tables.openFile(self._path, self._mode)
+ except (IOError) as e: # pragma: no cover
if 'can not be written' in str(e):
print('Opening %s in read-only mode' % self._path)
- self._handle = h5_open(self._path, 'r')
+ self._handle = tables.openFile(self._path, 'r')
else:
raise
+ except (Exception) as e:
+
+ # trying to read from a non-existant file causes an error which
+ # is not part of IOError, make it one
+ if self._mode == 'r' and 'Unable to open/create file' in str(e):
+ raise IOError(str(e))
+ raise
def close(self):
"""
diff --git a/pandas/io/tests/test_excel.py b/pandas/io/tests/test_excel.py
index 311a0953f1c02..6eb3cbf1a3903 100644
--- a/pandas/io/tests/test_excel.py
+++ b/pandas/io/tests/test_excel.py
@@ -261,10 +261,9 @@ def test_read_xlrd_Book(self):
import xlrd
- pth = '__tmp_excel_read_worksheet__.xls'
df = self.frame
- with ensure_clean(pth) as pth:
+ with ensure_clean('.xls') as pth:
df.to_excel(pth, "SheetA")
book = xlrd.open_workbook(pth)
@@ -303,7 +302,7 @@ def test_reader_closes_file(self):
f = open(pth, 'rb')
with ExcelFile(f) as xlsx:
# parses okay
- df = xlsx.parse('Sheet1', index_col=0)
+ xlsx.parse('Sheet1', index_col=0)
self.assertTrue(f.closed)
@@ -364,12 +363,12 @@ class ExcelWriterBase(SharedItems):
# 1. A check_skip function that skips your tests if your writer isn't
# installed.
# 2. Add a property ext, which is the file extension that your writer
- # writes to.
+ # writes to. (needs to start with '.' so it's a valid path)
# 3. Add a property engine_name, which is the name of the writer class.
def setUp(self):
self.check_skip()
super(ExcelWriterBase, self).setUp()
- self.option_name = 'io.excel.%s.writer' % self.ext
+ self.option_name = 'io.excel.%s.writer' % self.ext.strip('.')
self.prev_engine = get_option(self.option_name)
set_option(self.option_name, self.engine_name)
@@ -380,10 +379,7 @@ def test_excel_sheet_by_name_raise(self):
_skip_if_no_xlrd()
import xlrd
- ext = self.ext
- pth = os.path.join(self.dirpath, 'testit.{0}'.format(ext))
-
- with ensure_clean(pth) as pth:
+ with ensure_clean(self.ext) as pth:
gt = DataFrame(np.random.randn(10, 2))
gt.to_excel(pth)
xl = ExcelFile(pth)
@@ -394,10 +390,8 @@ def test_excel_sheet_by_name_raise(self):
def test_excelwriter_contextmanager(self):
_skip_if_no_xlrd()
- ext = self.ext
- pth = os.path.join(self.dirpath, 'testit.{0}'.format(ext))
- with ensure_clean(pth) as pth:
+ with ensure_clean(self.ext) as pth:
with ExcelWriter(pth) as writer:
self.frame.to_excel(writer, 'Data1')
self.frame2.to_excel(writer, 'Data2')
@@ -410,10 +404,8 @@ def test_excelwriter_contextmanager(self):
def test_roundtrip(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_from_excel__.' + ext
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
self.frame['A'][:5] = nan
self.frame.to_excel(path, 'test1')
@@ -446,10 +438,8 @@ def test_roundtrip(self):
def test_mixed(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_from_excel_mixed__.' + ext
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
self.mixed_frame.to_excel(path, 'test1')
reader = ExcelFile(path)
recons = reader.parse('test1', index_col=0)
@@ -457,12 +447,10 @@ def test_mixed(self):
def test_tsframe(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_from_excel_tsframe__.' + ext
df = tm.makeTimeDataFrame()[:5]
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
df.to_excel(path, 'test1')
reader = ExcelFile(path)
recons = reader.parse('test1')
@@ -470,22 +458,19 @@ def test_tsframe(self):
def test_basics_with_nan(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_from_excel_int_types__.' + ext
- self.frame['A'][:5] = nan
- self.frame.to_excel(path, 'test1')
- self.frame.to_excel(path, 'test1', cols=['A', 'B'])
- self.frame.to_excel(path, 'test1', header=False)
- self.frame.to_excel(path, 'test1', index=False)
+ with ensure_clean(self.ext) as path:
+ self.frame['A'][:5] = nan
+ self.frame.to_excel(path, 'test1')
+ self.frame.to_excel(path, 'test1', cols=['A', 'B'])
+ self.frame.to_excel(path, 'test1', header=False)
+ self.frame.to_excel(path, 'test1', index=False)
def test_int_types(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_from_excel_int_types__.' + ext
for np_type in (np.int8, np.int16, np.int32, np.int64):
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
# Test np.int values read come back as int (rather than float
# which is Excel's format).
frame = DataFrame(np.random.randint(-10, 10, size=(10, 2)),
@@ -505,11 +490,9 @@ def test_int_types(self):
def test_float_types(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_from_excel_float_types__.' + ext
for np_type in (np.float16, np.float32, np.float64):
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
# Test np.float values read come back as float.
frame = DataFrame(np.random.random_sample(10), dtype=np_type)
frame.to_excel(path, 'test1')
@@ -519,11 +502,9 @@ def test_float_types(self):
def test_bool_types(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_from_excel_bool_types__.' + ext
for np_type in (np.bool8, np.bool_):
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
# Test np.bool values read come back as float.
frame = (DataFrame([1, 0, True, False], dtype=np_type))
frame.to_excel(path, 'test1')
@@ -533,10 +514,8 @@ def test_bool_types(self):
def test_sheets(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_from_excel_sheets__.' + ext
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
self.frame['A'][:5] = nan
self.frame.to_excel(path, 'test1')
@@ -560,10 +539,8 @@ def test_sheets(self):
def test_colaliases(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_from_excel_aliases__.' + ext
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
self.frame['A'][:5] = nan
self.frame.to_excel(path, 'test1')
@@ -582,10 +559,8 @@ def test_colaliases(self):
def test_roundtrip_indexlabels(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_from_excel_indexlabels__.' + ext
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
self.frame['A'][:5] = nan
@@ -617,10 +592,7 @@ def test_roundtrip_indexlabels(self):
frame.index.names = ['test']
self.assertEqual(frame.index.names, recons.index.names)
- # test index_labels in same row as column names
- path = '%s.%s' % (tm.rands(10), ext)
-
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
self.frame.to_excel(path, 'test1',
cols=['A', 'B', 'C', 'D'], index=False)
@@ -636,12 +608,10 @@ def test_roundtrip_indexlabels(self):
def test_excel_roundtrip_indexname(self):
_skip_if_no_xlrd()
- path = '%s.%s' % (tm.rands(10), self.ext)
-
df = DataFrame(np.random.randn(10, 4))
df.index.name = 'foo'
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
df.to_excel(path)
xf = ExcelFile(path)
@@ -656,7 +626,7 @@ def test_excel_roundtrip_datetime(self):
# datetime.date, not sure what to test here exactly
path = '__tmp_excel_roundtrip_datetime__.' + self.ext
tsf = self.tsframe.copy()
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
tsf.index = [x.date() for x in self.tsframe.index]
tsf.to_excel(path, 'test1')
@@ -670,7 +640,7 @@ def test_to_excel_periodindex(self):
frame = self.tsframe
xp = frame.resample('M', kind='period')
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
xp.to_excel(path, 'sht1')
reader = ExcelFile(path)
@@ -679,8 +649,6 @@ def test_to_excel_periodindex(self):
def test_to_excel_multiindex(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_multiindex__' + ext + '__.' + ext
frame = self.frame
old_index = frame.index
@@ -689,7 +657,7 @@ def test_to_excel_multiindex(self):
names=['first', 'second'])
frame.index = new_index
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
frame.to_excel(path, 'test1', header=False)
frame.to_excel(path, 'test1', cols=['A', 'B'])
@@ -703,8 +671,6 @@ def test_to_excel_multiindex(self):
def test_to_excel_multiindex_dates(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_multiindex_dates__' + ext + '__.' + ext
# try multiindex with dates
tsframe = self.tsframe
@@ -712,7 +678,7 @@ def test_to_excel_multiindex_dates(self):
new_index = [old_index, np.arange(len(old_index))]
tsframe.index = MultiIndex.from_arrays(new_index)
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
tsframe.to_excel(path, 'test1', index_label=['time', 'foo'])
reader = ExcelFile(path)
recons = reader.parse('test1', index_col=[0, 1])
@@ -736,7 +702,7 @@ def test_to_excel_float_format(self):
[12.32112, 123123.2, 321321.2]],
index=['A', 'B'], columns=['X', 'Y', 'Z'])
- with ensure_clean(filename) as filename:
+ with ensure_clean(self.ext) as filename:
df.to_excel(filename, 'test1', float_format='%.2f')
reader = ExcelFile(filename)
@@ -748,21 +714,18 @@ def test_to_excel_float_format(self):
def test_to_excel_unicode_filename(self):
_skip_if_no_xlrd()
- ext = self.ext
- filename = u('\u0192u.') + ext
-
- try:
- f = open(filename, 'wb')
- except UnicodeEncodeError:
- raise nose.SkipTest('no unicode file names on this system')
- else:
- f.close()
-
- df = DataFrame([[0.123456, 0.234567, 0.567567],
- [12.32112, 123123.2, 321321.2]],
- index=['A', 'B'], columns=['X', 'Y', 'Z'])
+ with ensure_clean(u('\u0192u.') + self.ext) as filename:
+ try:
+ f = open(filename, 'wb')
+ except UnicodeEncodeError:
+ raise nose.SkipTest('no unicode file names on this system')
+ else:
+ f.close()
+
+ df = DataFrame([[0.123456, 0.234567, 0.567567],
+ [12.32112, 123123.2, 321321.2]],
+ index=['A', 'B'], columns=['X', 'Y', 'Z'])
- with ensure_clean(filename) as filename:
df.to_excel(filename, 'test1', float_format='%.2f')
reader = ExcelFile(filename)
@@ -879,10 +842,9 @@ def test_excel_010_hemstring(self):
# override of #2370 until sorted out in 0.11
def roundtrip(df, header=True, parser_hdr=0):
- path = '__tmp__test_xl_010_%s__.%s' % (np.random.randint(1, 10000), self.ext)
- df.to_excel(path, header=header)
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
+ df.to_excel(path, header=header)
xf = pd.ExcelFile(path)
res = xf.parse(xf.sheet_names[0], header=parser_hdr)
return res
@@ -926,10 +888,8 @@ def roundtrip(df, header=True, parser_hdr=0):
def test_duplicated_columns(self):
# Test for issue #5235.
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_duplicated_columns__.' + ext
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
write_frame = DataFrame([[1, 2, 3], [1, 2, 3], [1, 2, 3]])
colnames = ['A', 'B', 'B']
@@ -943,7 +903,7 @@ def test_duplicated_columns(self):
class OpenpyxlTests(ExcelWriterBase, unittest.TestCase):
- ext = 'xlsx'
+ ext = '.xlsx'
engine_name = 'openpyxl'
check_skip = staticmethod(_skip_if_no_openpyxl)
@@ -974,7 +934,7 @@ def test_to_excel_styleconverter(self):
class XlwtTests(ExcelWriterBase, unittest.TestCase):
- ext = 'xls'
+ ext = '.xls'
engine_name = 'xlwt'
check_skip = staticmethod(_skip_if_no_xlwt)
@@ -999,7 +959,7 @@ def test_to_excel_styleconverter(self):
class XlsxWriterTests(ExcelWriterBase, unittest.TestCase):
- ext = 'xlsx'
+ ext = '.xlsx'
engine_name = 'xlsxwriter'
check_skip = staticmethod(_skip_if_no_xlsxwriter)
@@ -1007,10 +967,8 @@ class XlsxWriterTests(ExcelWriterBase, unittest.TestCase):
# floating point values read back in from the output XlsxWriter file.
def test_roundtrip_indexlabels(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_from_excel_indexlabels__.' + ext
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
self.frame['A'][:5] = nan
diff --git a/pandas/io/tests/test_pytables.py b/pandas/io/tests/test_pytables.py
index 598f374e0fcf7..737acef209a50 100644
--- a/pandas/io/tests/test_pytables.py
+++ b/pandas/io/tests/test_pytables.py
@@ -3,6 +3,7 @@
import sys
import os
import warnings
+import tempfile
from contextlib import contextmanager
import datetime
@@ -54,18 +55,41 @@ def safe_close(store):
pass
+def create_tempfile(path):
+ """ create an unopened named temporary file """
+ return os.path.join(tempfile.gettempdir(),path)
+
@contextmanager
-def ensure_clean(path, mode='a', complevel=None, complib=None,
+def ensure_clean_store(path, mode='a', complevel=None, complib=None,
fletcher32=False):
- store = HDFStore(path, mode=mode, complevel=complevel,
- complib=complib, fletcher32=False)
+
try:
+
+ # put in the temporary path if we don't have one already
+ if not len(os.path.dirname(path)):
+ path = create_tempfile(path)
+
+ store = HDFStore(path, mode=mode, complevel=complevel,
+ complib=complib, fletcher32=False)
yield store
finally:
safe_close(store)
if mode == 'w' or mode == 'a':
safe_remove(path)
+@contextmanager
+def ensure_clean_path(path):
+ """
+ return essentially a named temporary file that is not opened
+ and deleted on existing
+ """
+
+ try:
+ filename = create_tempfile(path)
+ yield filename
+ finally:
+ safe_remove(filename)
+
# set these parameters so we don't have file sharing
tables.parameters.MAX_NUMEXPR_THREADS = 1
tables.parameters.MAX_BLOSC_THREADS = 1
@@ -94,7 +118,7 @@ class TestHDFStore(unittest.TestCase):
def setUp(self):
warnings.filterwarnings(action='ignore', category=FutureWarning)
- self.path = '__%s__.h5' % tm.rands(10)
+ self.path = 'tmp.__%s__.h5' % tm.rands(10)
def tearDown(self):
pass
@@ -151,7 +175,7 @@ def test_api(self):
# GH4584
# API issue when to_hdf doesn't acdept append AND format args
- with tm.ensure_clean(self.path) as path:
+ with ensure_clean_path(self.path) as path:
df = tm.makeDataFrame()
df.iloc[:10].to_hdf(path,'df',append=True,format='table')
@@ -163,7 +187,7 @@ def test_api(self):
df.iloc[10:].to_hdf(path,'df',append=True,format='table')
assert_frame_equal(read_hdf(path,'df'),df)
- with tm.ensure_clean(self.path) as path:
+ with ensure_clean_path(self.path) as path:
df = tm.makeDataFrame()
df.iloc[:10].to_hdf(path,'df',append=True)
@@ -175,7 +199,7 @@ def test_api(self):
df.iloc[10:].to_hdf(path,'df',append=True)
assert_frame_equal(read_hdf(path,'df'),df)
- with tm.ensure_clean(self.path) as path:
+ with ensure_clean_path(self.path) as path:
df = tm.makeDataFrame()
df.to_hdf(path,'df',append=False,format='fixed')
@@ -190,19 +214,24 @@ def test_api(self):
df.to_hdf(path,'df')
assert_frame_equal(read_hdf(path,'df'),df)
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
+ path = store._path
df = tm.makeDataFrame()
+
+ _maybe_remove(store,'df')
store.append('df',df.iloc[:10],append=True,format='table')
store.append('df',df.iloc[10:],append=True,format='table')
assert_frame_equal(read_hdf(path,'df'),df)
# append to False
+ _maybe_remove(store,'df')
store.append('df',df.iloc[:10],append=False,format='table')
store.append('df',df.iloc[10:],append=True,format='table')
assert_frame_equal(read_hdf(path,'df'),df)
# formats
+ _maybe_remove(store,'df')
store.append('df',df.iloc[:10],append=False,format='table')
store.append('df',df.iloc[10:],append=True,format='table')
assert_frame_equal(read_hdf(path,'df'),df)
@@ -212,7 +241,7 @@ def test_api(self):
store.append('df',df.iloc[10:],append=True,format=None)
assert_frame_equal(read_hdf(path,'df'),df)
- with tm.ensure_clean(self.path) as path:
+ with ensure_clean_path(self.path) as path:
# invalid
df = tm.makeDataFrame()
@@ -226,7 +255,7 @@ def test_api(self):
def test_api_default_format(self):
# default_format option
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
df = tm.makeDataFrame()
pandas.set_option('io.hdf.default_format','fixed')
@@ -245,7 +274,7 @@ def test_api_default_format(self):
pandas.set_option('io.hdf.default_format',None)
- with tm.ensure_clean(self.path) as path:
+ with ensure_clean_path(self.path) as path:
df = tm.makeDataFrame()
@@ -267,7 +296,7 @@ def test_api_default_format(self):
def test_keys(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store['a'] = tm.makeTimeSeries()
store['b'] = tm.makeStringSeries()
store['c'] = tm.makeDataFrame()
@@ -279,7 +308,7 @@ def test_keys(self):
def test_repr(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
repr(store)
store['a'] = tm.makeTimeSeries()
store['b'] = tm.makeStringSeries()
@@ -314,7 +343,7 @@ def test_repr(self):
str(store)
# storers
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
df = tm.makeDataFrame()
store.append('df',df)
@@ -325,7 +354,7 @@ def test_repr(self):
def test_contains(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store['a'] = tm.makeTimeSeries()
store['b'] = tm.makeDataFrame()
store['foo/bar'] = tm.makeDataFrame()
@@ -344,7 +373,7 @@ def test_contains(self):
def test_versioning(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store['a'] = tm.makeTimeSeries()
store['b'] = tm.makeDataFrame()
df = tm.makeTimeDataFrame()
@@ -370,7 +399,7 @@ def test_mode(self):
def check(mode):
- with tm.ensure_clean(self.path) as path:
+ with ensure_clean_path(self.path) as path:
# constructor
if mode in ['r','r+']:
@@ -381,7 +410,7 @@ def check(mode):
self.assert_(store._handle.mode == mode)
store.close()
- with tm.ensure_clean(self.path) as path:
+ with ensure_clean_path(self.path) as path:
# context
if mode in ['r','r+']:
@@ -393,7 +422,7 @@ def f():
with get_store(path,mode=mode) as store:
self.assert_(store._handle.mode == mode)
- with tm.ensure_clean(self.path) as path:
+ with ensure_clean_path(self.path) as path:
# conv write
if mode in ['r','r+']:
@@ -416,7 +445,7 @@ def f():
def test_reopen_handle(self):
- with tm.ensure_clean(self.path) as path:
+ with ensure_clean_path(self.path) as path:
store = HDFStore(path,mode='a')
store['a'] = tm.makeTimeSeries()
@@ -462,14 +491,14 @@ def test_reopen_handle(self):
def test_flush(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store['a'] = tm.makeTimeSeries()
store.flush()
store.flush(fsync=True)
def test_get(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store['a'] = tm.makeTimeSeries()
left = store.get('a')
right = store['a']
@@ -483,7 +512,7 @@ def test_get(self):
def test_getattr(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
s = tm.makeTimeSeries()
store['a'] = s
@@ -511,7 +540,7 @@ def test_getattr(self):
def test_put(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
ts = tm.makeTimeSeries()
df = tm.makeTimeDataFrame()
@@ -540,7 +569,7 @@ def test_put(self):
def test_put_string_index(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
index = Index(
["I am a very long string index: %s" % i for i in range(20)])
@@ -565,7 +594,7 @@ def test_put_string_index(self):
def test_put_compression(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
df = tm.makeTimeDataFrame()
store.put('c', df, format='table', complib='zlib')
@@ -579,7 +608,7 @@ def test_put_compression_blosc(self):
tm.skip_if_no_package('tables', '2.2', app='blosc support')
df = tm.makeTimeDataFrame()
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
# can't compress if format='fixed'
self.assertRaises(ValueError, store.put, 'b', df,
@@ -609,7 +638,7 @@ def test_put_mixed_type(self):
df.ix[3:6, ['obj1']] = np.nan
df = df.consolidate().convert_objects()
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
_maybe_remove(store, 'df')
# cannot use assert_produces_warning here for some reason
@@ -623,7 +652,7 @@ def test_put_mixed_type(self):
def test_append(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
df = tm.makeTimeDataFrame()
_maybe_remove(store, 'df1')
store.append('df1', df[:10])
@@ -711,7 +740,7 @@ def test_append(self):
def test_append_series(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
# basic
ss = tm.makeStringSeries()
@@ -759,7 +788,7 @@ def test_store_index_types(self):
# GH5386
# test storing various index types
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
def check(format,index):
df = DataFrame(np.random.randn(10,2),columns=list('AB'))
@@ -792,7 +821,7 @@ def test_encoding(self):
if sys.byteorder != 'little':
raise nose.SkipTest('system byteorder is not little, skipping test_encoding!')
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
df = DataFrame(dict(A='foo',B='bar'),index=range(5))
df.loc[2,'A'] = np.nan
df.loc[3,'B'] = np.nan
@@ -806,7 +835,7 @@ def test_encoding(self):
def test_append_some_nans(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
df = DataFrame({'A' : Series(np.random.randn(20)).astype('int32'),
'A1' : np.random.randn(20),
'A2' : np.random.randn(20),
@@ -845,7 +874,7 @@ def test_append_some_nans(self):
def test_append_all_nans(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
df = DataFrame({'A1' : np.random.randn(20),
'A2' : np.random.randn(20)},
@@ -916,7 +945,7 @@ def test_append_all_nans(self):
def test_append_frame_column_oriented(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
# column oriented
df = tm.makeTimeDataFrame()
@@ -942,7 +971,7 @@ def test_append_frame_column_oriented(self):
def test_append_with_different_block_ordering(self):
#GH 4096; using same frames, but different block orderings
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
for i in range(10):
@@ -964,7 +993,7 @@ def test_append_with_different_block_ordering(self):
store.append('df',df)
# test a different ordering but with more fields (like invalid combinate)
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
df = DataFrame(np.random.randn(10,2),columns=list('AB'), dtype='float64')
df['int64'] = Series([1]*len(df),dtype='int64')
@@ -982,7 +1011,7 @@ def test_append_with_different_block_ordering(self):
def test_ndim_indexables(self):
""" test using ndim tables in new ways"""
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
p4d = tm.makePanel4D()
@@ -1049,7 +1078,7 @@ def check_indexers(key, indexers):
def test_append_with_strings(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
wp = tm.makePanel()
wp2 = wp.rename_axis(
dict([(x, "%s_extra" % x) for x in wp.minor_axis]), axis=2)
@@ -1118,7 +1147,7 @@ def check_col(key,name,size):
result = store.select('df')
tm.assert_frame_equal(result, df)
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
def check_col(key,name,size):
self.assert_(getattr(store.get_storer(key).table.description,name).itemsize == size)
@@ -1157,7 +1186,7 @@ def check_col(key,name,size):
def test_append_with_data_columns(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
df = tm.makeTimeDataFrame()
df.loc[:,'B'].iloc[0] = 1.
_maybe_remove(store, 'df')
@@ -1196,7 +1225,7 @@ def test_append_with_data_columns(self):
def check_col(key,name,size):
self.assert_(getattr(store.get_storer(key).table.description,name).itemsize == size)
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
_maybe_remove(store, 'df')
store.append('df', df_new, data_columns=['string'],
min_itemsize={'string': 30})
@@ -1210,7 +1239,7 @@ def check_col(key,name,size):
min_itemsize={'values': 30})
check_col('df', 'string', 30)
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
df_new['string2'] = 'foobarbah'
df_new['string_block1'] = 'foobarbah1'
df_new['string_block2'] = 'foobarbah2'
@@ -1220,7 +1249,7 @@ def check_col(key,name,size):
check_col('df', 'string2', 40)
check_col('df', 'values_block_1', 50)
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
# multiple data columns
df_new = df.copy()
df_new.loc[:,'A'].iloc[0] = 1.
@@ -1247,7 +1276,7 @@ def check_col(key,name,size):
df_new.string2 == 'cool')]
tm.assert_frame_equal(result, expected)
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
# doc example
df_dc = df.copy()
df_dc['string'] = 'foo'
@@ -1274,7 +1303,7 @@ def check_col(key,name,size):
def test_create_table_index(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
def col(t,column):
return getattr(store.get_storer(t).table.cols,column)
@@ -1365,7 +1394,7 @@ def test_big_table_frame(self):
import time
x = time.time()
- with ensure_clean(self.path,mode='w') as store:
+ with ensure_clean_store(self.path,mode='w') as store:
store.append('df', df)
rows = store.root.df.table.nrows
recons = store.select('df')
@@ -1393,7 +1422,7 @@ def test_big_table2_frame(self):
% (len(df.index), time.time() - start_time))
def f(chunksize):
- with ensure_clean(self.path,mode='w') as store:
+ with ensure_clean_store(self.path,mode='w') as store:
store.append('df', df, chunksize=chunksize)
r = store.root.df.table.nrows
return r
@@ -1421,7 +1450,7 @@ def test_big_put_frame(self):
print("\nbig_put frame (creation of df) [rows->%s] -> %5.2f"
% (len(df.index), time.time() - start_time))
- with ensure_clean(self.path, mode='w') as store:
+ with ensure_clean_store(self.path, mode='w') as store:
start_time = time.time()
store = HDFStore(self.path, mode='w')
store.put('df', df)
@@ -1447,7 +1476,7 @@ def test_big_table_panel(self):
x = time.time()
- with ensure_clean(self.path, mode='w') as store:
+ with ensure_clean_store(self.path, mode='w') as store:
store.append('wp', wp)
rows = store.root.wp.table.nrows
recons = store.select('wp')
@@ -1461,7 +1490,7 @@ def test_append_diff_item_order(self):
wp1 = wp.ix[:, :10, :]
wp2 = wp.ix[['ItemC', 'ItemB', 'ItemA'], 10:, :]
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store.put('panel', wp1, format='table')
self.assertRaises(ValueError, store.put, 'panel', wp2,
append=True)
@@ -1475,7 +1504,7 @@ def test_append_hierarchical(self):
df = DataFrame(np.random.randn(10, 3), index=index,
columns=['A', 'B', 'C'])
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store.append('mi', df)
result = store.select('mi')
tm.assert_frame_equal(result, df)
@@ -1485,7 +1514,7 @@ def test_append_hierarchical(self):
expected = df.reindex(columns=['A','B'])
tm.assert_frame_equal(result,expected)
- with tm.ensure_clean('test.hdf') as path:
+ with ensure_clean_path('test.hdf') as path:
df.to_hdf(path,'df',format='table')
result = read_hdf(path,'df',columns=['A','B'])
expected = df.reindex(columns=['A','B'])
@@ -1498,7 +1527,7 @@ def test_column_multiindex(self):
index = MultiIndex.from_tuples([('A','a'), ('A','b'), ('B','a'), ('B','b')], names=['first','second'])
df = DataFrame(np.arange(12).reshape(3,4), columns=index)
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store.put('df',df)
tm.assert_frame_equal(store['df'],df,check_index_type=True,check_column_type=True)
@@ -1512,7 +1541,7 @@ def test_column_multiindex(self):
# non_index_axes name
df = DataFrame(np.arange(12).reshape(3,4), columns=Index(list('ABCD'),name='foo'))
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store.put('df1',df,format='table')
tm.assert_frame_equal(store['df1'],df,check_index_type=True,check_column_type=True)
@@ -1521,14 +1550,14 @@ def test_pass_spec_to_storer(self):
df = tm.makeDataFrame()
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store.put('df',df)
self.assertRaises(TypeError, store.select, 'df', columns=['A'])
self.assertRaises(TypeError, store.select, 'df',where=[('columns=A')])
def test_append_misc(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
# unsuported data types for non-tables
p4d = tm.makePanel4D()
@@ -1552,7 +1581,7 @@ def test_append_misc(self):
# more chunksize in append tests
def check(obj, comparator):
for c in [10, 200, 1000]:
- with ensure_clean(self.path,mode='w') as store:
+ with ensure_clean_store(self.path,mode='w') as store:
store.append('obj', obj, chunksize=c)
result = store.select('obj')
comparator(result,obj)
@@ -1573,7 +1602,7 @@ def check(obj, comparator):
check(p4d, assert_panel4d_equal)
# empty frame, GH4273
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
# 0 len
df_empty = DataFrame(columns=list('ABC'))
@@ -1610,7 +1639,7 @@ def check(obj, comparator):
def test_append_raise(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
# test append with invalid input to get good error messages
@@ -1652,14 +1681,14 @@ def test_table_index_incompatible_dtypes(self):
df2 = DataFrame({'a': [4, 5, 6]},
index=date_range('1/1/2000', periods=3))
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store.put('frame', df1, format='table')
self.assertRaises(TypeError, store.put, 'frame', df2,
format='table', append=True)
def test_table_values_dtypes_roundtrip(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
df1 = DataFrame({'a': [1, 2, 3]}, dtype='f8')
store.append('df_f8', df1)
assert_series_equal(df1.dtypes,store['df_f8'].dtypes)
@@ -1714,7 +1743,7 @@ def test_table_mixed_dtypes(self):
df.ix[3:6, ['obj1']] = np.nan
df = df.consolidate().convert_objects()
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store.append('df1_mixed', df)
tm.assert_frame_equal(store.select('df1_mixed'), df)
@@ -1728,7 +1757,7 @@ def test_table_mixed_dtypes(self):
wp['int2'] = 2
wp = wp.consolidate()
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store.append('p1_mixed', wp)
assert_panel_equal(store.select('p1_mixed'), wp)
@@ -1742,13 +1771,13 @@ def test_table_mixed_dtypes(self):
wp['int2'] = 2
wp = wp.consolidate()
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store.append('p4d_mixed', wp)
assert_panel4d_equal(store.select('p4d_mixed'), wp)
def test_unimplemented_dtypes_table_columns(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
l = [('date', datetime.date(2001, 1, 2))]
@@ -1770,7 +1799,7 @@ def test_unimplemented_dtypes_table_columns(self):
df['datetime1'] = datetime.date(2001, 1, 2)
df = df.consolidate().convert_objects()
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
# this fails because we have a date in the object block......
self.assertRaises(TypeError, store.append, 'df_unimplemented', df)
@@ -1790,7 +1819,7 @@ def compare(a,b):
raise AssertionError("invalid tz comparsion [%s] [%s]" % (a_e,b_e))
# as columns
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
_maybe_remove(store, 'df_tz')
df = DataFrame(dict(A = [ Timestamp('20130102 2:00:00',tz='US/Eastern') + timedelta(hours=1)*i for i in range(5) ]))
@@ -1825,7 +1854,7 @@ def compare(a,b):
self.assertRaises(ValueError, store.append, 'df_tz', df)
# as index
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
# GH 4098 example
df = DataFrame(dict(A = Series(lrange(3), index=date_range('2000-1-1',periods=3,freq='H', tz='US/Eastern'))))
@@ -1853,7 +1882,7 @@ def test_store_timezone(self):
import os
# original method
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
today = datetime.date(2013,9,10)
df = DataFrame([1,2,3], index = [today, today, today])
@@ -1876,7 +1905,7 @@ def setTZ(tz):
try:
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
setTZ('EST5EDT')
today = datetime.date(2013,9,10)
@@ -1903,7 +1932,7 @@ def test_append_with_timedelta(self):
df['C'] = df['A']-df['B']
df.ix[3:5,'C'] = np.nan
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
# table
_maybe_remove(store, 'df')
@@ -1938,7 +1967,7 @@ def test_append_with_timedelta(self):
def test_remove(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
ts = tm.makeTimeSeries()
df = tm.makeDataFrame()
@@ -1975,7 +2004,7 @@ def test_remove(self):
def test_remove_where(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
# non-existance
crit1 = Term('index>foo')
@@ -2011,7 +2040,7 @@ def test_remove_where(self):
def test_remove_crit(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
wp = tm.makePanel()
@@ -2077,7 +2106,7 @@ def test_remove_crit(self):
def test_invalid_terms(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
df = tm.makeTimeDataFrame()
df['string'] = 'foo'
@@ -2100,7 +2129,7 @@ def test_invalid_terms(self):
self.assertRaises(ValueError, store.select, 'wp', "major_axis<'20000108' & minor_axis['A', 'B']")
# from the docs
- with tm.ensure_clean(self.path) as path:
+ with ensure_clean_path(self.path) as path:
dfq = DataFrame(np.random.randn(10,4),columns=list('ABCD'),index=date_range('20130101',periods=10))
dfq.to_hdf(path,'dfq',format='table',data_columns=True)
@@ -2109,7 +2138,7 @@ def test_invalid_terms(self):
read_hdf(path,'dfq',where="A>0 or C>0")
# catch the invalid reference
- with tm.ensure_clean(self.path) as path:
+ with ensure_clean_path(self.path) as path:
dfq = DataFrame(np.random.randn(10,4),columns=list('ABCD'),index=date_range('20130101',periods=10))
dfq.to_hdf(path,'dfq',format='table')
@@ -2117,7 +2146,7 @@ def test_invalid_terms(self):
def test_terms(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
wp = tm.makePanel()
p4d = tm.makePanel4D()
@@ -2184,7 +2213,7 @@ def test_terms(self):
store.select('p4d', t)
def test_term_compat(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
wp = Panel(np.random.randn(2, 5, 4), items=['Item1', 'Item2'],
major_axis=date_range('1/1/2000', periods=5),
@@ -2203,7 +2232,7 @@ def test_term_compat(self):
def test_same_name_scoping(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
import pandas as pd
df = DataFrame(np.random.randn(20, 2),index=pd.date_range('20130101',periods=20))
@@ -2378,7 +2407,7 @@ def test_frame(self):
self._check_roundtrip(tdf, tm.assert_frame_equal,
compression=True)
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
# not consolidated
df['foo'] = np.random.randn(len(df))
store['df'] = df
@@ -2417,7 +2446,7 @@ def test_timezones(self):
rng = date_range('1/1/2000', '1/30/2000', tz='US/Eastern')
frame = DataFrame(np.random.randn(len(rng), 4), index=rng)
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store['frame'] = frame
recons = store['frame']
self.assert_(recons.index.equals(rng))
@@ -2427,7 +2456,7 @@ def test_fixed_offset_tz(self):
rng = date_range('1/1/2000 00:00:00-07:00', '1/30/2000 00:00:00-07:00')
frame = DataFrame(np.random.randn(len(rng), 4), index=rng)
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store['frame'] = frame
recons = store['frame']
self.assert_(recons.index.equals(rng))
@@ -2447,7 +2476,7 @@ def test_store_hierarchical(self):
self._check_roundtrip(frame['A'], tm.assert_series_equal)
# check that the names are stored
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store['frame'] = frame
recons = store['frame']
assert(recons.index.names == ('foo', 'bar'))
@@ -2456,7 +2485,7 @@ def test_store_index_name(self):
df = tm.makeDataFrame()
df.index.name = 'foo'
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store['frame'] = df
recons = store['frame']
assert(recons.index.name == 'foo')
@@ -2465,7 +2494,7 @@ def test_store_series_name(self):
df = tm.makeDataFrame()
series = df['A']
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store['series'] = series
recons = store['series']
assert(recons.name == 'A')
@@ -2488,7 +2517,7 @@ def _make_one():
self._check_roundtrip(df1, tm.assert_frame_equal)
self._check_roundtrip(df2, tm.assert_frame_equal)
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store['obj'] = df1
tm.assert_frame_equal(store['obj'], df1)
store['obj'] = df2
@@ -2525,7 +2554,7 @@ def test_select_with_dups(self):
df = DataFrame(np.random.randn(10,4),columns=['A','A','B','B'])
df.index = date_range('20130101 9:30',periods=10,freq='T')
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store.append('df',df)
result = store.select('df')
@@ -2546,7 +2575,7 @@ def test_select_with_dups(self):
axis=1)
df.index = date_range('20130101 9:30',periods=10,freq='T')
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store.append('df',df)
result = store.select('df')
@@ -2566,7 +2595,7 @@ def test_select_with_dups(self):
assert_frame_equal(result,expected,by_blocks=True)
# duplicates on both index and columns
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store.append('df',df)
store.append('df',df)
@@ -2577,7 +2606,7 @@ def test_select_with_dups(self):
def test_wide_table_dups(self):
wp = tm.makePanel()
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store.put('panel', wp, format='table')
store.put('panel', wp, format='table', append=True)
@@ -2601,7 +2630,7 @@ def test_longpanel(self):
def test_overwrite_node(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store['a'] = tm.makeTimeDataFrame()
ts = tm.makeTimeSeries()
store['a'] = ts
@@ -2641,7 +2670,7 @@ def test_sparse_with_compression(self):
def test_select(self):
wp = tm.makePanel()
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
# put/select ok
_maybe_remove(store, 'wp')
@@ -2705,7 +2734,7 @@ def test_select(self):
def test_select_dtypes(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
# with a Timestamp data column (GH #2637)
df = DataFrame(dict(ts=bdate_range('2012-01-01', periods=300), A=np.random.randn(300)))
@@ -2753,7 +2782,7 @@ def test_select_dtypes(self):
expected = df.reindex(index=list(df.index)[0:10],columns=['A'])
tm.assert_frame_equal(expected, result)
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
# floats w/o NaN
df = DataFrame(dict(cols = range(11), values = range(11)),dtype='float64')
@@ -2795,7 +2824,7 @@ def test_select_dtypes(self):
def test_select_with_many_inputs(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
df = DataFrame(dict(ts=bdate_range('2012-01-01', periods=300),
A=np.random.randn(300),
@@ -2836,7 +2865,7 @@ def test_select_with_many_inputs(self):
def test_select_iterator(self):
# single table
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
df = tm.makeTimeDataFrame(500)
_maybe_remove(store, 'df')
@@ -2862,14 +2891,14 @@ def test_select_iterator(self):
result = concat(results)
tm.assert_frame_equal(result, expected)
- with tm.ensure_clean(self.path) as path:
+ with ensure_clean_path(self.path) as path:
df = tm.makeTimeDataFrame(500)
df.to_hdf(path,'df_non_table')
self.assertRaises(TypeError, read_hdf, path,'df_non_table',chunksize=100)
self.assertRaises(TypeError, read_hdf, path,'df_non_table',iterator=True)
- with tm.ensure_clean(self.path) as path:
+ with ensure_clean_path(self.path) as path:
df = tm.makeTimeDataFrame(500)
df.to_hdf(path,'df',format='table')
@@ -2885,7 +2914,7 @@ def test_select_iterator(self):
# multiple
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
df1 = tm.makeTimeDataFrame(500)
store.append('df1',df1,data_columns=True)
@@ -2921,7 +2950,7 @@ def test_retain_index_attributes(self):
df = DataFrame(dict(A = Series(lrange(3),
index=date_range('2000-1-1',periods=3,freq='H'))))
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
_maybe_remove(store,'data')
store.put('data', df, format='table')
@@ -2951,7 +2980,7 @@ def test_retain_index_attributes(self):
def test_retain_index_attributes2(self):
- with tm.ensure_clean(self.path) as path:
+ with ensure_clean_path(self.path) as path:
with tm.assert_produces_warning(expected_warning=AttributeConflictWarning):
@@ -2980,7 +3009,7 @@ def test_panel_select(self):
wp = tm.makePanel()
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store.put('wp', wp, format='table')
date = wp.major_axis[len(wp.major_axis) // 2]
@@ -3000,7 +3029,7 @@ def test_frame_select(self):
df = tm.makeTimeDataFrame()
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store.put('frame', df,format='table')
date = df.index[len(df) // 2]
@@ -3034,7 +3063,7 @@ def test_frame_select_complex(self):
df['string'] = 'foo'
df.loc[df.index[0:4],'string'] = 'bar'
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store.put('df', df, table=True, data_columns=['string'])
# empty
@@ -3079,7 +3108,7 @@ def test_invalid_filtering(self):
df = tm.makeTimeDataFrame()
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store.put('df', df, table=True)
# not implemented
@@ -3091,7 +3120,7 @@ def test_invalid_filtering(self):
def test_string_select(self):
# GH 2973
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
df = tm.makeTimeDataFrame()
@@ -3140,7 +3169,7 @@ def test_read_column(self):
df = tm.makeTimeDataFrame()
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
_maybe_remove(store, 'df')
store.append('df', df)
@@ -3178,7 +3207,7 @@ def f():
def test_coordinates(self):
df = tm.makeTimeDataFrame()
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
_maybe_remove(store, 'df')
store.append('df', df)
@@ -3223,7 +3252,7 @@ def test_coordinates(self):
tm.assert_frame_equal(result, expected)
# pass array/mask as the coordinates
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
df = DataFrame(np.random.randn(1000,2),index=date_range('20000101',periods=1000))
store.append('df',df)
@@ -3265,7 +3294,7 @@ def test_append_to_multiple(self):
df2['foo'] = 'bar'
df = concat([df1, df2], axis=1)
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
# exceptions
self.assertRaises(ValueError, store.append_to_multiple,
@@ -3289,7 +3318,7 @@ def test_append_to_multiple_dropna(self):
df1.ix[1, ['A', 'B']] = np.nan
df = concat([df1, df2], axis=1)
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
# dropna=True should guarantee rows are synchronized
store.append_to_multiple(
{'df1': ['A', 'B'], 'df2': None}, df, selector='df1',
@@ -3315,7 +3344,7 @@ def test_select_as_multiple(self):
df2 = tm.makeTimeDataFrame().rename(columns=lambda x: "%s_2" % x)
df2['foo'] = 'bar'
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
# no tables stored
self.assertRaises(Exception, store.select_as_multiple,
@@ -3366,7 +3395,7 @@ def test_select_as_multiple(self):
def test_start_stop(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
df = DataFrame(dict(A=np.random.rand(20), B=np.random.rand(20)))
store.append('df', df)
@@ -3388,7 +3417,7 @@ def test_select_filter_corner(self):
df.index = ['%.3d' % c for c in df.index]
df.columns = ['%.3d' % c for c in df.columns]
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
store.put('frame', df, format='table')
crit = Term('columns=df.columns[:75]')
@@ -3401,7 +3430,7 @@ def _check_roundtrip(self, obj, comparator, compression=False, **kwargs):
if compression:
options['complib'] = _default_compressor
- with ensure_clean(self.path, 'w', **options) as store:
+ with ensure_clean_store(self.path, 'w', **options) as store:
store['obj'] = obj
retrieved = store['obj']
comparator(retrieved, obj, **kwargs)
@@ -3412,7 +3441,7 @@ def _check_double_roundtrip(self, obj, comparator, compression=False,
if compression:
options['complib'] = compression or _default_compressor
- with ensure_clean(self.path, 'w', **options) as store:
+ with ensure_clean_store(self.path, 'w', **options) as store:
store['obj'] = obj
retrieved = store['obj']
comparator(retrieved, obj, **kwargs)
@@ -3425,7 +3454,7 @@ def _check_roundtrip_table(self, obj, comparator, compression=False):
if compression:
options['complib'] = _default_compressor
- with ensure_clean(self.path, 'w', **options) as store:
+ with ensure_clean_store(self.path, 'w', **options) as store:
store.put('obj', obj, format='table')
retrieved = store['obj']
# sorted_obj = _test_sort(obj)
@@ -3434,7 +3463,7 @@ def _check_roundtrip_table(self, obj, comparator, compression=False):
def test_multiple_open_close(self):
# GH 4409, open & close multiple times
- with tm.ensure_clean(self.path) as path:
+ with ensure_clean_path(self.path) as path:
df = tm.makeDataFrame()
df.to_hdf(path,'df',mode='w',format='table')
@@ -3496,7 +3525,7 @@ def test_multiple_open_close(self):
self.assert_(not store2.is_open)
# ops on a closed store
- with tm.ensure_clean(self.path) as path:
+ with ensure_clean_path(self.path) as path:
df = tm.makeDataFrame()
df.to_hdf(path,'df',mode='w',format='table')
@@ -3681,7 +3710,7 @@ def test_legacy_table_write(self):
def test_store_datetime_fractional_secs(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
dt = datetime.datetime(2012, 1, 2, 3, 4, 5, 123456)
series = Series([0], [dt])
store['a'] = series
@@ -3689,7 +3718,7 @@ def test_store_datetime_fractional_secs(self):
def test_tseries_indices_series(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
idx = tm.makeDateIndex(10)
ser = Series(np.random.randn(len(idx)), idx)
store['a'] = ser
@@ -3710,7 +3739,7 @@ def test_tseries_indices_series(self):
def test_tseries_indices_frame(self):
- with ensure_clean(self.path) as store:
+ with ensure_clean_store(self.path) as store:
idx = tm.makeDateIndex(10)
df = DataFrame(np.random.randn(len(idx), 3), index=idx)
store['a'] = df
@@ -3761,7 +3790,7 @@ def test_append_with_diff_col_name_types_raises_value_error(self):
df4 = DataFrame({('1', 2): np.random.randn(10)})
df5 = DataFrame({('1', 2, object): np.random.randn(10)})
- with ensure_clean('__%s__.h5' % tm.rands(20)) as store:
+ with ensure_clean_store(self.path) as store:
name = 'df_%s' % tm.rands(10)
store.append(name, df)
diff --git a/pandas/tests/test_frame.py b/pandas/tests/test_frame.py
index b73c7cdbb8f87..22f5fc527d8f5 100644
--- a/pandas/tests/test_frame.py
+++ b/pandas/tests/test_frame.py
@@ -5477,12 +5477,13 @@ def make_dtnat_arr(n,nnat=None):
# N=35000
s1=make_dtnat_arr(chunksize+5)
s2=make_dtnat_arr(chunksize+5,0)
+ path = '1.csv'
- # s3=make_dtnat_arr(chunksize+5,0)
- with ensure_clean('1.csv') as path:
+ # s3=make_dtnjat_arr(chunksize+5,0)
+ with ensure_clean('.csv') as pth:
df=DataFrame(dict(a=s1,b=s2))
- df.to_csv(path,chunksize=chunksize)
- recons = DataFrame.from_csv(path).convert_objects('coerce')
+ df.to_csv(pth,chunksize=chunksize)
+ recons = DataFrame.from_csv(pth).convert_objects('coerce')
assert_frame_equal(df, recons,check_names=False,check_less_precise=True)
for ncols in [4]:
@@ -5491,7 +5492,6 @@ def make_dtnat_arr(n,nnat=None):
base-1,base,base+1]:
_do_test(mkdf(nrows, ncols,r_idx_type='dt',
c_idx_type='s'),path, 'dt','s')
- pass
for ncols in [4]:
diff --git a/pandas/util/testing.py b/pandas/util/testing.py
index 2e4d1f3e8df74..895c651c0bfe7 100644
--- a/pandas/util/testing.py
+++ b/pandas/util/testing.py
@@ -313,34 +313,35 @@ def ensure_clean(filename=None, return_filelike=False):
----------
filename : str (optional)
if None, creates a temporary file which is then removed when out of
- scope.
- return_filelike: bool (default False)
+ scope. if passed, creates temporary file with filename as ending.
+ return_filelike : bool (default False)
if True, returns a file-like which is *always* cleaned. Necessary for
- savefig and other functions which want to append extensions. Ignores
- filename if True.
+ savefig and other functions which want to append extensions.
"""
+ filename = filename or ''
if return_filelike:
- f = tempfile.TemporaryFile()
+ f = tempfile.TemporaryFile(suffix=filename)
try:
yield f
finally:
f.close()
else:
- # if we are not passed a filename, generate a temporary
- if filename is None:
- filename = tempfile.mkstemp()[1]
+
+ # don't generate tempfile if using a path with directory specified
+ if len(os.path.dirname(filename)):
+ raise ValueError("Can't pass a qualified name to ensure_clean()")
try:
+ filename = tempfile.mkstemp(suffix=filename)[1]
yield filename
finally:
try:
if os.path.exists(filename):
os.remove(filename)
except Exception as e:
- print(e)
-
+ print("Exception on removing file: %s" % e)
def get_data_path(f=''):
"""Return the path of a data file, these are relative to the current test
| related #5419
Includes @jreback's commits from #5422 and hdf_temp:
- TST: make pytables tests go thru a temporary dir and file
- TST/BUG: incorrect way of testing for r+ modes
TST: fix temporary files by using mktemp (rather than mkstemp) which opens them
| https://api.github.com/repos/pandas-dev/pandas/pulls/5425 | 2013-11-03T23:42:01Z | 2013-11-04T01:10:47Z | 2013-11-04T01:10:47Z | 2014-07-16T08:38:56Z |
ENH: Better handling of MultiIndex with Excel | diff --git a/ci/requirements-2.7.txt b/ci/requirements-2.7.txt
index 705aa9e3cc922..dc6e2d9f55977 100644
--- a/ci/requirements-2.7.txt
+++ b/ci/requirements-2.7.txt
@@ -8,7 +8,7 @@ numexpr==2.1
tables==2.3.1
matplotlib==1.1.1
openpyxl==1.6.2
-xlsxwriter==0.4.3
+xlsxwriter==0.4.6
xlrd==0.9.2
patsy==0.1.0
html5lib==1.0b2
diff --git a/ci/requirements-2.7_LOCALE.txt b/ci/requirements-2.7_LOCALE.txt
index b18bff6797840..06574cdd6b299 100644
--- a/ci/requirements-2.7_LOCALE.txt
+++ b/ci/requirements-2.7_LOCALE.txt
@@ -2,7 +2,7 @@ python-dateutil
pytz==2013b
xlwt==0.7.5
openpyxl==1.6.2
-xlsxwriter==0.4.3
+xlsxwriter==0.4.6
xlrd==0.9.2
numpy==1.6.1
cython==0.19.1
diff --git a/ci/requirements-3.2.txt b/ci/requirements-3.2.txt
index 0f3bdcbac38cb..136b5cf12cbc0 100644
--- a/ci/requirements-3.2.txt
+++ b/ci/requirements-3.2.txt
@@ -1,7 +1,7 @@
python-dateutil==2.1
pytz==2013b
openpyxl==1.6.2
-xlsxwriter==0.4.3
+xlsxwriter==0.4.6
xlrd==0.9.2
numpy==1.7.1
cython==0.19.1
diff --git a/ci/requirements-3.3.txt b/ci/requirements-3.3.txt
index 3ca888d1623e3..480fde477d88b 100644
--- a/ci/requirements-3.3.txt
+++ b/ci/requirements-3.3.txt
@@ -1,7 +1,7 @@
python-dateutil==2.2
pytz==2013b
openpyxl==1.6.2
-xlsxwriter==0.4.3
+xlsxwriter==0.4.6
xlrd==0.9.2
html5lib==1.0b2
numpy==1.8.0
diff --git a/doc/source/release.rst b/doc/source/release.rst
index 4b33c20424b33..77d78b2892b90 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -209,6 +209,11 @@ Improvements to existing features
by color as expected.
- ``read_excel()`` now tries to convert integral floats (like ``1.0``) to int
by default. (:issue:`5394`)
+ - Excel writers now have a default option ``merge_cells`` in ``to_excel()``
+ to merge cells in MultiIndex and Hierarchical Rows. Note: using this
+ option it is no longer possible to round trip Excel files with merged
+ MultiIndex and Hierarchical Rows. Set the ``merge_cells`` to ``False`` to
+ restore the previous behaviour. (:issue:`5254`)
API Changes
~~~~~~~~~~~
diff --git a/pandas/core/format.py b/pandas/core/format.py
index 75069297360d6..5062fd9be6357 100644
--- a/pandas/core/format.py
+++ b/pandas/core/format.py
@@ -1213,7 +1213,7 @@ def __init__(self, row, col, val,
"right": "thin",
"bottom": "thin",
"left": "thin"},
- "alignment": {"horizontal": "center"}}
+ "alignment": {"horizontal": "center", "vertical": "top"}}
class ExcelFormatter(object):
@@ -1237,10 +1237,12 @@ class ExcelFormatter(object):
Column label for index column(s) if desired. If None is given, and
`header` and `index` are True, then the index names are used. A
sequence should be given if the DataFrame uses MultiIndex.
+ merge_cells : boolean, default False
+ Format MultiIndex and Hierarchical Rows as merged cells.
"""
def __init__(self, df, na_rep='', float_format=None, cols=None,
- header=True, index=True, index_label=None):
+ header=True, index=True, index_label=None, merge_cells=False):
self.df = df
self.rowcounter = 0
self.na_rep = na_rep
@@ -1251,6 +1253,7 @@ def __init__(self, df, na_rep='', float_format=None, cols=None,
self.index = index
self.index_label = index_label
self.header = header
+ self.merge_cells = merge_cells
def _format_value(self, val):
if lib.checknull(val):
@@ -1264,29 +1267,44 @@ def _format_header_mi(self):
if not(has_aliases or self.header):
return
- levels = self.columns.format(sparsify=True, adjoin=False,
- names=False)
- # level_lenghts = _get_level_lengths(levels)
- coloffset = 1
- if isinstance(self.df.index, MultiIndex):
- coloffset = len(self.df.index[0])
-
- # for lnum, (records, values) in enumerate(zip(level_lenghts,
- # levels)):
- # name = self.columns.names[lnum]
- # yield ExcelCell(lnum, coloffset, name, header_style)
- # for i in records:
- # if records[i] > 1:
- # yield ExcelCell(lnum,coloffset + i + 1, values[i],
- # header_style, lnum, coloffset + i + records[i])
- # else:
- # yield ExcelCell(lnum, coloffset + i + 1, values[i], header_style)
-
- # self.rowcounter = lnum
+ columns = self.columns
+ level_strs = columns.format(sparsify=True, adjoin=False, names=False)
+ level_lengths = _get_level_lengths(level_strs)
+ coloffset = 0
lnum = 0
- for i, values in enumerate(zip(*levels)):
- v = ".".join(map(com.pprint_thing, values))
- yield ExcelCell(lnum, coloffset + i, v, header_style)
+
+ if isinstance(self.df.index, MultiIndex):
+ coloffset = len(self.df.index[0]) - 1
+
+ if self.merge_cells:
+ # Format multi-index as a merged cells.
+ for lnum in range(len(level_lengths)):
+ name = columns.names[lnum]
+ yield ExcelCell(lnum, coloffset, name, header_style)
+
+ for lnum, (spans, levels, labels) in enumerate(zip(level_lengths,
+ columns.levels,
+ columns.labels)
+ ):
+ values = levels.take(labels)
+ for i in spans:
+ if spans[i] > 1:
+ yield ExcelCell(lnum,
+ coloffset + i + 1,
+ values[i],
+ header_style,
+ lnum,
+ coloffset + i + spans[i])
+ else:
+ yield ExcelCell(lnum,
+ coloffset + i + 1,
+ values[i],
+ header_style)
+ else:
+ # Format in legacy format with dots to indicate levels.
+ for i, values in enumerate(zip(*level_strs)):
+ v = ".".join(map(com.pprint_thing, values))
+ yield ExcelCell(lnum, coloffset + i + 1, v, header_style)
self.rowcounter = lnum
@@ -1354,14 +1372,17 @@ def _format_regular_rows(self):
index_label = self.df.index.names[0]
if index_label and self.header is not False:
- # add to same level as column names
- # if isinstance(self.df.columns, MultiIndex):
- # yield ExcelCell(self.rowcounter, 0,
- # index_label, header_style)
- # self.rowcounter += 1
- # else:
- yield ExcelCell(self.rowcounter - 1, 0,
- index_label, header_style)
+ if self.merge_cells:
+ yield ExcelCell(self.rowcounter,
+ 0,
+ index_label,
+ header_style)
+ self.rowcounter += 1
+ else:
+ yield ExcelCell(self.rowcounter - 1,
+ 0,
+ index_label,
+ header_style)
# write index_values
index_values = self.df.index
@@ -1383,7 +1404,7 @@ def _format_hierarchical_rows(self):
self.rowcounter += 1
gcolidx = 0
- # output index and index_label?
+
if self.index:
index_labels = self.df.index.names
# check for aliases
@@ -1394,20 +1415,51 @@ def _format_hierarchical_rows(self):
# if index labels are not empty go ahead and dump
if (any(x is not None for x in index_labels)
and self.header is not False):
- # if isinstance(self.df.columns, MultiIndex):
- # self.rowcounter += 1
- # else:
- self.rowcounter -= 1
+
+ if not self.merge_cells:
+ self.rowcounter -= 1
+
for cidx, name in enumerate(index_labels):
- yield ExcelCell(self.rowcounter, cidx,
- name, header_style)
+ yield ExcelCell(self.rowcounter,
+ cidx,
+ name,
+ header_style)
self.rowcounter += 1
- for indexcolvals in zip(*self.df.index):
- for idx, indexcolval in enumerate(indexcolvals):
- yield ExcelCell(self.rowcounter + idx, gcolidx,
- indexcolval, header_style)
- gcolidx += 1
+ if self.merge_cells:
+ # Format hierarchical rows as merged cells.
+ level_strs = self.df.index.format(sparsify=True, adjoin=False,
+ names=False)
+ level_lengths = _get_level_lengths(level_strs)
+
+ for spans, levels, labels in zip(level_lengths,
+ self.df.index.levels,
+ self.df.index.labels):
+ values = levels.take(labels)
+ for i in spans:
+ if spans[i] > 1:
+ yield ExcelCell(self.rowcounter + i,
+ gcolidx,
+ values[i],
+ header_style,
+ self.rowcounter + i + spans[i] - 1,
+ gcolidx)
+ else:
+ yield ExcelCell(self.rowcounter + i,
+ gcolidx,
+ values[i],
+ header_style)
+ gcolidx += 1
+
+ else:
+ # Format hierarchical rows with non-merged values.
+ for indexcolvals in zip(*self.df.index):
+ for idx, indexcolval in enumerate(indexcolvals):
+ yield ExcelCell(self.rowcounter + idx,
+ gcolidx,
+ indexcolval,
+ header_style)
+ gcolidx += 1
for colidx in range(len(self.columns)):
series = self.df.iloc[:, colidx]
@@ -1415,8 +1467,8 @@ def _format_hierarchical_rows(self):
yield ExcelCell(self.rowcounter + i, gcolidx + colidx, val)
def get_formatted_cells(self):
- for cell in itertools.chain(self._format_header(), self._format_body()
- ):
+ for cell in itertools.chain(self._format_header(),
+ self._format_body()):
cell.val = self._format_value(cell.val)
yield cell
diff --git a/pandas/core/frame.py b/pandas/core/frame.py
index 0a5306de9bbb5..18fba179f0654 100644
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -1130,7 +1130,8 @@ def to_csv(self, path_or_buf, sep=",", na_rep='', float_format=None,
def to_excel(self, excel_writer, sheet_name='Sheet1', na_rep='',
float_format=None, cols=None, header=True, index=True,
- index_label=None, startrow=0, startcol=0, engine=None):
+ index_label=None, startrow=0, startcol=0, engine=None,
+ merge_cells=True):
"""
Write DataFrame to a excel sheet
@@ -1161,13 +1162,15 @@ def to_excel(self, excel_writer, sheet_name='Sheet1', na_rep='',
write engine to use - you can also set this via the options
``io.excel.xlsx.writer``, ``io.excel.xls.writer``, and
``io.excel.xlsm.writer``.
-
+ merge_cells : boolean, default True
+ Write MultiIndex and Hierarchical Rows as merged cells.
Notes
-----
If passing an existing ExcelWriter object, then the sheet will be added
to the existing workbook. This can be used to save different
DataFrames to one workbook
+
>>> writer = ExcelWriter('output.xlsx')
>>> df1.to_excel(writer,'Sheet1')
>>> df2.to_excel(writer,'Sheet2')
@@ -1185,7 +1188,8 @@ def to_excel(self, excel_writer, sheet_name='Sheet1', na_rep='',
header=header,
float_format=float_format,
index=index,
- index_label=index_label)
+ index_label=index_label,
+ merge_cells=merge_cells)
formatted_cells = formatter.get_formatted_cells()
excel_writer.write_cells(formatted_cells, sheet_name,
startrow=startrow, startcol=startcol)
diff --git a/pandas/io/excel.py b/pandas/io/excel.py
index 42c212caf41ca..b97c9da0b0d18 100644
--- a/pandas/io/excel.py
+++ b/pandas/io/excel.py
@@ -146,7 +146,7 @@ def __init__(self, io, **kwds):
def parse(self, sheetname, header=0, skiprows=None, skip_footer=0,
index_col=None, parse_cols=None, parse_dates=False,
date_parser=None, na_values=None, thousands=None, chunksize=None,
- convert_float=True, **kwds):
+ convert_float=True, has_index_names=False, **kwds):
"""Read an Excel table into DataFrame
Parameters
@@ -169,25 +169,29 @@ def parse(self, sheetname, header=0, skiprows=None, skip_footer=0,
parsed
* If string then indicates comma separated list of column names and
column ranges (e.g. "A:E" or "A,C,E:F")
+ parse_dates : boolean, default False
+ Parse date Excel values,
+ date_parser : function default None
+ Date parsing function
na_values : list-like, default None
List of additional strings to recognize as NA/NaN
- keep_default_na : bool, default True
- If na_values are specified and keep_default_na is False the default
- NaN values are overridden, otherwise they're appended to
- verbose : boolean, default False
- Indicate number of NA values placed in non-numeric columns
+ thousands : str, default None
+ Thousands separator
+ chunksize : int, default None
+ Size of file chunk to read for lazy evaluation.
convert_float : boolean, default True
convert integral floats to int (i.e., 1.0 --> 1). If False, all
numeric data will be read in as floats: Excel stores all numbers as
floats internally.
+ has_index_names : boolean, default False
+ True if the cols defined in index_col have an index name and are
+ not in the header
Returns
-------
parsed : DataFrame
DataFrame parsed from the Excel file
"""
- has_index_names = False # removed as new argument of API function
-
skipfooter = kwds.pop('skipfooter', None)
if skipfooter is not None:
skip_footer = skipfooter
@@ -506,6 +510,7 @@ def write_cells(self, cells, sheet_name=None, startrow=0, startcol=0):
colletter = get_column_letter(startcol + cell.col + 1)
xcell = wks.cell("%s%s" % (colletter, startrow + cell.row + 1))
xcell.value = _conv_value(cell.val)
+ style = None
if cell.style:
style = self._convert_to_style(cell.style)
for field in style.__fields__:
@@ -517,8 +522,6 @@ def write_cells(self, cells, sheet_name=None, startrow=0, startcol=0):
elif isinstance(cell.val, datetime.date):
xcell.style.number_format.format_code = "YYYY-MM-DD"
- # merging requires openpyxl latest (works on 1.6.1)
- # todo add version check
if cell.mergestart is not None and cell.mergeend is not None:
cletterstart = get_column_letter(startcol + cell.col + 1)
cletterend = get_column_letter(startcol + cell.mergeend + 1)
@@ -528,6 +531,25 @@ def write_cells(self, cells, sheet_name=None, startrow=0, startcol=0):
cletterend,
startrow + cell.mergestart + 1))
+ # Excel requires that the format of the first cell in a merged
+ # range is repeated in the rest of the merged range.
+ if style:
+ first_row = startrow + cell.row + 1
+ last_row = startrow + cell.mergestart + 1
+ first_col = startcol + cell.col + 1
+ last_col = startcol + cell.mergeend + 1
+
+ for row in range(first_row, last_row + 1):
+ for col in range(first_col, last_col + 1):
+ if row == first_row and col == first_col:
+ # Ignore first cell. It is already handled.
+ continue
+ colletter = get_column_letter(col)
+ xcell = wks.cell("%s%s" % (colletter, row))
+ for field in style.__fields__:
+ xcell.style.__setattr__(field, \
+ style.__getattribute__(field))
+
@classmethod
def _convert_to_style(cls, style_dict):
"""
@@ -723,8 +745,8 @@ def write_cells(self, cells, sheet_name=None, startrow=0, startcol=0):
if cell.mergestart is not None and cell.mergeend is not None:
wks.merge_range(startrow + cell.row,
- startrow + cell.mergestart,
startcol + cell.col,
+ startrow + cell.mergestart,
startcol + cell.mergeend,
cell.val, style)
else:
@@ -752,6 +774,16 @@ def _convert_to_style(self, style_dict, num_format_str=None):
if font.get('bold'):
xl_format.set_bold()
+ # Map the alignment to XlsxWriter alignment properties.
+ alignment = style_dict.get('alignment')
+ if alignment:
+ if (alignment.get('horizontal')
+ and alignment['horizontal'] == 'center'):
+ xl_format.set_align('center')
+ if (alignment.get('vertical')
+ and alignment['vertical'] == 'top'):
+ xl_format.set_align('top')
+
# Map the cell borders to XlsxWriter border properties.
if style_dict.get('borders'):
xl_format.set_border()
diff --git a/pandas/io/tests/test_excel.py b/pandas/io/tests/test_excel.py
index 6eb3cbf1a3903..8bcf5e461ce7c 100644
--- a/pandas/io/tests/test_excel.py
+++ b/pandas/io/tests/test_excel.py
@@ -102,7 +102,8 @@ def test_parse_cols_int(self):
df2 = df2.reindex(columns=['A', 'B', 'C'])
df3 = xls.parse('Sheet2', skiprows=[1], index_col=0,
parse_dates=True, parse_cols=3)
- tm.assert_frame_equal(df, df2, check_names=False) # TODO add index to xls file)
+ # TODO add index to xls file)
+ tm.assert_frame_equal(df, df2, check_names=False)
tm.assert_frame_equal(df3, df2, check_names=False)
def test_parse_cols_list(self):
@@ -121,7 +122,8 @@ def test_parse_cols_list(self):
df3 = xls.parse('Sheet2', skiprows=[1], index_col=0,
parse_dates=True,
parse_cols=[0, 2, 3])
- tm.assert_frame_equal(df, df2, check_names=False) # TODO add index to xls file
+ # TODO add index to xls file)
+ tm.assert_frame_equal(df, df2, check_names=False)
tm.assert_frame_equal(df3, df2, check_names=False)
def test_parse_cols_str(self):
@@ -141,7 +143,8 @@ def test_parse_cols_str(self):
df2 = df2.reindex(columns=['A', 'B', 'C'])
df3 = xls.parse('Sheet2', skiprows=[1], index_col=0,
parse_dates=True, parse_cols='A:D')
- tm.assert_frame_equal(df, df2, check_names=False) # TODO add index to xls, read xls ignores index name ?
+ # TODO add index to xls, read xls ignores index name ?
+ tm.assert_frame_equal(df, df2, check_names=False)
tm.assert_frame_equal(df3, df2, check_names=False)
del df, df2, df3
@@ -152,7 +155,8 @@ def test_parse_cols_str(self):
df3 = xls.parse('Sheet2', skiprows=[1], index_col=0,
parse_dates=True,
parse_cols='A,C,D')
- tm.assert_frame_equal(df, df2, check_names=False) # TODO add index to xls file
+ # TODO add index to xls file
+ tm.assert_frame_equal(df, df2, check_names=False)
tm.assert_frame_equal(df3, df2, check_names=False)
del df, df2, df3
@@ -284,7 +288,8 @@ def test_xlsx_table(self):
df2 = self.read_csv(self.csv1, index_col=0, parse_dates=True)
df3 = xlsx.parse('Sheet2', skiprows=[1], index_col=0, parse_dates=True)
- tm.assert_frame_equal(df, df2, check_names=False) # TODO add index to xlsx file
+ # TODO add index to xlsx file
+ tm.assert_frame_equal(df, df2, check_names=False)
tm.assert_frame_equal(df3, df2, check_names=False)
df4 = xlsx.parse('Sheet1', index_col=0, parse_dates=True,
@@ -365,6 +370,10 @@ class ExcelWriterBase(SharedItems):
# 2. Add a property ext, which is the file extension that your writer
# writes to. (needs to start with '.' so it's a valid path)
# 3. Add a property engine_name, which is the name of the writer class.
+
+ # Test with MultiIndex and Hierarchical Rows as merged cells.
+ merge_cells = True
+
def setUp(self):
self.check_skip()
super(ExcelWriterBase, self).setUp()
@@ -433,7 +442,8 @@ def test_roundtrip(self):
tm.assert_frame_equal(self.frame, recons)
self.frame.to_excel(path, 'test1', na_rep='88')
- recons = read_excel(path, 'test1', index_col=0, na_values=[88, 88.0])
+ recons = read_excel(path, 'test1', index_col=0,
+ na_values=[88, 88.0])
tm.assert_frame_equal(self.frame, recons)
def test_mixed(self):
@@ -571,39 +581,56 @@ def test_roundtrip_indexlabels(self):
# test index_label
frame = (DataFrame(np.random.randn(10, 2)) >= 0)
- frame.to_excel(path, 'test1', index_label=['test'])
+ frame.to_excel(path, 'test1',
+ index_label=['test'],
+ merge_cells=self.merge_cells)
reader = ExcelFile(path)
- recons = reader.parse('test1', index_col=0).astype(np.int64)
+ recons = reader.parse('test1',
+ index_col=0,
+ has_index_names=self.merge_cells
+ ).astype(np.int64)
frame.index.names = ['test']
self.assertEqual(frame.index.names, recons.index.names)
frame = (DataFrame(np.random.randn(10, 2)) >= 0)
- frame.to_excel(
- path, 'test1', index_label=['test', 'dummy', 'dummy2'])
+ frame.to_excel(path,
+ 'test1',
+ index_label=['test', 'dummy', 'dummy2'],
+ merge_cells=self.merge_cells)
reader = ExcelFile(path)
- recons = reader.parse('test1', index_col=0).astype(np.int64)
+ recons = reader.parse('test1',
+ index_col=0,
+ has_index_names=self.merge_cells
+ ).astype(np.int64)
frame.index.names = ['test']
self.assertEqual(frame.index.names, recons.index.names)
frame = (DataFrame(np.random.randn(10, 2)) >= 0)
- frame.to_excel(path, 'test1', index_label='test')
+ frame.to_excel(path,
+ 'test1',
+ index_label='test',
+ merge_cells=self.merge_cells)
reader = ExcelFile(path)
- recons = reader.parse('test1', index_col=0).astype(np.int64)
+ recons = reader.parse('test1',
+ index_col=0,
+ has_index_names=self.merge_cells
+ ).astype(np.int64)
frame.index.names = ['test']
- self.assertEqual(frame.index.names, recons.index.names)
+ self.assertAlmostEqual(frame.index.names, recons.index.names)
with ensure_clean(self.ext) as path:
- self.frame.to_excel(path, 'test1',
- cols=['A', 'B', 'C', 'D'], index=False)
- # take 'A' and 'B' as indexes (they are in same row as cols 'C',
- # 'D')
+ self.frame.to_excel(path,
+ 'test1',
+ cols=['A', 'B', 'C', 'D'],
+ index=False, merge_cells=self.merge_cells)
+ # take 'A' and 'B' as indexes (same row as cols 'C', 'D')
df = self.frame.copy()
df = df.set_index(['A', 'B'])
reader = ExcelFile(path)
recons = reader.parse('test1', index_col=[0, 1])
- tm.assert_frame_equal(df, recons)
+ tm.assert_frame_equal(df, recons, check_less_precise=True)
def test_excel_roundtrip_indexname(self):
_skip_if_no_xlrd()
@@ -612,10 +639,12 @@ def test_excel_roundtrip_indexname(self):
df.index.name = 'foo'
with ensure_clean(self.ext) as path:
- df.to_excel(path)
+ df.to_excel(path, merge_cells=self.merge_cells)
xf = ExcelFile(path)
- result = xf.parse(xf.sheet_names[0], index_col=0)
+ result = xf.parse(xf.sheet_names[0],
+ index_col=0,
+ has_index_names=self.merge_cells)
tm.assert_frame_equal(result, df)
self.assertEqual(result.index.name, 'foo')
@@ -624,19 +653,18 @@ def test_excel_roundtrip_datetime(self):
_skip_if_no_xlrd()
# datetime.date, not sure what to test here exactly
- path = '__tmp_excel_roundtrip_datetime__.' + self.ext
tsf = self.tsframe.copy()
with ensure_clean(self.ext) as path:
tsf.index = [x.date() for x in self.tsframe.index]
- tsf.to_excel(path, 'test1')
+ tsf.to_excel(path, 'test1', merge_cells=self.merge_cells)
reader = ExcelFile(path)
recons = reader.parse('test1')
tm.assert_frame_equal(self.tsframe, recons)
def test_to_excel_periodindex(self):
_skip_if_no_xlrd()
- path = '__tmp_to_excel_periodindex__.' + self.ext
+
frame = self.tsframe
xp = frame.resample('M', kind='period')
@@ -651,8 +679,7 @@ def test_to_excel_multiindex(self):
_skip_if_no_xlrd()
frame = self.frame
- old_index = frame.index
- arrays = np.arange(len(old_index) * 2).reshape(2, -1)
+ arrays = np.arange(len(frame.index) * 2).reshape(2, -1)
new_index = MultiIndex.from_arrays(arrays,
names=['first', 'second'])
frame.index = new_index
@@ -662,42 +689,36 @@ def test_to_excel_multiindex(self):
frame.to_excel(path, 'test1', cols=['A', 'B'])
# round trip
- frame.to_excel(path, 'test1')
+ frame.to_excel(path, 'test1', merge_cells=self.merge_cells)
reader = ExcelFile(path)
- df = reader.parse('test1', index_col=[0, 1], parse_dates=False)
+ df = reader.parse('test1', index_col=[0, 1],
+ parse_dates=False,
+ has_index_names=self.merge_cells)
tm.assert_frame_equal(frame, df)
self.assertEqual(frame.index.names, df.index.names)
- self.frame.index = old_index # needed if setUP becomes a classmethod
def test_to_excel_multiindex_dates(self):
_skip_if_no_xlrd()
# try multiindex with dates
- tsframe = self.tsframe
- old_index = tsframe.index
- new_index = [old_index, np.arange(len(old_index))]
+ tsframe = self.tsframe.copy()
+ new_index = [tsframe.index, np.arange(len(tsframe.index))]
tsframe.index = MultiIndex.from_arrays(new_index)
with ensure_clean(self.ext) as path:
- tsframe.to_excel(path, 'test1', index_label=['time', 'foo'])
+ tsframe.index.names = ['time', 'foo']
+ tsframe.to_excel(path, 'test1', merge_cells=self.merge_cells)
reader = ExcelFile(path)
- recons = reader.parse('test1', index_col=[0, 1])
-
- tm.assert_frame_equal(tsframe, recons, check_names=False)
- self.assertEquals(recons.index.names, ('time', 'foo'))
+ recons = reader.parse('test1',
+ index_col=[0, 1],
+ has_index_names=self.merge_cells)
- # infer index
- tsframe.to_excel(path, 'test1')
- reader = ExcelFile(path)
- recons = reader.parse('test1')
tm.assert_frame_equal(tsframe, recons)
-
- self.tsframe.index = old_index # needed if setUP becomes classmethod
+ self.assertEquals(recons.index.names, ('time', 'foo'))
def test_to_excel_float_format(self):
_skip_if_no_xlrd()
- ext = self.ext
- filename = '__tmp_to_excel_float_format__.' + ext
+
df = DataFrame([[0.123456, 0.234567, 0.567567],
[12.32112, 123123.2, 321321.2]],
index=['A', 'B'], columns=['X', 'Y', 'Z'])
@@ -835,8 +856,13 @@ def test_to_excel_unicode_filename(self):
# for maddr in mergedcells_addrs:
# self.assertTrue(ws.cell(maddr).merged)
# os.remove(filename)
+
def test_excel_010_hemstring(self):
_skip_if_no_xlrd()
+
+ if self.merge_cells:
+ raise nose.SkipTest('Skip tests for merged MI format.')
+
from pandas.util.testing import makeCustomDataframe as mkdf
# ensure limited functionality in 0.10
# override of #2370 until sorted out in 0.11
@@ -844,7 +870,7 @@ def test_excel_010_hemstring(self):
def roundtrip(df, header=True, parser_hdr=0):
with ensure_clean(self.ext) as path:
- df.to_excel(path, header=header)
+ df.to_excel(path, header=header, merge_cells=self.merge_cells)
xf = pd.ExcelFile(path)
res = xf.parse(xf.sheet_names[0], header=parser_hdr)
return res
@@ -917,7 +943,7 @@ def test_to_excel_styleconverter(self):
"right": "thin",
"bottom": "thin",
"left": "thin"},
- "alignment": {"horizontal": "center"}}
+ "alignment": {"horizontal": "center", "vertical": "top"}}
xlsx_style = _OpenpyxlWriter._convert_to_style(hstyle)
self.assertTrue(xlsx_style.font.bold)
@@ -931,6 +957,8 @@ def test_to_excel_styleconverter(self):
xlsx_style.borders.left.border_style)
self.assertEquals(openpyxl.style.Alignment.HORIZONTAL_CENTER,
xlsx_style.alignment.horizontal)
+ self.assertEquals(openpyxl.style.Alignment.VERTICAL_TOP,
+ xlsx_style.alignment.vertical)
class XlwtTests(ExcelWriterBase, unittest.TestCase):
@@ -948,7 +976,8 @@ def test_to_excel_styleconverter(self):
"right": "thin",
"bottom": "thin",
"left": "thin"},
- "alignment": {"horizontal": "center"}}
+ "alignment": {"horizontal": "center", "vertical": "top"}}
+
xls_style = _XlwtWriter._convert_to_style(hstyle)
self.assertTrue(xls_style.font.bold)
self.assertEquals(xlwt.Borders.THIN, xls_style.borders.top)
@@ -956,6 +985,7 @@ def test_to_excel_styleconverter(self):
self.assertEquals(xlwt.Borders.THIN, xls_style.borders.bottom)
self.assertEquals(xlwt.Borders.THIN, xls_style.borders.left)
self.assertEquals(xlwt.Alignment.HORZ_CENTER, xls_style.alignment.horz)
+ self.assertEquals(xlwt.Alignment.VERT_TOP, xls_style.alignment.vert)
class XlsxWriterTests(ExcelWriterBase, unittest.TestCase):
@@ -963,48 +993,38 @@ class XlsxWriterTests(ExcelWriterBase, unittest.TestCase):
engine_name = 'xlsxwriter'
check_skip = staticmethod(_skip_if_no_xlsxwriter)
- # Override test from the Superclass to use assertAlmostEqual on the
- # floating point values read back in from the output XlsxWriter file.
- def test_roundtrip_indexlabels(self):
- _skip_if_no_xlrd()
- with ensure_clean(self.ext) as path:
+class OpenpyxlTests_NoMerge(ExcelWriterBase, unittest.TestCase):
+ ext = '.xlsx'
+ engine_name = 'openpyxl'
+ check_skip = staticmethod(_skip_if_no_openpyxl)
- self.frame['A'][:5] = nan
+ # Test < 0.13 non-merge behaviour for MultiIndex and Hierarchical Rows.
+ merge_cells = False
- self.frame.to_excel(path, 'test1')
- self.frame.to_excel(path, 'test1', cols=['A', 'B'])
- self.frame.to_excel(path, 'test1', header=False)
- self.frame.to_excel(path, 'test1', index=False)
- # test index_label
- frame = (DataFrame(np.random.randn(10, 2)) >= 0)
- frame.to_excel(path, 'test1', index_label=['test'])
- reader = ExcelFile(path)
- recons = reader.parse('test1', index_col=0).astype(np.int64)
- frame.index.names = ['test']
- self.assertEqual(frame.index.names, recons.index.names)
+class XlwtTests_NoMerge(ExcelWriterBase, unittest.TestCase):
+ ext = '.xls'
+ engine_name = 'xlwt'
+ check_skip = staticmethod(_skip_if_no_xlwt)
- frame = (DataFrame(np.random.randn(10, 2)) >= 0)
- frame.to_excel(
- path, 'test1', index_label=['test', 'dummy', 'dummy2'])
- reader = ExcelFile(path)
- recons = reader.parse('test1', index_col=0).astype(np.int64)
- frame.index.names = ['test']
- self.assertEqual(frame.index.names, recons.index.names)
+ # Test < 0.13 non-merge behaviour for MultiIndex and Hierarchical Rows.
+ merge_cells = False
- frame = (DataFrame(np.random.randn(10, 2)) >= 0)
- frame.to_excel(path, 'test1', index_label='test')
- reader = ExcelFile(path)
- recons = reader.parse('test1', index_col=0).astype(np.int64)
- frame.index.names = ['test']
- self.assertAlmostEqual(frame.index.names, recons.index.names)
+
+class XlsxWriterTests_NoMerge(ExcelWriterBase, unittest.TestCase):
+ ext = '.xlsx'
+ engine_name = 'xlsxwriter'
+ check_skip = staticmethod(_skip_if_no_xlsxwriter)
+
+ # Test < 0.13 non-merge behaviour for MultiIndex and Hierarchical Rows.
+ merge_cells = False
class ExcelWriterEngineTests(unittest.TestCase):
def test_ExcelWriter_dispatch(self):
with tm.assertRaisesRegexp(ValueError, 'No engine'):
- writer = ExcelWriter('nothing')
+ ExcelWriter('nothing')
_skip_if_no_openpyxl()
writer = ExcelWriter('apple.xlsx')
@@ -1046,7 +1066,6 @@ def check_called(func):
func = lambda: df.to_excel('something.test')
check_called(func)
check_called(lambda: panel.to_excel('something.test'))
- from pandas import set_option, get_option
val = get_option('io.excel.xlsx.writer')
set_option('io.excel.xlsx.writer', 'dummy')
check_called(lambda: df.to_excel('something.xlsx'))
| Allow optional formatting of MultiIndex and Hierarchical Rows
as merged cells. closes #5254.
Some notes on this PR:
- The required xlsxwriter version was up-revved in `ci/requirements*.txt`to pick up a fix in that module that makes working with charts from pandas easier.
- Added a comment to `release.rst`.
- Modified `format.py` to format MultiIndex and Hierarchical Rows as merged cells in Excel. The old code path/option is still available. The new formatting must be explicitly invoked via the `merge_cells` option in `to_excel`:
``` python
df.to_excel('file.xlsx', merge_cells=True)
```
- The `merge_cells` option can be renamed if required. During development I also used `multi_index` and `merge_range`.
- Updated the API and docs in `frame.py` to reflect the new option.
- Fixed openpyxl merge handling in `excel.py`.
- Modified the `test_excel.py` test cases so that they could be used to test the existing `dot notation` or the new `merge_cells` options for MultiIndex and Hierarchical Rows handling.
- Did some minor PEP8 formatting to the `test_excel.py`.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5423 | 2013-11-03T20:42:24Z | 2013-11-06T01:42:23Z | 2013-11-06T01:42:23Z | 2014-06-16T22:40:15Z |
TST: make pytables tests go thru a temporary dir and file | diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py
index 97dc8dcdec73a..d3d113eaddc45 100644
--- a/pandas/io/pytables.py
+++ b/pandas/io/pytables.py
@@ -225,11 +225,6 @@ def _tables():
return _table_mod
-def h5_open(path, mode):
- tables = _tables()
- return tables.openFile(path, mode)
-
-
@contextmanager
def get_store(path, **kwargs):
"""
@@ -475,6 +470,8 @@ def open(self, mode='a'):
mode : {'a', 'w', 'r', 'r+'}, default 'a'
See HDFStore docstring or tables.openFile for info about modes
"""
+ tables = _tables()
+
if self._mode != mode:
# if we are chaning a write mode to read, ok
@@ -501,13 +498,20 @@ def open(self, mode='a'):
fletcher32=self._fletcher32)
try:
- self._handle = h5_open(self._path, self._mode)
- except IOError as e: # pragma: no cover
+ self._handle = tables.openFile(self._path, self._mode)
+ except (IOError) as e: # pragma: no cover
if 'can not be written' in str(e):
print('Opening %s in read-only mode' % self._path)
- self._handle = h5_open(self._path, 'r')
+ self._handle = tables.openFile(self._path, 'r')
else:
raise
+ except (Exception) as e:
+
+ # trying to read from a non-existant file causes an error which
+ # is not part of IOError, make it one
+ if self._mode == 'r' and 'Unable to open/create file' in str(e):
+ raise IOError(str(e))
+ raise
def close(self):
"""
diff --git a/pandas/io/tests/test_pytables.py b/pandas/io/tests/test_pytables.py
index 598f374e0fcf7..f51228fd89a42 100644
--- a/pandas/io/tests/test_pytables.py
+++ b/pandas/io/tests/test_pytables.py
@@ -3,6 +3,7 @@
import sys
import os
import warnings
+import tempfile
from contextlib import contextmanager
import datetime
@@ -57,6 +58,11 @@ def safe_close(store):
@contextmanager
def ensure_clean(path, mode='a', complevel=None, complib=None,
fletcher32=False):
+
+ # put in the temporary path if we don't have one already
+ if not len(os.path.dirname(path)):
+ path = tempfile.mkstemp(suffix=path)[1]
+
store = HDFStore(path, mode=mode, complevel=complevel,
complib=complib, fletcher32=False)
try:
@@ -192,17 +198,22 @@ def test_api(self):
with ensure_clean(self.path) as store:
+ path = store._path
df = tm.makeDataFrame()
+
+ _maybe_remove(store,'df')
store.append('df',df.iloc[:10],append=True,format='table')
store.append('df',df.iloc[10:],append=True,format='table')
assert_frame_equal(read_hdf(path,'df'),df)
# append to False
+ _maybe_remove(store,'df')
store.append('df',df.iloc[:10],append=False,format='table')
store.append('df',df.iloc[10:],append=True,format='table')
assert_frame_equal(read_hdf(path,'df'),df)
# formats
+ _maybe_remove(store,'df')
store.append('df',df.iloc[:10],append=False,format='table')
store.append('df',df.iloc[10:],append=True,format='table')
assert_frame_equal(read_hdf(path,'df'),df)
@@ -373,7 +384,7 @@ def check(mode):
with tm.ensure_clean(self.path) as path:
# constructor
- if mode in ['r','r+']:
+ if mode in ['r']:
self.assertRaises(IOError, HDFStore, path, mode=mode)
else:
@@ -384,7 +395,7 @@ def check(mode):
with tm.ensure_clean(self.path) as path:
# context
- if mode in ['r','r+']:
+ if mode in ['r']:
def f():
with get_store(path,mode=mode) as store:
pass
@@ -396,7 +407,7 @@ def f():
with tm.ensure_clean(self.path) as path:
# conv write
- if mode in ['r','r+']:
+ if mode in ['r']:
self.assertRaises(IOError, df.to_hdf, path, 'df', mode=mode)
df.to_hdf(path,'df',mode='w')
else:
diff --git a/pandas/util/testing.py b/pandas/util/testing.py
index 2e4d1f3e8df74..414fb2ad1b77d 100644
--- a/pandas/util/testing.py
+++ b/pandas/util/testing.py
@@ -314,7 +314,7 @@ def ensure_clean(filename=None, return_filelike=False):
filename : str (optional)
if None, creates a temporary file which is then removed when out of
scope.
- return_filelike: bool (default False)
+ return_filelike : bool (default False)
if True, returns a file-like which is *always* cleaned. Necessary for
savefig and other functions which want to append extensions. Ignores
filename if True.
@@ -329,8 +329,9 @@ def ensure_clean(filename=None, return_filelike=False):
else:
# if we are not passed a filename, generate a temporary
- if filename is None:
- filename = tempfile.mkstemp()[1]
+ # make sure that we are using a temp dir as well
+ suffix = filename if filename is not None and not len(os.path.dirname(filename)) else ''
+ filename = tempfile.mkstemp(suffix=suffix)[1]
try:
yield filename
| TST/BUG: incorrect way of testing for r+ modes
related #5419
| https://api.github.com/repos/pandas-dev/pandas/pulls/5422 | 2013-11-03T17:26:01Z | 2013-11-03T17:44:08Z | null | 2014-07-16T08:38:46Z |
TST: Use tempfiles in all tests. | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 6e10bd651d90a..04642c358d000 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -769,6 +769,7 @@ Bug Fixes
- The GroupBy methods ``transform`` and ``filter`` can be used on Series
and DataFrames that have repeated (non-unique) indices. (:issue:`4620`)
- Fix empty series not printing name in repr (:issue:`4651`)
+ - Make tests create temp files in temp directory by default. (:issue:`5419`)
pandas 0.12.0
-------------
diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py
index 97dc8dcdec73a..d3d113eaddc45 100644
--- a/pandas/io/pytables.py
+++ b/pandas/io/pytables.py
@@ -225,11 +225,6 @@ def _tables():
return _table_mod
-def h5_open(path, mode):
- tables = _tables()
- return tables.openFile(path, mode)
-
-
@contextmanager
def get_store(path, **kwargs):
"""
@@ -475,6 +470,8 @@ def open(self, mode='a'):
mode : {'a', 'w', 'r', 'r+'}, default 'a'
See HDFStore docstring or tables.openFile for info about modes
"""
+ tables = _tables()
+
if self._mode != mode:
# if we are chaning a write mode to read, ok
@@ -501,13 +498,20 @@ def open(self, mode='a'):
fletcher32=self._fletcher32)
try:
- self._handle = h5_open(self._path, self._mode)
- except IOError as e: # pragma: no cover
+ self._handle = tables.openFile(self._path, self._mode)
+ except (IOError) as e: # pragma: no cover
if 'can not be written' in str(e):
print('Opening %s in read-only mode' % self._path)
- self._handle = h5_open(self._path, 'r')
+ self._handle = tables.openFile(self._path, 'r')
else:
raise
+ except (Exception) as e:
+
+ # trying to read from a non-existant file causes an error which
+ # is not part of IOError, make it one
+ if self._mode == 'r' and 'Unable to open/create file' in str(e):
+ raise IOError(str(e))
+ raise
def close(self):
"""
diff --git a/pandas/io/tests/test_excel.py b/pandas/io/tests/test_excel.py
index 311a0953f1c02..6eb3cbf1a3903 100644
--- a/pandas/io/tests/test_excel.py
+++ b/pandas/io/tests/test_excel.py
@@ -261,10 +261,9 @@ def test_read_xlrd_Book(self):
import xlrd
- pth = '__tmp_excel_read_worksheet__.xls'
df = self.frame
- with ensure_clean(pth) as pth:
+ with ensure_clean('.xls') as pth:
df.to_excel(pth, "SheetA")
book = xlrd.open_workbook(pth)
@@ -303,7 +302,7 @@ def test_reader_closes_file(self):
f = open(pth, 'rb')
with ExcelFile(f) as xlsx:
# parses okay
- df = xlsx.parse('Sheet1', index_col=0)
+ xlsx.parse('Sheet1', index_col=0)
self.assertTrue(f.closed)
@@ -364,12 +363,12 @@ class ExcelWriterBase(SharedItems):
# 1. A check_skip function that skips your tests if your writer isn't
# installed.
# 2. Add a property ext, which is the file extension that your writer
- # writes to.
+ # writes to. (needs to start with '.' so it's a valid path)
# 3. Add a property engine_name, which is the name of the writer class.
def setUp(self):
self.check_skip()
super(ExcelWriterBase, self).setUp()
- self.option_name = 'io.excel.%s.writer' % self.ext
+ self.option_name = 'io.excel.%s.writer' % self.ext.strip('.')
self.prev_engine = get_option(self.option_name)
set_option(self.option_name, self.engine_name)
@@ -380,10 +379,7 @@ def test_excel_sheet_by_name_raise(self):
_skip_if_no_xlrd()
import xlrd
- ext = self.ext
- pth = os.path.join(self.dirpath, 'testit.{0}'.format(ext))
-
- with ensure_clean(pth) as pth:
+ with ensure_clean(self.ext) as pth:
gt = DataFrame(np.random.randn(10, 2))
gt.to_excel(pth)
xl = ExcelFile(pth)
@@ -394,10 +390,8 @@ def test_excel_sheet_by_name_raise(self):
def test_excelwriter_contextmanager(self):
_skip_if_no_xlrd()
- ext = self.ext
- pth = os.path.join(self.dirpath, 'testit.{0}'.format(ext))
- with ensure_clean(pth) as pth:
+ with ensure_clean(self.ext) as pth:
with ExcelWriter(pth) as writer:
self.frame.to_excel(writer, 'Data1')
self.frame2.to_excel(writer, 'Data2')
@@ -410,10 +404,8 @@ def test_excelwriter_contextmanager(self):
def test_roundtrip(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_from_excel__.' + ext
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
self.frame['A'][:5] = nan
self.frame.to_excel(path, 'test1')
@@ -446,10 +438,8 @@ def test_roundtrip(self):
def test_mixed(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_from_excel_mixed__.' + ext
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
self.mixed_frame.to_excel(path, 'test1')
reader = ExcelFile(path)
recons = reader.parse('test1', index_col=0)
@@ -457,12 +447,10 @@ def test_mixed(self):
def test_tsframe(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_from_excel_tsframe__.' + ext
df = tm.makeTimeDataFrame()[:5]
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
df.to_excel(path, 'test1')
reader = ExcelFile(path)
recons = reader.parse('test1')
@@ -470,22 +458,19 @@ def test_tsframe(self):
def test_basics_with_nan(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_from_excel_int_types__.' + ext
- self.frame['A'][:5] = nan
- self.frame.to_excel(path, 'test1')
- self.frame.to_excel(path, 'test1', cols=['A', 'B'])
- self.frame.to_excel(path, 'test1', header=False)
- self.frame.to_excel(path, 'test1', index=False)
+ with ensure_clean(self.ext) as path:
+ self.frame['A'][:5] = nan
+ self.frame.to_excel(path, 'test1')
+ self.frame.to_excel(path, 'test1', cols=['A', 'B'])
+ self.frame.to_excel(path, 'test1', header=False)
+ self.frame.to_excel(path, 'test1', index=False)
def test_int_types(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_from_excel_int_types__.' + ext
for np_type in (np.int8, np.int16, np.int32, np.int64):
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
# Test np.int values read come back as int (rather than float
# which is Excel's format).
frame = DataFrame(np.random.randint(-10, 10, size=(10, 2)),
@@ -505,11 +490,9 @@ def test_int_types(self):
def test_float_types(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_from_excel_float_types__.' + ext
for np_type in (np.float16, np.float32, np.float64):
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
# Test np.float values read come back as float.
frame = DataFrame(np.random.random_sample(10), dtype=np_type)
frame.to_excel(path, 'test1')
@@ -519,11 +502,9 @@ def test_float_types(self):
def test_bool_types(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_from_excel_bool_types__.' + ext
for np_type in (np.bool8, np.bool_):
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
# Test np.bool values read come back as float.
frame = (DataFrame([1, 0, True, False], dtype=np_type))
frame.to_excel(path, 'test1')
@@ -533,10 +514,8 @@ def test_bool_types(self):
def test_sheets(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_from_excel_sheets__.' + ext
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
self.frame['A'][:5] = nan
self.frame.to_excel(path, 'test1')
@@ -560,10 +539,8 @@ def test_sheets(self):
def test_colaliases(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_from_excel_aliases__.' + ext
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
self.frame['A'][:5] = nan
self.frame.to_excel(path, 'test1')
@@ -582,10 +559,8 @@ def test_colaliases(self):
def test_roundtrip_indexlabels(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_from_excel_indexlabels__.' + ext
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
self.frame['A'][:5] = nan
@@ -617,10 +592,7 @@ def test_roundtrip_indexlabels(self):
frame.index.names = ['test']
self.assertEqual(frame.index.names, recons.index.names)
- # test index_labels in same row as column names
- path = '%s.%s' % (tm.rands(10), ext)
-
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
self.frame.to_excel(path, 'test1',
cols=['A', 'B', 'C', 'D'], index=False)
@@ -636,12 +608,10 @@ def test_roundtrip_indexlabels(self):
def test_excel_roundtrip_indexname(self):
_skip_if_no_xlrd()
- path = '%s.%s' % (tm.rands(10), self.ext)
-
df = DataFrame(np.random.randn(10, 4))
df.index.name = 'foo'
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
df.to_excel(path)
xf = ExcelFile(path)
@@ -656,7 +626,7 @@ def test_excel_roundtrip_datetime(self):
# datetime.date, not sure what to test here exactly
path = '__tmp_excel_roundtrip_datetime__.' + self.ext
tsf = self.tsframe.copy()
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
tsf.index = [x.date() for x in self.tsframe.index]
tsf.to_excel(path, 'test1')
@@ -670,7 +640,7 @@ def test_to_excel_periodindex(self):
frame = self.tsframe
xp = frame.resample('M', kind='period')
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
xp.to_excel(path, 'sht1')
reader = ExcelFile(path)
@@ -679,8 +649,6 @@ def test_to_excel_periodindex(self):
def test_to_excel_multiindex(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_multiindex__' + ext + '__.' + ext
frame = self.frame
old_index = frame.index
@@ -689,7 +657,7 @@ def test_to_excel_multiindex(self):
names=['first', 'second'])
frame.index = new_index
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
frame.to_excel(path, 'test1', header=False)
frame.to_excel(path, 'test1', cols=['A', 'B'])
@@ -703,8 +671,6 @@ def test_to_excel_multiindex(self):
def test_to_excel_multiindex_dates(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_multiindex_dates__' + ext + '__.' + ext
# try multiindex with dates
tsframe = self.tsframe
@@ -712,7 +678,7 @@ def test_to_excel_multiindex_dates(self):
new_index = [old_index, np.arange(len(old_index))]
tsframe.index = MultiIndex.from_arrays(new_index)
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
tsframe.to_excel(path, 'test1', index_label=['time', 'foo'])
reader = ExcelFile(path)
recons = reader.parse('test1', index_col=[0, 1])
@@ -736,7 +702,7 @@ def test_to_excel_float_format(self):
[12.32112, 123123.2, 321321.2]],
index=['A', 'B'], columns=['X', 'Y', 'Z'])
- with ensure_clean(filename) as filename:
+ with ensure_clean(self.ext) as filename:
df.to_excel(filename, 'test1', float_format='%.2f')
reader = ExcelFile(filename)
@@ -748,21 +714,18 @@ def test_to_excel_float_format(self):
def test_to_excel_unicode_filename(self):
_skip_if_no_xlrd()
- ext = self.ext
- filename = u('\u0192u.') + ext
-
- try:
- f = open(filename, 'wb')
- except UnicodeEncodeError:
- raise nose.SkipTest('no unicode file names on this system')
- else:
- f.close()
-
- df = DataFrame([[0.123456, 0.234567, 0.567567],
- [12.32112, 123123.2, 321321.2]],
- index=['A', 'B'], columns=['X', 'Y', 'Z'])
+ with ensure_clean(u('\u0192u.') + self.ext) as filename:
+ try:
+ f = open(filename, 'wb')
+ except UnicodeEncodeError:
+ raise nose.SkipTest('no unicode file names on this system')
+ else:
+ f.close()
+
+ df = DataFrame([[0.123456, 0.234567, 0.567567],
+ [12.32112, 123123.2, 321321.2]],
+ index=['A', 'B'], columns=['X', 'Y', 'Z'])
- with ensure_clean(filename) as filename:
df.to_excel(filename, 'test1', float_format='%.2f')
reader = ExcelFile(filename)
@@ -879,10 +842,9 @@ def test_excel_010_hemstring(self):
# override of #2370 until sorted out in 0.11
def roundtrip(df, header=True, parser_hdr=0):
- path = '__tmp__test_xl_010_%s__.%s' % (np.random.randint(1, 10000), self.ext)
- df.to_excel(path, header=header)
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
+ df.to_excel(path, header=header)
xf = pd.ExcelFile(path)
res = xf.parse(xf.sheet_names[0], header=parser_hdr)
return res
@@ -926,10 +888,8 @@ def roundtrip(df, header=True, parser_hdr=0):
def test_duplicated_columns(self):
# Test for issue #5235.
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_duplicated_columns__.' + ext
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
write_frame = DataFrame([[1, 2, 3], [1, 2, 3], [1, 2, 3]])
colnames = ['A', 'B', 'B']
@@ -943,7 +903,7 @@ def test_duplicated_columns(self):
class OpenpyxlTests(ExcelWriterBase, unittest.TestCase):
- ext = 'xlsx'
+ ext = '.xlsx'
engine_name = 'openpyxl'
check_skip = staticmethod(_skip_if_no_openpyxl)
@@ -974,7 +934,7 @@ def test_to_excel_styleconverter(self):
class XlwtTests(ExcelWriterBase, unittest.TestCase):
- ext = 'xls'
+ ext = '.xls'
engine_name = 'xlwt'
check_skip = staticmethod(_skip_if_no_xlwt)
@@ -999,7 +959,7 @@ def test_to_excel_styleconverter(self):
class XlsxWriterTests(ExcelWriterBase, unittest.TestCase):
- ext = 'xlsx'
+ ext = '.xlsx'
engine_name = 'xlsxwriter'
check_skip = staticmethod(_skip_if_no_xlsxwriter)
@@ -1007,10 +967,8 @@ class XlsxWriterTests(ExcelWriterBase, unittest.TestCase):
# floating point values read back in from the output XlsxWriter file.
def test_roundtrip_indexlabels(self):
_skip_if_no_xlrd()
- ext = self.ext
- path = '__tmp_to_excel_from_excel_indexlabels__.' + ext
- with ensure_clean(path) as path:
+ with ensure_clean(self.ext) as path:
self.frame['A'][:5] = nan
diff --git a/pandas/io/tests/test_pytables.py b/pandas/io/tests/test_pytables.py
index 598f374e0fcf7..f51228fd89a42 100644
--- a/pandas/io/tests/test_pytables.py
+++ b/pandas/io/tests/test_pytables.py
@@ -3,6 +3,7 @@
import sys
import os
import warnings
+import tempfile
from contextlib import contextmanager
import datetime
@@ -57,6 +58,11 @@ def safe_close(store):
@contextmanager
def ensure_clean(path, mode='a', complevel=None, complib=None,
fletcher32=False):
+
+ # put in the temporary path if we don't have one already
+ if not len(os.path.dirname(path)):
+ path = tempfile.mkstemp(suffix=path)[1]
+
store = HDFStore(path, mode=mode, complevel=complevel,
complib=complib, fletcher32=False)
try:
@@ -192,17 +198,22 @@ def test_api(self):
with ensure_clean(self.path) as store:
+ path = store._path
df = tm.makeDataFrame()
+
+ _maybe_remove(store,'df')
store.append('df',df.iloc[:10],append=True,format='table')
store.append('df',df.iloc[10:],append=True,format='table')
assert_frame_equal(read_hdf(path,'df'),df)
# append to False
+ _maybe_remove(store,'df')
store.append('df',df.iloc[:10],append=False,format='table')
store.append('df',df.iloc[10:],append=True,format='table')
assert_frame_equal(read_hdf(path,'df'),df)
# formats
+ _maybe_remove(store,'df')
store.append('df',df.iloc[:10],append=False,format='table')
store.append('df',df.iloc[10:],append=True,format='table')
assert_frame_equal(read_hdf(path,'df'),df)
@@ -373,7 +384,7 @@ def check(mode):
with tm.ensure_clean(self.path) as path:
# constructor
- if mode in ['r','r+']:
+ if mode in ['r']:
self.assertRaises(IOError, HDFStore, path, mode=mode)
else:
@@ -384,7 +395,7 @@ def check(mode):
with tm.ensure_clean(self.path) as path:
# context
- if mode in ['r','r+']:
+ if mode in ['r']:
def f():
with get_store(path,mode=mode) as store:
pass
@@ -396,7 +407,7 @@ def f():
with tm.ensure_clean(self.path) as path:
# conv write
- if mode in ['r','r+']:
+ if mode in ['r']:
self.assertRaises(IOError, df.to_hdf, path, 'df', mode=mode)
df.to_hdf(path,'df',mode='w')
else:
diff --git a/pandas/tests/test_frame.py b/pandas/tests/test_frame.py
index b73c7cdbb8f87..22f5fc527d8f5 100644
--- a/pandas/tests/test_frame.py
+++ b/pandas/tests/test_frame.py
@@ -5477,12 +5477,13 @@ def make_dtnat_arr(n,nnat=None):
# N=35000
s1=make_dtnat_arr(chunksize+5)
s2=make_dtnat_arr(chunksize+5,0)
+ path = '1.csv'
- # s3=make_dtnat_arr(chunksize+5,0)
- with ensure_clean('1.csv') as path:
+ # s3=make_dtnjat_arr(chunksize+5,0)
+ with ensure_clean('.csv') as pth:
df=DataFrame(dict(a=s1,b=s2))
- df.to_csv(path,chunksize=chunksize)
- recons = DataFrame.from_csv(path).convert_objects('coerce')
+ df.to_csv(pth,chunksize=chunksize)
+ recons = DataFrame.from_csv(pth).convert_objects('coerce')
assert_frame_equal(df, recons,check_names=False,check_less_precise=True)
for ncols in [4]:
@@ -5491,7 +5492,6 @@ def make_dtnat_arr(n,nnat=None):
base-1,base,base+1]:
_do_test(mkdf(nrows, ncols,r_idx_type='dt',
c_idx_type='s'),path, 'dt','s')
- pass
for ncols in [4]:
diff --git a/pandas/util/testing.py b/pandas/util/testing.py
index 2e4d1f3e8df74..42eef51b421db 100644
--- a/pandas/util/testing.py
+++ b/pandas/util/testing.py
@@ -313,24 +313,25 @@ def ensure_clean(filename=None, return_filelike=False):
----------
filename : str (optional)
if None, creates a temporary file which is then removed when out of
- scope.
- return_filelike: bool (default False)
+ scope. if passed, creates temporary file with filename as ending.
+ return_filelike : bool (default False)
if True, returns a file-like which is *always* cleaned. Necessary for
- savefig and other functions which want to append extensions. Ignores
- filename if True.
+ savefig and other functions which want to append extensions.
"""
+ filename = filename or ''
if return_filelike:
- f = tempfile.TemporaryFile()
+ f = tempfile.TemporaryFile(suffix=filename)
try:
yield f
finally:
f.close()
else:
- # if we are not passed a filename, generate a temporary
- if filename is None:
- filename = tempfile.mkstemp()[1]
+ # don't generate tempfile if using a path with directory specified
+ if len(os.path.dirname(filename)):
+ raise ValueError("Can't pass a qualified name to ensure_clean()")
+ filename = tempfile.mkstemp(suffix=filename)[1]
try:
yield filename
@@ -339,7 +340,7 @@ def ensure_clean(filename=None, return_filelike=False):
if os.path.exists(filename):
os.remove(filename)
except Exception as e:
- print(e)
+ print("Exception on removing file: %s" % e)
def get_data_path(f=''):
| If you really need to, possible to opt-out with make_tempfile=False.
Something weird with HDF where, even though it's _supposed_ to be
removing the file every time, it causes issues to use a real temp
file... Not sure why (maybe I missed something there).
| https://api.github.com/repos/pandas-dev/pandas/pulls/5419 | 2013-11-03T00:50:08Z | 2013-11-03T23:42:17Z | null | 2014-06-26T00:27:11Z |
BUG: Panel.to_frame() with MultiIndex major axis | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 9a0854494a897..8179c710b7a8a 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -104,6 +104,8 @@ Bug Fixes
- Fixed string-representation of ``NaT`` to be "NaT" (:issue:`5708`)
- Fixed string-representation for Timestamp to show nanoseconds if present (:issue:`5912`)
- ``pd.match`` not returning passed sentinel
+ - ``Panel.to_frame()`` no longer fails when ``major_axis`` is a
+ ``MultiIndex`` (:issue:`5402`).
pandas 0.13.0
-------------
diff --git a/pandas/core/index.py b/pandas/core/index.py
index 5c77c1e5e9516..ed964e76dd470 100644
--- a/pandas/core/index.py
+++ b/pandas/core/index.py
@@ -2396,6 +2396,44 @@ def format(self, space=2, sparsify=None, adjoin=True, names=False,
else:
return result_levels
+ def to_hierarchical(self, n_repeat, n_shuffle=1):
+ """
+ Return a MultiIndex reshaped to conform to the
+ shapes given by n_repeat and n_shuffle.
+
+ Useful to replicate and rearrange a MultiIndex for combination
+ with another Index with n_repeat items.
+
+ Parameters
+ ----------
+ n_repeat : int
+ Number of times to repeat the labels on self
+ n_shuffle : int
+ Controls the reordering of the labels. If the result is going
+ to be an inner level in a MultiIndex, n_shuffle will need to be
+ greater than one. The size of each label must divisible by
+ n_shuffle.
+
+ Returns
+ -------
+ MultiIndex
+
+ Examples
+ --------
+ >>> idx = MultiIndex.from_tuples([(1, u'one'), (1, u'two'),
+ (2, u'one'), (2, u'two')])
+ >>> idx.to_hierarchical(3)
+ MultiIndex(levels=[[1, 2], [u'one', u'two']],
+ labels=[[0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1],
+ [0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1]])
+ """
+ levels = self.levels
+ labels = [np.repeat(x, n_repeat) for x in self.labels]
+ # Assumes that each label is divisible by n_shuffle
+ labels = [x.reshape(n_shuffle, -1).ravel(1) for x in labels]
+ names = self.names
+ return MultiIndex(levels=levels, labels=labels, names=names)
+
@property
def is_all_dates(self):
return False
diff --git a/pandas/core/panel.py b/pandas/core/panel.py
index 8c50396c503a0..832874f08561b 100644
--- a/pandas/core/panel.py
+++ b/pandas/core/panel.py
@@ -796,7 +796,9 @@ def groupby(self, function, axis='major'):
def to_frame(self, filter_observations=True):
"""
- Transform wide format into long (stacked) format as DataFrame
+ Transform wide format into long (stacked) format as DataFrame whose
+ columns are the Panel's items and whose index is a MultiIndex formed
+ of the Panel's major and minor axes.
Parameters
----------
@@ -811,6 +813,7 @@ def to_frame(self, filter_observations=True):
_, N, K = self.shape
if filter_observations:
+ # shaped like the return DataFrame
mask = com.notnull(self.values).all(axis=0)
# size = mask.sum()
selector = mask.ravel()
@@ -822,19 +825,45 @@ def to_frame(self, filter_observations=True):
for item in self.items:
data[item] = self[item].values.ravel()[selector]
- major_labels = np.arange(N).repeat(K)[selector]
+ def construct_multi_parts(idx, n_repeat, n_shuffle=1):
+ axis_idx = idx.to_hierarchical(n_repeat, n_shuffle)
+ labels = [x[selector] for x in axis_idx.labels]
+ levels = axis_idx.levels
+ names = axis_idx.names
+ return labels, levels, names
+
+ def construct_index_parts(idx, major=True):
+ levels = [idx]
+ if major:
+ labels = [np.arange(N).repeat(K)[selector]]
+ names = idx.name or 'major'
+ else:
+ labels = np.arange(K).reshape(1, K)[np.zeros(N, dtype=int)]
+ labels = [labels.ravel()[selector]]
+ names = idx.name or 'minor'
+ names = [names]
+ return labels, levels, names
+
+ if isinstance(self.major_axis, MultiIndex):
+ major_labels, major_levels, major_names = construct_multi_parts(
+ self.major_axis, n_repeat=K)
+ else:
+ major_labels, major_levels, major_names = construct_index_parts(
+ self.major_axis)
- # Anyone think of a better way to do this? np.repeat does not
- # do what I want
- minor_labels = np.arange(K).reshape(1, K)[np.zeros(N, dtype=int)]
- minor_labels = minor_labels.ravel()[selector]
+ if isinstance(self.minor_axis, MultiIndex):
+ minor_labels, minor_levels, minor_names = construct_multi_parts(
+ self.minor_axis, n_repeat=N, n_shuffle=K)
+ else:
+ minor_labels, minor_levels, minor_names = construct_index_parts(
+ self.minor_axis, major=False)
- maj_name = self.major_axis.name or 'major'
- min_name = self.minor_axis.name or 'minor'
+ levels = major_levels + minor_levels
+ labels = major_labels + minor_labels
+ names = major_names + minor_names
- index = MultiIndex(levels=[self.major_axis, self.minor_axis],
- labels=[major_labels, minor_labels],
- names=[maj_name, min_name], verify_integrity=False)
+ index = MultiIndex(levels=levels, labels=labels,
+ names=names, verify_integrity=False)
return DataFrame(data, index=index, columns=self.items)
diff --git a/pandas/tests/test_index.py b/pandas/tests/test_index.py
index 1afabc8d4c882..7daf95ac15a95 100644
--- a/pandas/tests/test_index.py
+++ b/pandas/tests/test_index.py
@@ -1990,6 +1990,36 @@ def test_format_sparse_config(self):
warnings.filters = warn_filters
+ def test_to_hierarchical(self):
+ index = MultiIndex.from_tuples([(1, 'one'), (1, 'two'),
+ (2, 'one'), (2, 'two')])
+ result = index.to_hierarchical(3)
+ expected = MultiIndex(levels=[[1, 2], ['one', 'two']],
+ labels=[[0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1],
+ [0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1]])
+ tm.assert_index_equal(result, expected)
+ self.assertEqual(result.names, index.names)
+
+ # K > 1
+ result = index.to_hierarchical(3, 2)
+ expected = MultiIndex(levels=[[1, 2], ['one', 'two']],
+ labels=[[0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1],
+ [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1]])
+ tm.assert_index_equal(result, expected)
+ self.assertEqual(result.names, index.names)
+
+ # non-sorted
+ index = MultiIndex.from_tuples([(2, 'c'), (1, 'b'),
+ (2, 'a'), (2, 'b')],
+ names=['N1', 'N2'])
+
+ result = index.to_hierarchical(2)
+ expected = MultiIndex.from_tuples([(2, 'c'), (2, 'c'), (1, 'b'), (1, 'b'),
+ (2, 'a'), (2, 'a'), (2, 'b'), (2, 'b')],
+ names=['N1', 'N2'])
+ tm.assert_index_equal(result, expected)
+ self.assertEqual(result.names, index.names)
+
def test_bounds(self):
self.index._bounds
diff --git a/pandas/tests/test_panel.py b/pandas/tests/test_panel.py
index 08d3afe63ec86..2589f7b82aedb 100644
--- a/pandas/tests/test_panel.py
+++ b/pandas/tests/test_panel.py
@@ -1450,6 +1450,86 @@ def test_to_frame_mixed(self):
# Previously, this was mutating the underlying index and changing its name
assert_frame_equal(wp['bool'], panel['bool'], check_names=False)
+ def test_to_frame_multi_major(self):
+ idx = MultiIndex.from_tuples([(1, 'one'), (1, 'two'), (2, 'one'),
+ (2, 'two')])
+ df = DataFrame([[1, 'a', 1], [2, 'b', 1], [3, 'c', 1], [4, 'd', 1]],
+ columns=['A', 'B', 'C'], index=idx)
+ wp = Panel({'i1': df, 'i2': df})
+ expected_idx = MultiIndex.from_tuples([(1, 'one', 'A'), (1, 'one', 'B'),
+ (1, 'one', 'C'), (1, 'two', 'A'),
+ (1, 'two', 'B'), (1, 'two', 'C'),
+ (2, 'one', 'A'), (2, 'one', 'B'),
+ (2, 'one', 'C'), (2, 'two', 'A'),
+ (2, 'two', 'B'), (2, 'two', 'C')],
+ names=[None, None, 'minor'])
+ expected = DataFrame({'i1': [1, 'a', 1, 2, 'b', 1, 3, 'c', 1, 4, 'd', 1],
+ 'i2': [1, 'a', 1, 2, 'b', 1, 3, 'c', 1, 4, 'd', 1]},
+ index=expected_idx)
+ result = wp.to_frame()
+ assert_frame_equal(result, expected)
+
+ wp.iloc[0, 0].iloc[0] = np.nan # BUG on setting. GH #5773
+ result = wp.to_frame()
+ assert_frame_equal(result, expected[1:])
+
+ idx = MultiIndex.from_tuples([(1, 'two'), (1, 'one'), (2, 'one'),
+ (np.nan, 'two')])
+ df = DataFrame([[1, 'a', 1], [2, 'b', 1], [3, 'c', 1], [4, 'd', 1]],
+ columns=['A', 'B', 'C'], index=idx)
+ wp = Panel({'i1': df, 'i2': df})
+ ex_idx = MultiIndex.from_tuples([(1, 'two', 'A'), (1, 'two', 'B'), (1, 'two', 'C'),
+ (1, 'one', 'A'), (1, 'one', 'B'), (1, 'one', 'C'),
+ (2, 'one', 'A'), (2, 'one', 'B'), (2, 'one', 'C'),
+ (np.nan, 'two', 'A'), (np.nan, 'two', 'B'),
+ (np.nan, 'two', 'C')],
+ names=[None, None, 'minor'])
+ expected.index = ex_idx
+ result = wp.to_frame()
+ assert_frame_equal(result, expected)
+
+ def test_to_frame_multi_major_minor(self):
+ cols = MultiIndex(levels=[['C_A', 'C_B'], ['C_1', 'C_2']],
+ labels=[[0, 0, 1, 1], [0, 1, 0, 1]])
+ idx = MultiIndex.from_tuples([(1, 'one'), (1, 'two'), (2, 'one'),
+ (2, 'two'), (3, 'three'), (4, 'four')])
+ df = DataFrame([[1, 2, 11, 12], [3, 4, 13, 14], ['a', 'b', 'w', 'x'],
+ ['c', 'd', 'y', 'z'], [-1, -2, -3, -4], [-5, -6, -7, -8]
+ ], columns=cols, index=idx)
+ wp = Panel({'i1': df, 'i2': df})
+
+ exp_idx = MultiIndex.from_tuples([(1, 'one', 'C_A', 'C_1'), (1, 'one', 'C_A', 'C_2'),
+ (1, 'one', 'C_B', 'C_1'), (1, 'one', 'C_B', 'C_2'),
+ (1, 'two', 'C_A', 'C_1'), (1, 'two', 'C_A', 'C_2'),
+ (1, 'two', 'C_B', 'C_1'), (1, 'two', 'C_B', 'C_2'),
+ (2, 'one', 'C_A', 'C_1'), (2, 'one', 'C_A', 'C_2'),
+ (2, 'one', 'C_B', 'C_1'), (2, 'one', 'C_B', 'C_2'),
+ (2, 'two', 'C_A', 'C_1'), (2, 'two', 'C_A', 'C_2'),
+ (2, 'two', 'C_B', 'C_1'), (2, 'two', 'C_B', 'C_2'),
+ (3, 'three', 'C_A', 'C_1'), (3, 'three', 'C_A', 'C_2'),
+ (3, 'three', 'C_B', 'C_1'), (3, 'three', 'C_B', 'C_2'),
+ (4, 'four', 'C_A', 'C_1'), (4, 'four', 'C_A', 'C_2'),
+ (4, 'four', 'C_B', 'C_1'), (4, 'four', 'C_B', 'C_2')],
+ names=[None, None, None, None])
+ exp_val = [[1, 1], [2, 2], [11, 11], [12, 12], [3, 3], [4, 4], [13, 13],
+ [14, 14], ['a', 'a'], ['b', 'b'], ['w', 'w'], ['x', 'x'],
+ ['c', 'c'], ['d', 'd'], ['y', 'y'], ['z', 'z'], [-1, -1],
+ [-2, -2], [-3, -3], [-4, -4], [-5, -5], [-6, -6], [-7, -7],
+ [-8, -8]]
+ result = wp.to_frame()
+ expected = DataFrame(exp_val, columns=['i1', 'i2'], index=exp_idx)
+ assert_frame_equal(result, expected)
+
+ def test_to_frame_multi_drop_level(self):
+ idx = MultiIndex.from_tuples([(1, 'one'), (2, 'one'), (2, 'two')])
+ df = DataFrame({'A': [np.nan, 1, 2]}, index=idx)
+ wp = Panel({'i1': df, 'i2': df})
+ result = wp.to_frame()
+ exp_idx = MultiIndex.from_tuples([(2, 'one', 'A'), (2, 'two', 'A')],
+ names=[None, None, 'minor'])
+ expected = DataFrame({'i1': [1., 2], 'i2': [1., 2]}, index=exp_idx)
+ assert_frame_equal(result, expected)
+
def test_to_panel_na_handling(self):
df = DataFrame(np.random.randint(0, 10, size=20).reshape((10, 2)),
index=[[0, 0, 0, 0, 0, 0, 1, 1, 1, 1],
| Closes #5402 WIP for now.
So this is a hack to get things "working".
I mainly just wanted to ask if there was a better way to get the levels and labels to the MultiIndex constructor.
Don't spend long thinking about it (this is my PR after all), but if you know of a quick way off the top of your head, I'd be interested.
I essentially need to
1. flatten the MultiIndex from major axis (levels and labels)
2. combine that flattened index with the minor axis (levels and labels)
Step 2 could be complicated by `minor_axis` being a MultiIndex also, I should be able to refactor this pretty easily to handle that. I think my was is making several copies of each index, and I'm not sure that they're all necessary.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5417 | 2013-11-02T19:37:15Z | 2014-01-15T16:12:41Z | 2014-01-15T16:12:41Z | 2016-11-03T12:37:41Z |
io.html.read_html support XPath expressions for table selection | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 6e10bd651d90a..c779b25b30444 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -52,6 +52,8 @@ pandas 0.13.0
New features
~~~~~~~~~~~~
+ - ``read_html()`` now accepts an ``xpath`` string argument representing an
+ xpath expression used for selecting tables to be read (:issue:`5416`)
- ``plot(kind='kde')`` now accepts the optional parameters ``bw_method`` and
``ind``, passed to scipy.stats.gaussian_kde() (for scipy >= 0.11.0) to set
the bandwidth, and to gkde.evaluate() to specify the indicies at which it
diff --git a/pandas/io/html.py b/pandas/io/html.py
index f3cfa3a16807a..c7e7210247c8d 100644
--- a/pandas/io/html.py
+++ b/pandas/io/html.py
@@ -165,13 +165,15 @@ class _HtmlFrameParser(object):
See each method's respective documentation for details on their
functionality.
"""
- def __init__(self, io, match, attrs):
+ def __init__(self, io, match, attrs, xpath):
self.io = io
self.match = match
self.attrs = attrs
+ self.xpath = xpath
def parse_tables(self):
- tables = self._parse_tables(self._build_doc(), self.match, self.attrs)
+ tables = self._parse_tables(self._build_doc(), self.match, self.attrs,
+ self.xpath)
return (self._build_table(table) for table in tables)
def _parse_raw_data(self, rows):
@@ -227,7 +229,7 @@ def _parse_td(self, obj):
"""
raise NotImplementedError
- def _parse_tables(self, doc, match, attrs):
+ def _parse_tables(self, doc, match, attrs, xpath):
"""Return all tables from the parsed DOM.
Parameters
@@ -242,6 +244,9 @@ def _parse_tables(self, doc, match, attrs):
A dictionary of table attributes that can be used to disambiguate
mutliple tables on a page.
+ xpath : str or None
+ An XPath style string used to filter for tables to be returned.
+
Raises
------
ValueError
@@ -393,7 +398,7 @@ def _parse_tbody(self, table):
def _parse_tfoot(self, table):
return table.find_all('tfoot')
- def _parse_tables(self, doc, match, attrs):
+ def _parse_tables(self, doc, match, attrs, xpath):
element_name = self._strainer.name
tables = doc.find_all(element_name, attrs=attrs)
@@ -481,24 +486,36 @@ def _parse_tr(self, table):
expr = './/tr[normalize-space()]'
return table.xpath(expr)
- def _parse_tables(self, doc, match, kwargs):
- pattern = match.pattern
+ def _parse_tables(self, doc, match, kwargs, xpath):
+ if xpath:
+ xpath_expr = xpath
+ tables = doc.xpath(xpath_expr)
- # 1. check all descendants for the given pattern and only search tables
- # 2. go up the tree until we find a table
- query = '//table//*[re:test(text(), %r)]/ancestor::table'
- xpath_expr = u(query) % pattern
+ if not all(table.tag == 'table' for table in tables):
+ raise ValueError("XPath expression %r matched non-table elements" % xpath)
- # if any table attributes were given build an xpath expression to
- # search for them
- if kwargs:
- xpath_expr += _build_xpath_expr(kwargs)
+ if not tables:
+ raise ValueError("No tables found using XPath expression %r" % xpath)
+ return tables
- tables = doc.xpath(xpath_expr, namespaces=_re_namespace)
+ else:
+ pattern = match.pattern
- if not tables:
- raise ValueError("No tables found matching regex %r" % pattern)
- return tables
+ # 1. check all descendants for the given pattern and only search tables
+ # 2. go up the tree until we find a table
+ query = '//table//*[re:test(text(), %r)]/ancestor::table'
+ xpath_expr = u(query) % pattern
+
+ # if any table attributes were given build an xpath expression to
+ # search for them
+ if kwargs:
+ xpath_expr += _build_xpath_expr(kwargs)
+
+ tables = doc.xpath(xpath_expr, namespaces=_re_namespace)
+
+ if not tables:
+ raise ValueError("No tables found matching regex %r" % pattern)
+ return tables
def _build_doc(self):
"""
@@ -688,15 +705,22 @@ def _validate_flavor(flavor):
def _parse(flavor, io, match, header, index_col, skiprows, infer_types,
- parse_dates, tupleize_cols, thousands, attrs):
+ parse_dates, tupleize_cols, thousands, attrs, xpath):
flavor = _validate_flavor(flavor)
compiled_match = re.compile(match) # you can pass a compiled regex here
+ if xpath and not _HAS_LXML:
+ raise ValueError("XPath table selection needs the lxml module, "
+ "please install it.")
+
# hack around python 3 deleting the exception variable
retained = None
for flav in flavor:
parser = _parser_dispatch(flav)
- p = parser(io, compiled_match, attrs)
+ if xpath and flav in ('bs4', 'html5lib'):
+ raise NotImplementedError
+
+ p = parser(io, compiled_match, attrs, xpath)
try:
tables = p.parse_tables()
@@ -714,7 +738,7 @@ def _parse(flavor, io, match, header, index_col, skiprows, infer_types,
def read_html(io, match='.+', flavor=None, header=None, index_col=None,
skiprows=None, infer_types=None, attrs=None, parse_dates=False,
- tupleize_cols=False, thousands=','):
+ tupleize_cols=False, thousands=',', xpath=None):
r"""Read HTML tables into a ``list`` of ``DataFrame`` objects.
Parameters
@@ -795,6 +819,12 @@ def read_html(io, match='.+', flavor=None, header=None, index_col=None,
thousands : str, optional
Separator to use to parse thousands. Defaults to ``','``.
+ xpath : str or None, optional
+ If not ``None`` try to identify the set of tables to be read by an
+ XPath string; takes precedence over ``match``. Defaults to ``None``.
+ Note: This functionality is not (yet) available with the Beautiful Soup
+ parser (``flavor=bs4``).
+
Returns
-------
dfs : list of DataFrames
@@ -840,4 +870,4 @@ def read_html(io, match='.+', flavor=None, header=None, index_col=None,
raise ValueError('cannot skip rows starting from the end of the '
'data (you passed a negative value)')
return _parse(flavor, io, match, header, index_col, skiprows, infer_types,
- parse_dates, tupleize_cols, thousands, attrs)
+ parse_dates, tupleize_cols, thousands, attrs, xpath)
diff --git a/pandas/io/tests/test_html.py b/pandas/io/tests/test_html.py
index c26048d4cf20b..8fced1fbbda0b 100644
--- a/pandas/io/tests/test_html.py
+++ b/pandas/io/tests/test_html.py
@@ -18,6 +18,11 @@
from numpy.random import rand
from numpy.testing.decorators import slow
+try:
+ from lxml.etree import XPathEvalError
+except ImportError:
+ pass
+
from pandas import (DataFrame, MultiIndex, read_csv, Timestamp, Index,
date_range, Series)
from pandas.compat import map, zip, StringIO, string_types
@@ -581,12 +586,28 @@ def test_parse_dates_combine(self):
newdf = DataFrame({'datetime': raw_dates})
tm.assert_frame_equal(newdf, res[0])
+ def test_xpath_bs4_not_implemented(self):
+ with open(self.spam_data) as f:
+ with self.assertRaises(NotImplementedError):
+ self.read_html(f, flavor='bs4',
+ xpath="//div[@class='garbage']/table")
+
class TestReadHtmlLxml(unittest.TestCase):
@classmethod
def setUpClass(cls):
_skip_if_no('lxml')
+ def setup_data(self):
+ self.valid_data = os.path.join(DATA_PATH, 'valid_markup.html')
+
+ def setup_flavor(self):
+ self.flavor = 'lxml'
+
+ def setUp(self):
+ self.setup_data()
+ self.setup_flavor()
+
def read_html(self, *args, **kwargs):
self.flavor = ['lxml']
kwargs['flavor'] = kwargs.get('flavor', self.flavor)
@@ -630,6 +651,69 @@ def test_parse_dates_combine(self):
newdf = DataFrame({'datetime': raw_dates})
tm.assert_frame_equal(newdf, res[0])
+ def test_attrs_file_like(self):
+ with open(self.valid_data) as f:
+ dfs = self.read_html(f,
+ attrs={'class': 'dataframe'})
+
+ tm.assert_isinstance(dfs, list)
+ for df in dfs:
+ tm.assert_isinstance(df, DataFrame)
+
+ def test_match_no_match(self):
+ with open(self.valid_data) as f:
+ with self.assertRaises(ValueError):
+ dfs = self.read_html(f,
+ match='supercalifragilistic')
+
+ def test_xpath_file_like(self):
+ with open(self.valid_data) as f:
+ dfs = self.read_html(f,
+ xpath="//table[@class='dataframe']")
+
+ tm.assert_isinstance(dfs, list)
+ for df in dfs:
+ tm.assert_isinstance(df, DataFrame)
+
+ @slow
+ def test_xpath_file_url(self):
+ url = self.valid_data
+ dfs = self.read_html(file_path_to_url(url),
+ xpath="//*[@class='dataframe']")
+ tm.assert_isinstance(dfs, list)
+ for df in dfs:
+ tm.assert_isinstance(df, DataFrame)
+
+ def test_xpath_direct_ref(self):
+ with open(self.valid_data) as f:
+ dfs = self.read_html(f,
+ xpath="//html/body/table[@class='dataframe']"
+ "[last()]")
+ assert dfs[0].shape == (2, 3)
+
+ def test_xpath_match_multiple(self):
+ with open(self.valid_data) as f:
+ dfs = self.read_html(f,
+ xpath="//*[@class='dataframe']")
+
+ assert len(dfs) == 2
+
+ def test_xpath_match_none(self):
+ with open(self.valid_data) as f:
+ with self.assertRaises(ValueError):
+ self.read_html(f, xpath="//div[@class='garbage']/table")
+
+ def test_xpath_not_all_tables(self):
+ with open(self.valid_data) as f:
+ with self.assertRaises(ValueError):
+ self.read_html(f,
+ xpath="//tr")
+
+ def test_invalid_xpath(self):
+ with open(self.valid_data) as f:
+ with self.assertRaises(XPathEvalError):
+ self.read_html(f, xpath="//div[@@class=garbage]/table")
+
def test_invalid_flavor():
url = 'google.com'
| First tentative PR as discussed in #5389
| https://api.github.com/repos/pandas-dev/pandas/pulls/5416 | 2013-11-02T19:15:04Z | 2014-01-01T03:01:53Z | null | 2014-07-19T02:25:03Z |
BUG: to_timedelta of a scalar returns a scalar, closes #5410. | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 79fbc1a6cbb54..4b33c20424b33 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -770,6 +770,7 @@ Bug Fixes
and DataFrames that have repeated (non-unique) indices. (:issue:`4620`)
- Fix empty series not printing name in repr (:issue:`4651`)
- Make tests create temp files in temp directory by default. (:issue:`5419`)
+ - ``pd.to_timedelta`` of a scalar returns a scalar (:issue:`5410`)
pandas 0.12.0
-------------
diff --git a/pandas/tests/test_series.py b/pandas/tests/test_series.py
index fd9fb0ef0d79a..e5186cb3030ff 100644
--- a/pandas/tests/test_series.py
+++ b/pandas/tests/test_series.py
@@ -2314,6 +2314,25 @@ def test_timedelta64_operations_with_timedeltas(self):
# roundtrip
assert_series_equal(result + td2,td1)
+ # Now again, using pd.to_timedelta, which should build
+ # a Series or a scalar, depending on input.
+ if not _np_version_under1p7:
+ td1 = Series(pd.to_timedelta(['00:05:03'] * 3))
+ td2 = pd.to_timedelta('00:05:04')
+ result = td1 - td2
+ expected = Series([timedelta(seconds=0)] * 3) -Series(
+ [timedelta(seconds=1)] * 3)
+ self.assert_(result.dtype == 'm8[ns]')
+ assert_series_equal(result, expected)
+
+ result2 = td2 - td1
+ expected = (Series([timedelta(seconds=1)] * 3) -
+ Series([timedelta(seconds=0)] * 3))
+ assert_series_equal(result2, expected)
+
+ # roundtrip
+ assert_series_equal(result + td2,td1)
+
def test_timedelta64_operations_with_integers(self):
# GH 4521
diff --git a/pandas/tseries/tests/test_timedeltas.py b/pandas/tseries/tests/test_timedeltas.py
index 64e5728f0f549..199ad19986b39 100644
--- a/pandas/tseries/tests/test_timedeltas.py
+++ b/pandas/tseries/tests/test_timedeltas.py
@@ -180,17 +180,20 @@ def test_timedelta_ops(self):
s = Series([Timestamp('20130101') + timedelta(seconds=i*i) for i in range(10) ])
td = s.diff()
- result = td.mean()
+ result = td.mean()[0]
+ # TODO This should have returned a scalar to begin with. Hack for now.
expected = to_timedelta(timedelta(seconds=9))
- tm.assert_series_equal(result, expected)
+ tm.assert_almost_equal(result, expected)
result = td.quantile(.1)
+ # This properly returned a scalar.
expected = to_timedelta('00:00:02.6')
- tm.assert_series_equal(result, expected)
+ tm.assert_almost_equal(result, expected)
- result = td.median()
+ result = td.median()[0]
+ # TODO This should have returned a scalar to begin with. Hack for now.
expected = to_timedelta('00:00:08')
- tm.assert_series_equal(result, expected)
+ tm.assert_almost_equal(result, expected)
if __name__ == '__main__':
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
diff --git a/pandas/tseries/timedeltas.py b/pandas/tseries/timedeltas.py
index 24e4b1377cc45..862dc8d410996 100644
--- a/pandas/tseries/timedeltas.py
+++ b/pandas/tseries/timedeltas.py
@@ -58,7 +58,8 @@ def _convert_listlike(arg, box):
elif is_list_like(arg):
return _convert_listlike(arg, box=box)
- return _convert_listlike([ arg ], box=box)
+ # ...so it must be a scalar value. Return scalar.
+ return _coerce_scalar_to_timedelta_type(arg, unit=unit)
_short_search = re.compile(
"^\s*(?P<neg>-?)\s*(?P<value>\d*\.?\d*)\s*(?P<unit>d|s|ms|us|ns)?\s*$",re.IGNORECASE)
| closes #5410
| https://api.github.com/repos/pandas-dev/pandas/pulls/5415 | 2013-11-02T12:55:39Z | 2013-11-04T21:19:02Z | 2013-11-04T21:19:02Z | 2014-06-20T16:34:01Z |
ENH/BUG: pass formatting params thru to `to_csv` | diff --git a/doc/source/io.rst b/doc/source/io.rst
index 7b7b0e745872a..ac2cabe009694 100644
--- a/doc/source/io.rst
+++ b/doc/source/io.rst
@@ -1036,8 +1036,10 @@ The Series and DataFrame objects have an instance method ``to_csv`` which
allows storing the contents of the object as a comma-separated-values file. The
function takes a number of arguments. Only the first is required.
- - ``path``: A string path to the file to write
+ - ``path_or_buf``: A string path to the file to write or a StringIO
+ - ``sep`` : Field delimiter for the output file (default ",")
- ``na_rep``: A string representation of a missing value (default '')
+ - ``float_format``: Format string for floating point numbers
- ``cols``: Columns to write (default None)
- ``header``: Whether to write out the column names (default True)
- ``index``: whether to write row (index) names (default True)
@@ -1045,11 +1047,18 @@ function takes a number of arguments. Only the first is required.
(default), and `header` and `index` are True, then the index names are
used. (A sequence should be given if the DataFrame uses MultiIndex).
- ``mode`` : Python write mode, default 'w'
- - ``sep`` : Field delimiter for the output file (default ",")
- ``encoding``: a string representing the encoding to use if the contents are
non-ascii, for python versions prior to 3
- - ``tupleize_cols``: boolean, default False, if False, write as a list of tuples,
- otherwise write in an expanded line format suitable for ``read_csv``
+ - ``line_terminator``: Character sequence denoting line end (default '\\n')
+ - ``quoting``: Set quoting rules as in csv module (default csv.QUOTE_MINIMAL)
+ - ``quotechar``: Character used to quote fields (default '"')
+ - ``doublequote``: Control quoting of ``quotechar`` in fields (default True)
+ - ``escapechar``: Character used to escape ``sep`` and ``quotechar`` when
+ appropriate (default None)
+ - ``chunksize``: Number of rows to write at a time
+ - ``tupleize_cols``: If False (default), write as a list of tuples, otherwise
+ write in an expanded line format suitable for ``read_csv``
+ - ``date_format``: Format string for datetime objects
Writing a formatted string
~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/doc/source/release.rst b/doc/source/release.rst
index 8b753abc83ca7..2440c8651006e 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -85,7 +85,8 @@ Improvements to existing features
- Performance improvement in indexing into a multi-indexed Series (:issue:`5567`)
- Testing statements updated to use specialized asserts (:issue: `6175`)
- ``Series.rank()`` now has a percentage rank option (:issue: `5971`)
-
+- ``quotechar``, ``doublequote``, and ``escapechar`` can now be specified when
+ using ``DataFrame.to_csv`` (:issue:`5414`, :issue:`4528`)
.. _release.bug_fixes-0.14.0:
diff --git a/doc/source/v0.14.0.txt b/doc/source/v0.14.0.txt
index 597067609bf7f..58ae5084c4827 100644
--- a/doc/source/v0.14.0.txt
+++ b/doc/source/v0.14.0.txt
@@ -179,6 +179,9 @@ Enhancements
household.join(portfolio, how='inner')
+- ``quotechar``, ``doublequote``, and ``escapechar`` can now be specified when
+ using ``DataFrame.to_csv`` (:issue:`5414`, :issue:`4528`)
+
Performance
~~~~~~~~~~~
diff --git a/pandas/core/format.py b/pandas/core/format.py
index f452ee11ae84f..04413970440b9 100644
--- a/pandas/core/format.py
+++ b/pandas/core/format.py
@@ -947,7 +947,8 @@ def __init__(self, obj, path_or_buf, sep=",", na_rep='', float_format=None,
cols=None, header=True, index=True, index_label=None,
mode='w', nanRep=None, encoding=None, quoting=None,
line_terminator='\n', chunksize=None, engine=None,
- tupleize_cols=False, quotechar='"', date_format=None):
+ tupleize_cols=False, quotechar='"', date_format=None,
+ doublequote=True, escapechar=None):
self.engine = engine # remove for 0.13
self.obj = obj
@@ -972,6 +973,9 @@ def __init__(self, obj, path_or_buf, sep=",", na_rep='', float_format=None,
quotechar = None
self.quotechar = quotechar
+ self.doublequote = doublequote
+ self.escapechar = escapechar
+
self.line_terminator = line_terminator
self.date_format = date_format
@@ -1151,6 +1155,8 @@ def save(self):
try:
writer_kwargs = dict(lineterminator=self.line_terminator,
delimiter=self.sep, quoting=self.quoting,
+ doublequote=self.doublequote,
+ escapechar=self.escapechar,
quotechar=self.quotechar)
if self.encoding is not None:
writer_kwargs['encoding'] = self.encoding
diff --git a/pandas/core/frame.py b/pandas/core/frame.py
index 9f9af187d21dd..e66e09624a04f 100644
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -1070,8 +1070,9 @@ def to_panel(self):
def to_csv(self, path_or_buf, sep=",", na_rep='', float_format=None,
cols=None, header=True, index=True, index_label=None,
mode='w', nanRep=None, encoding=None, quoting=None,
- line_terminator='\n', chunksize=None,
- tupleize_cols=False, date_format=None, **kwds):
+ quotechar='"', line_terminator='\n', chunksize=None,
+ tupleize_cols=False, date_format=None, doublequote=True,
+ escapechar=None, **kwds):
r"""Write DataFrame to a comma-separated values (csv) file
Parameters
@@ -1109,13 +1110,19 @@ def to_csv(self, path_or_buf, sep=",", na_rep='', float_format=None,
file
quoting : optional constant from csv module
defaults to csv.QUOTE_MINIMAL
+ quotechar : string (length 1), default '"'
+ character used to quote fields
+ doublequote : boolean, default True
+ Control quoting of `quotechar` inside a field
+ escapechar : string (length 1), default None
+ character used to escape `sep` and `quotechar` when appropriate
chunksize : int or None
rows to write at a time
tupleize_cols : boolean, default False
write multi_index columns as a list of tuples (if True)
or new (expanded format) if False)
date_format : string, default None
- Format string for datetime objects.
+ Format string for datetime objects
"""
if nanRep is not None: # pragma: no cover
warnings.warn("nanRep is deprecated, use na_rep",
@@ -1129,10 +1136,12 @@ def to_csv(self, path_or_buf, sep=",", na_rep='', float_format=None,
float_format=float_format, cols=cols,
header=header, index=index,
index_label=index_label, mode=mode,
- chunksize=chunksize, engine=kwds.get(
- "engine"),
+ chunksize=chunksize, quotechar=quotechar,
+ engine=kwds.get("engine"),
tupleize_cols=tupleize_cols,
- date_format=date_format)
+ date_format=date_format,
+ doublequote=doublequote,
+ escapechar=escapechar)
formatter.save()
def to_excel(self, excel_writer, sheet_name='Sheet1', na_rep='',
diff --git a/pandas/io/parsers.py b/pandas/io/parsers.py
index 6b0d56b5c383e..e7d9145aa9d68 100644
--- a/pandas/io/parsers.py
+++ b/pandas/io/parsers.py
@@ -46,7 +46,8 @@
Default (None) results in QUOTE_MINIMAL behavior.
skipinitialspace : boolean, default False
Skip spaces after delimiter
-escapechar : string
+escapechar : string (length 1), default None
+ One-character string used to escape delimiter when quoting is QUOTE_NONE.
dtype : Type name or dict of column -> type
Data type for data or columns. E.g. {'a': np.float64, 'b': np.int32}
compression : {'gzip', 'bz2', None}, default None
diff --git a/pandas/tests/test_format.py b/pandas/tests/test_format.py
index a0fd992b3a532..ac42266b3c4eb 100644
--- a/pandas/tests/test_format.py
+++ b/pandas/tests/test_format.py
@@ -1669,10 +1669,10 @@ def test_to_latex(self):
\end{tabular}
"""
self.assertEqual(withoutindex_result, withoutindex_expected)
-
+
def test_to_latex_escape_special_chars(self):
special_characters = ['&','%','$','#','_',
- '{','}','~','^','\\']
+ '{','}','~','^','\\']
df = DataFrame(data=special_characters)
observed = df.to_latex()
expected = r"""\begin{tabular}{ll}
@@ -1694,6 +1694,99 @@ def test_to_latex_escape_special_chars(self):
"""
self.assertEqual(observed, expected)
+ def test_to_csv_quotechar(self):
+ df = DataFrame({'col' : [1,2]})
+ expected = """\
+"","col"
+"0","1"
+"1","2"
+"""
+ with tm.ensure_clean('test.csv') as path:
+ df.to_csv(path, quoting=1) # 1=QUOTE_ALL
+ with open(path, 'r') as f:
+ self.assertEqual(f.read(), expected)
+ with tm.ensure_clean('test.csv') as path:
+ df.to_csv(path, quoting=1, engine='python')
+ with open(path, 'r') as f:
+ self.assertEqual(f.read(), expected)
+
+ expected = """\
+$$,$col$
+$0$,$1$
+$1$,$2$
+"""
+ with tm.ensure_clean('test.csv') as path:
+ df.to_csv(path, quoting=1, quotechar="$")
+ with open(path, 'r') as f:
+ self.assertEqual(f.read(), expected)
+ with tm.ensure_clean('test.csv') as path:
+ df.to_csv(path, quoting=1, quotechar="$", engine='python')
+ with open(path, 'r') as f:
+ self.assertEqual(f.read(), expected)
+
+ with tm.ensure_clean('test.csv') as path:
+ with tm.assertRaisesRegexp(TypeError, 'quotechar'):
+ df.to_csv(path, quoting=1, quotechar=None)
+ with tm.ensure_clean('test.csv') as path:
+ with tm.assertRaisesRegexp(TypeError, 'quotechar'):
+ df.to_csv(path, quoting=1, quotechar=None, engine='python')
+
+ def test_to_csv_doublequote(self):
+ df = DataFrame({'col' : ['a"a', '"bb"']})
+ expected = '''\
+"","col"
+"0","a""a"
+"1","""bb"""
+'''
+ with tm.ensure_clean('test.csv') as path:
+ df.to_csv(path, quoting=1, doublequote=True) # QUOTE_ALL
+ with open(path, 'r') as f:
+ self.assertEqual(f.read(), expected)
+ with tm.ensure_clean('test.csv') as path:
+ df.to_csv(path, quoting=1, doublequote=True, engine='python')
+ with open(path, 'r') as f:
+ self.assertEqual(f.read(), expected)
+
+ from _csv import Error
+ with tm.ensure_clean('test.csv') as path:
+ with tm.assertRaisesRegexp(Error, 'escapechar'):
+ df.to_csv(path, doublequote=False) # no escapechar set
+ with tm.ensure_clean('test.csv') as path:
+ with tm.assertRaisesRegexp(Error, 'escapechar'):
+ df.to_csv(path, doublequote=False, engine='python')
+
+ def test_to_csv_escapechar(self):
+ df = DataFrame({'col' : ['a"a', '"bb"']})
+ expected = """\
+"","col"
+"0","a\\"a"
+"1","\\"bb\\""
+"""
+ with tm.ensure_clean('test.csv') as path: # QUOTE_ALL
+ df.to_csv(path, quoting=1, doublequote=False, escapechar='\\')
+ with open(path, 'r') as f:
+ self.assertEqual(f.read(), expected)
+ with tm.ensure_clean('test.csv') as path:
+ df.to_csv(path, quoting=1, doublequote=False, escapechar='\\',
+ engine='python')
+ with open(path, 'r') as f:
+ self.assertEqual(f.read(), expected)
+
+ df = DataFrame({'col' : ['a,a', ',bb,']})
+ expected = """\
+,col
+0,a\\,a
+1,\\,bb\\,
+"""
+ with tm.ensure_clean('test.csv') as path:
+ df.to_csv(path, quoting=3, escapechar='\\') # QUOTE_NONE
+ with open(path, 'r') as f:
+ self.assertEqual(f.read(), expected)
+ with tm.ensure_clean('test.csv') as path:
+ df.to_csv(path, quoting=3, escapechar='\\', engine='python')
+ with open(path, 'r') as f:
+ self.assertEqual(f.read(), expected)
+
class TestSeriesFormatting(tm.TestCase):
_multiprocess_can_split_ = True
| Add support for passing remaining `csv.writer` formatting parameters thru to `DataFrame.to_csv()`.
Maybe write tests for this? That much is over my head currently.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5414 | 2013-11-02T01:32:10Z | 2014-02-17T14:19:06Z | 2014-02-17T14:19:06Z | 2014-06-14T17:02:45Z |
BLD: numpy 1.8 on the 3.3/2.7 builds | diff --git a/ci/requirements-2.7.txt b/ci/requirements-2.7.txt
index 3b786152cd653..705aa9e3cc922 100644
--- a/ci/requirements-2.7.txt
+++ b/ci/requirements-2.7.txt
@@ -1,7 +1,7 @@
python-dateutil==2.1
pytz==2013b
xlwt==0.7.5
-numpy==1.7.1
+numpy==1.8.0
cython==0.19.1
bottleneck==0.6.0
numexpr==2.1
diff --git a/ci/requirements-3.2.txt b/ci/requirements-3.2.txt
index b44a708c4fffc..0f3bdcbac38cb 100644
--- a/ci/requirements-3.2.txt
+++ b/ci/requirements-3.2.txt
@@ -3,7 +3,7 @@ pytz==2013b
openpyxl==1.6.2
xlsxwriter==0.4.3
xlrd==0.9.2
-numpy==1.6.2
+numpy==1.7.1
cython==0.19.1
numexpr==2.1
tables==3.0.0
diff --git a/ci/requirements-3.3.txt b/ci/requirements-3.3.txt
index 94a77bbc06024..3ca888d1623e3 100644
--- a/ci/requirements-3.3.txt
+++ b/ci/requirements-3.3.txt
@@ -4,7 +4,7 @@ openpyxl==1.6.2
xlsxwriter==0.4.3
xlrd==0.9.2
html5lib==1.0b2
-numpy==1.7.1
+numpy==1.8.0
cython==0.19.1
numexpr==2.1
tables==3.0.0
| close #5412
still pretty good coverage of all numpys
build take a tad longer w/o the wheels
| https://api.github.com/repos/pandas-dev/pandas/pulls/5413 | 2013-11-01T22:51:05Z | 2013-11-02T23:54:38Z | 2013-11-02T23:54:38Z | 2014-06-23T21:43:09Z |
BLD: dateutil-2.2 patch | diff --git a/ci/requirements-3.3.txt b/ci/requirements-3.3.txt
index 318030e733158..94a77bbc06024 100644
--- a/ci/requirements-3.3.txt
+++ b/ci/requirements-3.3.txt
@@ -1,4 +1,4 @@
-python-dateutil==2.1
+python-dateutil==2.2
pytz==2013b
openpyxl==1.6.2
xlsxwriter==0.4.3
diff --git a/pandas/tseries/tools.py b/pandas/tseries/tools.py
index 3d8803237931d..af1a31bcec311 100644
--- a/pandas/tseries/tools.py
+++ b/pandas/tseries/tools.py
@@ -305,6 +305,10 @@ def dateutil_parse(timestr, default,
res = DEFAULTPARSER._parse(fobj, **kwargs)
+ # dateutil 2.2 compat
+ if isinstance(res, tuple):
+ res, _ = res
+
if res is None:
raise ValueError("unknown string format")
| close #5409
| https://api.github.com/repos/pandas-dev/pandas/pulls/5411 | 2013-11-01T22:13:26Z | 2013-11-01T22:13:32Z | 2013-11-01T22:13:32Z | 2014-07-16T08:38:35Z |
DOC/BUG: fix details for 'quoting' parser parameter | diff --git a/pandas/io/parsers.py b/pandas/io/parsers.py
index 52d4e6bbac50a..796475aa24a58 100644
--- a/pandas/io/parsers.py
+++ b/pandas/io/parsers.py
@@ -36,13 +36,13 @@
%s
lineterminator : string (length 1), default None
Character to break file into lines. Only valid with C parser
-quotechar : string
- The character to used to denote the start and end of a quoted item. Quoted
+quotechar : string (length 1)
+ The character used to denote the start and end of a quoted item. Quoted
items can include the delimiter and it will be ignored.
-quoting : int
- Controls whether quotes should be recognized. Values are taken from
- `csv.QUOTE_*` values. Acceptable values are 0, 1, 2, and 3 for
- QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONE, and QUOTE_NONNUMERIC, respectively.
+quoting : int or csv.QUOTE_* instance, default None
+ Control field quoting behavior per ``csv.QUOTE_*`` constants. Use one of
+ QUOTE_MINIMAL (0), QUOTE_ALL (1), QUOTE_NONNUMERIC (2) or QUOTE_NONE (3).
+ Default (None) results in QUOTE_MINIMAL behavior.
skipinitialspace : boolean, default False
Skip spaces after delimiter
escapechar : string
| ``` python
Python 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Imported NumPy 1.7.1, SciPy 0.12.0, Matplotlib 1.3.0 + guidata 1.6.1, guiqwt 2.3.1
Type "scientific" for more details.
>>> from csv import QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONNUMERIC, QUOTE_NONE
>>> QUOTE_MINIMAL
0
>>> QUOTE_ALL
1
>>> QUOTE_NONNUMERIC
2
>>> QUOTE_NONE
3
>>>
```
| https://api.github.com/repos/pandas-dev/pandas/pulls/5408 | 2013-11-01T21:00:49Z | 2014-01-21T11:46:04Z | 2014-01-21T11:46:04Z | 2014-06-19T13:22:40Z |
Fix Issues with FY5253 and nearest w/ year end in Dec | diff --git a/pandas/tseries/offsets.py b/pandas/tseries/offsets.py
index 8830d66b245ef..b763fc6b11252 100644
--- a/pandas/tseries/offsets.py
+++ b/pandas/tseries/offsets.py
@@ -977,467 +977,154 @@ def onOffset(self, dt):
modMonth = (dt.month - self.startingMonth) % 3
return BMonthEnd().onOffset(dt) and modMonth == 0
-class FY5253(CacheableOffset, DateOffset):
- """
- Describes 52-53 week fiscal year. This is also known as a 4-4-5 calendar.
- It is used by companies that desire that their
- fiscal year always end on the same day of the week.
+_int_to_month = {
+ 1: 'JAN',
+ 2: 'FEB',
+ 3: 'MAR',
+ 4: 'APR',
+ 5: 'MAY',
+ 6: 'JUN',
+ 7: 'JUL',
+ 8: 'AUG',
+ 9: 'SEP',
+ 10: 'OCT',
+ 11: 'NOV',
+ 12: 'DEC'
+}
- It is a method of managing accounting periods.
- It is a common calendar structure for some industries,
- such as retail, manufacturing and parking industry.
+_month_to_int = dict((v, k) for k, v in _int_to_month.items())
- For more information see:
- http://en.wikipedia.org/wiki/4%E2%80%934%E2%80%935_calendar
+# TODO: This is basically the same as BQuarterEnd
+class BQuarterBegin(CacheableOffset, QuarterOffset):
+ _outputName = "BusinessQuarterBegin"
+ # I suspect this is wrong for *all* of them.
+ _default_startingMonth = 3
+ _from_name_startingMonth = 1
+ _prefix = 'BQS'
- The year may either:
- - end on the last X day of the Y month.
- - end on the last X day closest to the last day of the Y month.
+ def apply(self, other):
+ n = self.n
+ other = as_datetime(other)
- X is a specific day of the week.
- Y is a certain month of the year
+ wkday, _ = tslib.monthrange(other.year, other.month)
- Parameters
- ----------
- n : int
- weekday : {0, 1, ..., 6}
- 0: Mondays
- 1: Tuesdays
- 2: Wednesdays
- 3: Thursdays
- 4: Fridays
- 5: Saturdays
- 6: Sundays
- startingMonth : The month in which fiscal years end. {1, 2, ... 12}
- variation : str
- {"nearest", "last"} for "LastOfMonth" or "NearestEndMonth"
- """
+ first = _get_firstbday(wkday)
- _prefix = 'RE'
- _suffix_prefix_last = 'L'
- _suffix_prefix_nearest = 'N'
+ monthsSince = (other.month - self.startingMonth) % 3
- def __init__(self, n=1, **kwds):
- self.n = n
- self.startingMonth = kwds['startingMonth']
- self.weekday = kwds["weekday"]
+ if n <= 0 and monthsSince != 0: # make sure to roll forward so negate
+ monthsSince = monthsSince - 3
- self.variation = kwds["variation"]
+ # roll forward if on same month later than first bday
+ if n <= 0 and (monthsSince == 0 and other.day > first):
+ n = n + 1
+ # pretend to roll back if on same month but before firstbday
+ elif n > 0 and (monthsSince == 0 and other.day < first):
+ n = n - 1
- self.kwds = kwds
+ # get the first bday for result
+ other = other + relativedelta(months=3 * n - monthsSince)
+ wkday, _ = tslib.monthrange(other.year, other.month)
+ first = _get_firstbday(wkday)
+ result = datetime(other.year, other.month, first,
+ other.hour, other.minute, other.second,
+ other.microsecond)
+ return as_timestamp(result)
- if self.n == 0:
- raise ValueError('N cannot be 0')
- if self.variation not in ["nearest", "last"]:
- raise ValueError('%s is not a valid variation' % self.variation)
+class QuarterEnd(CacheableOffset, QuarterOffset):
+ """DateOffset increments between business Quarter dates
+ startingMonth = 1 corresponds to dates like 1/31/2007, 4/30/2007, ...
+ startingMonth = 2 corresponds to dates like 2/28/2007, 5/31/2007, ...
+ startingMonth = 3 corresponds to dates like 3/31/2007, 6/30/2007, ...
+ """
+ _outputName = 'QuarterEnd'
+ _default_startingMonth = 3
+ _prefix = 'Q'
- if self.variation == "nearest":
- self._rd_forward = relativedelta(weekday=weekday(self.weekday))
- self._rd_backward = relativedelta(weekday=weekday(self.weekday)(-1))
- else:
- self._offset_lwom = LastWeekOfMonth(n=1, weekday=self.weekday)
+ def __init__(self, n=1, **kwds):
+ self.n = n
+ self.startingMonth = kwds.get('startingMonth', 3)
- def isAnchored(self):
- return self.n == 1 \
- and self.startingMonth is not None \
- and self.weekday is not None
+ self.kwds = kwds
- def onOffset(self, dt):
- year_end = self.get_year_end(dt)
- return year_end == dt
+ def isAnchored(self):
+ return (self.n == 1 and self.startingMonth is not None)
def apply(self, other):
n = self.n
- if n > 0:
- year_end = self.get_year_end(other)
- if other < year_end:
- other = year_end
- n -= 1
- elif other > year_end:
- other = self.get_year_end(as_datetime(other) + relativedelta(years=1))
- n -= 1
-
- return self.get_year_end(as_datetime(other) + relativedelta(years=n))
- else:
- n = -n
- year_end = self.get_year_end(other)
- if other > year_end:
- other = year_end
- n -= 1
- elif other < year_end:
- other = self.get_year_end(as_datetime(other) + relativedelta(years=-1))
- n -= 1
+ other = as_datetime(other)
- return self.get_year_end(as_datetime(other) + relativedelta(years=-n))
+ wkday, days_in_month = tslib.monthrange(other.year, other.month)
- def get_year_end(self, dt):
- if self.variation == "nearest":
- return self._get_year_end_nearest(dt)
- else:
- return self._get_year_end_last(dt)
+ monthsToGo = 3 - ((other.month - self.startingMonth) % 3)
+ if monthsToGo == 3:
+ monthsToGo = 0
- def get_target_month_end(self, dt):
- target_month = datetime(year=dt.year, month=self.startingMonth, day=1)
- next_month_first_of = target_month + relativedelta(months=+1)
- return next_month_first_of + relativedelta(days=-1)
+ if n > 0 and not (other.day >= days_in_month and monthsToGo == 0):
+ n = n - 1
- def _get_year_end_nearest(self, dt):
- target_date = self.get_target_month_end(dt)
- if target_date.weekday() == self.weekday:
- return target_date
- else:
- forward = target_date + self._rd_forward
- backward = target_date + self._rd_backward
+ other = other + relativedelta(months=monthsToGo + 3 * n, day=31)
- if forward - target_date < target_date - backward:
- return forward
- else:
- return backward
+ return as_timestamp(other)
- def _get_year_end_last(self, dt):
- current_year = datetime(year=dt.year, month=self.startingMonth, day=1)
- return current_year + self._offset_lwom
+ def onOffset(self, dt):
+ modMonth = (dt.month - self.startingMonth) % 3
+ return MonthEnd().onOffset(dt) and modMonth == 0
- @property
- def rule_code(self):
- suffix = self.get_rule_code_suffix()
- return "%s-%s" % (self._get_prefix(), suffix)
- def _get_prefix(self):
- return self._prefix
+class QuarterBegin(CacheableOffset, QuarterOffset):
+ _outputName = 'QuarterBegin'
+ _default_startingMonth = 3
+ _from_name_startingMonth = 1
+ _prefix = 'QS'
- def _get_suffix_prefix(self):
- if self.variation == "nearest":
- return self._suffix_prefix_nearest
- else:
- return self._suffix_prefix_last
+ def isAnchored(self):
+ return (self.n == 1 and self.startingMonth is not None)
- def get_rule_code_suffix(self):
- return '%s-%s-%s' % (self._get_suffix_prefix(), \
- _int_to_month[self.startingMonth], \
- _int_to_weekday[self.weekday])
+ def apply(self, other):
+ n = self.n
+ other = as_datetime(other)
- @classmethod
- def _parse_suffix(cls, varion_code, startingMonth_code, weekday_code):
- if varion_code == "N":
- variation = "nearest"
- elif varion_code == "L":
- variation = "last"
- else:
- raise ValueError("Unable to parse varion_code: %s" % (varion_code,))
+ wkday, days_in_month = tslib.monthrange(other.year, other.month)
- startingMonth = _month_to_int[startingMonth_code]
- weekday = _weekday_to_int[weekday_code]
+ monthsSince = (other.month - self.startingMonth) % 3
- return {
- "weekday":weekday,
- "startingMonth":startingMonth,
- "variation":variation,
- }
+ if n <= 0 and monthsSince != 0:
+ # make sure you roll forward, so negate
+ monthsSince = monthsSince - 3
- @classmethod
- def _from_name(cls, *args):
- return cls(**cls._parse_suffix(*args))
+ if n < 0 and (monthsSince == 0 and other.day > 1):
+ # after start, so come back an extra period as if rolled forward
+ n = n + 1
-class FY5253Quarter(CacheableOffset, DateOffset):
- """
- DateOffset increments between business quarter dates
- for 52-53 week fiscal year (also known as a 4-4-5 calendar).
+ other = other + relativedelta(months=3 * n - monthsSince, day=1)
+ return as_timestamp(other)
- It is used by companies that desire that their
- fiscal year always end on the same day of the week.
- It is a method of managing accounting periods.
- It is a common calendar structure for some industries,
- such as retail, manufacturing and parking industry.
+class YearOffset(DateOffset):
+ """DateOffset that just needs a month"""
- For more information see:
- http://en.wikipedia.org/wiki/4%E2%80%934%E2%80%935_calendar
+ def __init__(self, n=1, **kwds):
+ self.month = kwds.get('month', self._default_month)
- The year may either:
- - end on the last X day of the Y month.
- - end on the last X day closest to the last day of the Y month.
+ if self.month < 1 or self.month > 12:
+ raise ValueError('Month must go from 1 to 12')
- X is a specific day of the week.
- Y is a certain month of the year
+ DateOffset.__init__(self, n=n, **kwds)
- startingMonth = 1 corresponds to dates like 1/31/2007, 4/30/2007, ...
- startingMonth = 2 corresponds to dates like 2/28/2007, 5/31/2007, ...
- startingMonth = 3 corresponds to dates like 3/30/2007, 6/29/2007, ...
+ @classmethod
+ def _from_name(cls, suffix=None):
+ kwargs = {}
+ if suffix:
+ kwargs['month'] = _month_to_int[suffix]
+ return cls(**kwargs)
- Parameters
- ----------
- n : int
- weekday : {0, 1, ..., 6}
- 0: Mondays
- 1: Tuesdays
- 2: Wednesdays
- 3: Thursdays
- 4: Fridays
- 5: Saturdays
- 6: Sundays
- startingMonth : The month in which fiscal years end. {1, 2, ... 12}
- qtr_with_extra_week : The quarter number that has the leap
- or 14 week when needed. {1,2,3,4}
- variation : str
- {"nearest", "last"} for "LastOfMonth" or "NearestEndMonth"
- """
-
- _prefix = 'REQ'
-
- def __init__(self, n=1, **kwds):
- self.n = n
-
- self.qtr_with_extra_week = kwds["qtr_with_extra_week"]
-
- self.kwds = kwds
-
- if self.n == 0:
- raise ValueError('N cannot be 0')
-
- self._offset = FY5253( \
- startingMonth=kwds['startingMonth'], \
- weekday=kwds["weekday"],
- variation=kwds["variation"])
-
- def isAnchored(self):
- return self.n == 1 and self._offset.isAnchored()
-
- def apply(self, other):
- other = as_datetime(other)
- n = self.n
-
- if n > 0:
- while n > 0:
- if not self._offset.onOffset(other):
- qtr_lens = self.get_weeks(other)
- start = other - self._offset
- else:
- start = other
- qtr_lens = self.get_weeks(other + self._offset)
-
- for weeks in qtr_lens:
- start += relativedelta(weeks=weeks)
- if start > other:
- other = start
- n -= 1
- break
-
- else:
- n = -n
- while n > 0:
- if not self._offset.onOffset(other):
- qtr_lens = self.get_weeks(other)
- end = other + self._offset
- else:
- end = other
- qtr_lens = self.get_weeks(other)
-
- for weeks in reversed(qtr_lens):
- end -= relativedelta(weeks=weeks)
- if end < other:
- other = end
- n -= 1
- break
-
- return other
-
- def get_weeks(self, dt):
- ret = [13] * 4
-
- year_has_extra_week = self.year_has_extra_week(dt)
-
- if year_has_extra_week:
- ret[self.qtr_with_extra_week-1] = 14
-
- return ret
-
- def year_has_extra_week(self, dt):
- if self._offset.onOffset(dt):
- prev_year_end = dt - self._offset
- next_year_end = dt
- else:
- next_year_end = dt + self._offset
- prev_year_end = dt - self._offset
-
- week_in_year = (next_year_end - prev_year_end).days/7
-
- return week_in_year == 53
-
- def onOffset(self, dt):
- if self._offset.onOffset(dt):
- return True
-
- next_year_end = dt - self._offset
-
- qtr_lens = self.get_weeks(dt)
-
- current = next_year_end
- for qtr_len in qtr_lens[0:4]:
- current += relativedelta(weeks=qtr_len)
- if dt == current:
- return True
- return False
-
- @property
- def rule_code(self):
- suffix = self._offset.get_rule_code_suffix()
- return "%s-%s" %(self._prefix, "%s-%d" % (suffix, self.qtr_with_extra_week))
-
- @classmethod
- def _from_name(cls, *args):
- return cls(**dict(FY5253._parse_suffix(*args[:-1]), qtr_with_extra_week=int(args[-1])))
-
-_int_to_month = {
- 1: 'JAN',
- 2: 'FEB',
- 3: 'MAR',
- 4: 'APR',
- 5: 'MAY',
- 6: 'JUN',
- 7: 'JUL',
- 8: 'AUG',
- 9: 'SEP',
- 10: 'OCT',
- 11: 'NOV',
- 12: 'DEC'
-}
-
-_month_to_int = dict((v, k) for k, v in _int_to_month.items())
-
-
-# TODO: This is basically the same as BQuarterEnd
-class BQuarterBegin(CacheableOffset, QuarterOffset):
- _outputName = "BusinessQuarterBegin"
- # I suspect this is wrong for *all* of them.
- _default_startingMonth = 3
- _from_name_startingMonth = 1
- _prefix = 'BQS'
-
- def apply(self, other):
- n = self.n
- other = as_datetime(other)
-
- wkday, _ = tslib.monthrange(other.year, other.month)
-
- first = _get_firstbday(wkday)
-
- monthsSince = (other.month - self.startingMonth) % 3
-
- if n <= 0 and monthsSince != 0: # make sure to roll forward so negate
- monthsSince = monthsSince - 3
-
- # roll forward if on same month later than first bday
- if n <= 0 and (monthsSince == 0 and other.day > first):
- n = n + 1
- # pretend to roll back if on same month but before firstbday
- elif n > 0 and (monthsSince == 0 and other.day < first):
- n = n - 1
-
- # get the first bday for result
- other = other + relativedelta(months=3 * n - monthsSince)
- wkday, _ = tslib.monthrange(other.year, other.month)
- first = _get_firstbday(wkday)
- result = datetime(other.year, other.month, first,
- other.hour, other.minute, other.second,
- other.microsecond)
- return as_timestamp(result)
-
-
-class QuarterEnd(CacheableOffset, QuarterOffset):
- """DateOffset increments between business Quarter dates
- startingMonth = 1 corresponds to dates like 1/31/2007, 4/30/2007, ...
- startingMonth = 2 corresponds to dates like 2/28/2007, 5/31/2007, ...
- startingMonth = 3 corresponds to dates like 3/31/2007, 6/30/2007, ...
- """
- _outputName = 'QuarterEnd'
- _default_startingMonth = 3
- _prefix = 'Q'
-
- def __init__(self, n=1, **kwds):
- self.n = n
- self.startingMonth = kwds.get('startingMonth', 3)
-
- self.kwds = kwds
-
- def isAnchored(self):
- return (self.n == 1 and self.startingMonth is not None)
-
- def apply(self, other):
- n = self.n
- other = as_datetime(other)
-
- wkday, days_in_month = tslib.monthrange(other.year, other.month)
-
- monthsToGo = 3 - ((other.month - self.startingMonth) % 3)
- if monthsToGo == 3:
- monthsToGo = 0
-
- if n > 0 and not (other.day >= days_in_month and monthsToGo == 0):
- n = n - 1
-
- other = other + relativedelta(months=monthsToGo + 3 * n, day=31)
-
- return as_timestamp(other)
-
- def onOffset(self, dt):
- modMonth = (dt.month - self.startingMonth) % 3
- return MonthEnd().onOffset(dt) and modMonth == 0
-
-
-class QuarterBegin(CacheableOffset, QuarterOffset):
- _outputName = 'QuarterBegin'
- _default_startingMonth = 3
- _from_name_startingMonth = 1
- _prefix = 'QS'
-
- def isAnchored(self):
- return (self.n == 1 and self.startingMonth is not None)
-
- def apply(self, other):
- n = self.n
- other = as_datetime(other)
-
- wkday, days_in_month = tslib.monthrange(other.year, other.month)
-
- monthsSince = (other.month - self.startingMonth) % 3
-
- if n <= 0 and monthsSince != 0:
- # make sure you roll forward, so negate
- monthsSince = monthsSince - 3
-
- if n < 0 and (monthsSince == 0 and other.day > 1):
- # after start, so come back an extra period as if rolled forward
- n = n + 1
-
- other = other + relativedelta(months=3 * n - monthsSince, day=1)
- return as_timestamp(other)
-
-
-class YearOffset(DateOffset):
- """DateOffset that just needs a month"""
-
- def __init__(self, n=1, **kwds):
- self.month = kwds.get('month', self._default_month)
-
- if self.month < 1 or self.month > 12:
- raise ValueError('Month must go from 1 to 12')
-
- DateOffset.__init__(self, n=n, **kwds)
-
- @classmethod
- def _from_name(cls, suffix=None):
- kwargs = {}
- if suffix:
- kwargs['month'] = _month_to_int[suffix]
- return cls(**kwargs)
-
- @property
- def rule_code(self):
- return '%s-%s' % (self._prefix, _int_to_month[self.month])
+ @property
+ def rule_code(self):
+ return '%s-%s' % (self._prefix, _int_to_month[self.month])
class BYearEnd(CacheableOffset, YearOffset):
@@ -1611,6 +1298,359 @@ def onOffset(self, dt):
return dt.month == self.month and dt.day == 1
+class FY5253(CacheableOffset, DateOffset):
+ """
+ Describes 52-53 week fiscal year. This is also known as a 4-4-5 calendar.
+
+ It is used by companies that desire that their
+ fiscal year always end on the same day of the week.
+
+ It is a method of managing accounting periods.
+ It is a common calendar structure for some industries,
+ such as retail, manufacturing and parking industry.
+
+ For more information see:
+ http://en.wikipedia.org/wiki/4%E2%80%934%E2%80%935_calendar
+
+
+ The year may either:
+ - end on the last X day of the Y month.
+ - end on the last X day closest to the last day of the Y month.
+
+ X is a specific day of the week.
+ Y is a certain month of the year
+
+ Parameters
+ ----------
+ n : int
+ weekday : {0, 1, ..., 6}
+ 0: Mondays
+ 1: Tuesdays
+ 2: Wednesdays
+ 3: Thursdays
+ 4: Fridays
+ 5: Saturdays
+ 6: Sundays
+ startingMonth : The month in which fiscal years end. {1, 2, ... 12}
+ variation : str
+ {"nearest", "last"} for "LastOfMonth" or "NearestEndMonth"
+ """
+
+ _prefix = 'RE'
+ _suffix_prefix_last = 'L'
+ _suffix_prefix_nearest = 'N'
+
+ def __init__(self, n=1, **kwds):
+ self.n = n
+ self.startingMonth = kwds['startingMonth']
+ self.weekday = kwds["weekday"]
+
+ self.variation = kwds["variation"]
+
+ self.kwds = kwds
+
+ if self.n == 0:
+ raise ValueError('N cannot be 0')
+
+ if self.variation not in ["nearest", "last"]:
+ raise ValueError('%s is not a valid variation' % self.variation)
+
+ if self.variation == "nearest":
+ weekday_offset = weekday(self.weekday)
+ self._rd_forward = relativedelta(weekday=weekday_offset)
+ self._rd_backward = relativedelta(weekday=weekday_offset(-1))
+ else:
+ self._offset_lwom = LastWeekOfMonth(n=1, weekday=self.weekday)
+
+ def isAnchored(self):
+ return self.n == 1 \
+ and self.startingMonth is not None \
+ and self.weekday is not None
+
+ def onOffset(self, dt):
+ year_end = self.get_year_end(dt)
+
+ if self.variation == "nearest":
+ # We have to check the year end of "this" cal year AND the previous
+ return year_end == dt or \
+ self.get_year_end(dt - relativedelta(months=1)) == dt
+ else:
+ return year_end == dt
+
+ def apply(self, other):
+ n = self.n
+ prev_year = self.get_year_end(
+ datetime(other.year - 1, self.startingMonth, 1))
+ cur_year = self.get_year_end(
+ datetime(other.year, self.startingMonth, 1))
+ next_year = self.get_year_end(
+ datetime(other.year + 1, self.startingMonth, 1))
+
+ if n > 0:
+ if other == prev_year:
+ year = other.year - 1
+ elif other == cur_year:
+ year = other.year
+ elif other == next_year:
+ year = other.year + 1
+ elif other < prev_year:
+ year = other.year - 1
+ n -= 1
+ elif other < cur_year:
+ year = other.year
+ n -= 1
+ elif other < next_year:
+ year = other.year + 1
+ n -= 1
+ else:
+ assert False
+
+ return self.get_year_end(datetime(year + n, self.startingMonth, 1))
+ else:
+ n = -n
+ if other == prev_year:
+ year = other.year - 1
+ elif other == cur_year:
+ year = other.year
+ elif other == next_year:
+ year = other.year + 1
+ elif other > next_year:
+ year = other.year + 1
+ n -= 1
+ elif other > cur_year:
+ year = other.year
+ n -= 1
+ elif other > prev_year:
+ year = other.year - 1
+ n -= 1
+ else:
+ assert False
+
+ return self.get_year_end(datetime(year - n, self.startingMonth, 1))
+
+ def get_year_end(self, dt):
+ if self.variation == "nearest":
+ return self._get_year_end_nearest(dt)
+ else:
+ return self._get_year_end_last(dt)
+
+ def get_target_month_end(self, dt):
+ target_month = datetime(year=dt.year, month=self.startingMonth, day=1)
+ next_month_first_of = target_month + relativedelta(months=+1)
+ return next_month_first_of + relativedelta(days=-1)
+
+ def _get_year_end_nearest(self, dt):
+ target_date = self.get_target_month_end(dt)
+ if target_date.weekday() == self.weekday:
+ return target_date
+ else:
+ forward = target_date + self._rd_forward
+ backward = target_date + self._rd_backward
+
+ if forward - target_date < target_date - backward:
+ return forward
+ else:
+ return backward
+
+ def _get_year_end_last(self, dt):
+ current_year = datetime(year=dt.year, month=self.startingMonth, day=1)
+ return current_year + self._offset_lwom
+
+ @property
+ def rule_code(self):
+ suffix = self.get_rule_code_suffix()
+ return "%s-%s" % (self._get_prefix(), suffix)
+
+ def _get_prefix(self):
+ return self._prefix
+
+ def _get_suffix_prefix(self):
+ if self.variation == "nearest":
+ return self._suffix_prefix_nearest
+ else:
+ return self._suffix_prefix_last
+
+ def get_rule_code_suffix(self):
+ return '%s-%s-%s' % (self._get_suffix_prefix(), \
+ _int_to_month[self.startingMonth], \
+ _int_to_weekday[self.weekday])
+
+ @classmethod
+ def _parse_suffix(cls, varion_code, startingMonth_code, weekday_code):
+ if varion_code == "N":
+ variation = "nearest"
+ elif varion_code == "L":
+ variation = "last"
+ else:
+ raise ValueError(
+ "Unable to parse varion_code: %s" % (varion_code,))
+
+ startingMonth = _month_to_int[startingMonth_code]
+ weekday = _weekday_to_int[weekday_code]
+
+ return {
+ "weekday": weekday,
+ "startingMonth": startingMonth,
+ "variation": variation,
+ }
+
+ @classmethod
+ def _from_name(cls, *args):
+ return cls(**cls._parse_suffix(*args))
+
+
+class FY5253Quarter(CacheableOffset, DateOffset):
+ """
+ DateOffset increments between business quarter dates
+ for 52-53 week fiscal year (also known as a 4-4-5 calendar).
+
+ It is used by companies that desire that their
+ fiscal year always end on the same day of the week.
+
+ It is a method of managing accounting periods.
+ It is a common calendar structure for some industries,
+ such as retail, manufacturing and parking industry.
+
+ For more information see:
+ http://en.wikipedia.org/wiki/4%E2%80%934%E2%80%935_calendar
+
+ The year may either:
+ - end on the last X day of the Y month.
+ - end on the last X day closest to the last day of the Y month.
+
+ X is a specific day of the week.
+ Y is a certain month of the year
+
+ startingMonth = 1 corresponds to dates like 1/31/2007, 4/30/2007, ...
+ startingMonth = 2 corresponds to dates like 2/28/2007, 5/31/2007, ...
+ startingMonth = 3 corresponds to dates like 3/30/2007, 6/29/2007, ...
+
+ Parameters
+ ----------
+ n : int
+ weekday : {0, 1, ..., 6}
+ 0: Mondays
+ 1: Tuesdays
+ 2: Wednesdays
+ 3: Thursdays
+ 4: Fridays
+ 5: Saturdays
+ 6: Sundays
+ startingMonth : The month in which fiscal years end. {1, 2, ... 12}
+ qtr_with_extra_week : The quarter number that has the leap
+ or 14 week when needed. {1,2,3,4}
+ variation : str
+ {"nearest", "last"} for "LastOfMonth" or "NearestEndMonth"
+ """
+
+ _prefix = 'REQ'
+
+ def __init__(self, n=1, **kwds):
+ self.n = n
+
+ self.qtr_with_extra_week = kwds["qtr_with_extra_week"]
+
+ self.kwds = kwds
+
+ if self.n == 0:
+ raise ValueError('N cannot be 0')
+
+ self._offset = FY5253( \
+ startingMonth=kwds['startingMonth'], \
+ weekday=kwds["weekday"],
+ variation=kwds["variation"])
+
+ def isAnchored(self):
+ return self.n == 1 and self._offset.isAnchored()
+
+ def apply(self, other):
+ other = as_datetime(other)
+ n = self.n
+
+ if n > 0:
+ while n > 0:
+ if not self._offset.onOffset(other):
+ qtr_lens = self.get_weeks(other)
+ start = other - self._offset
+ else:
+ start = other
+ qtr_lens = self.get_weeks(other + self._offset)
+
+ for weeks in qtr_lens:
+ start += relativedelta(weeks=weeks)
+ if start > other:
+ other = start
+ n -= 1
+ break
+
+ else:
+ n = -n
+ while n > 0:
+ if not self._offset.onOffset(other):
+ qtr_lens = self.get_weeks(other)
+ end = other + self._offset
+ else:
+ end = other
+ qtr_lens = self.get_weeks(other)
+
+ for weeks in reversed(qtr_lens):
+ end -= relativedelta(weeks=weeks)
+ if end < other:
+ other = end
+ n -= 1
+ break
+
+ return other
+
+ def get_weeks(self, dt):
+ ret = [13] * 4
+
+ year_has_extra_week = self.year_has_extra_week(dt)
+
+ if year_has_extra_week:
+ ret[self.qtr_with_extra_week - 1] = 14
+
+ return ret
+
+ def year_has_extra_week(self, dt):
+ if self._offset.onOffset(dt):
+ prev_year_end = dt - self._offset
+ next_year_end = dt
+ else:
+ next_year_end = dt + self._offset
+ prev_year_end = dt - self._offset
+
+ week_in_year = (next_year_end - prev_year_end).days / 7
+
+ return week_in_year == 53
+
+ def onOffset(self, dt):
+ if self._offset.onOffset(dt):
+ return True
+
+ next_year_end = dt - self._offset
+
+ qtr_lens = self.get_weeks(dt)
+
+ current = next_year_end
+ for qtr_len in qtr_lens[0:4]:
+ current += relativedelta(weeks=qtr_len)
+ if dt == current:
+ return True
+ return False
+
+ @property
+ def rule_code(self):
+ suffix = self._offset.get_rule_code_suffix()
+ return "%s-%s" % (self._prefix,
+ "%s-%d" % (suffix, self.qtr_with_extra_week))
+
+ @classmethod
+ def _from_name(cls, *args):
+ return cls(**dict(FY5253._parse_suffix(*args[:-1]),
+ qtr_with_extra_week=int(args[-1])))
+
+
#----------------------------------------------------------------------
# Ticks
diff --git a/pandas/tseries/tests/test_offsets.py b/pandas/tseries/tests/test_offsets.py
index f66f57cc45409..008bda0a676bf 100644
--- a/pandas/tseries/tests/test_offsets.py
+++ b/pandas/tseries/tests/test_offsets.py
@@ -1304,10 +1304,25 @@ def test_get_year_end(self):
self.assertEqual(makeFY5253NearestEndMonth(startingMonth=8, weekday=WeekDay.SUN).get_year_end(datetime(2013,1,1)), datetime(2013,9,1))
self.assertEqual(makeFY5253NearestEndMonth(startingMonth=8, weekday=WeekDay.FRI).get_year_end(datetime(2013,1,1)), datetime(2013,8,30))
+ offset_n = FY5253(weekday=WeekDay.TUE, startingMonth=12,
+ variation="nearest")
+ self.assertEqual(offset_n.get_year_end(datetime(2012,1,1)), datetime(2013,1,1))
+ self.assertEqual(offset_n.get_year_end(datetime(2012,1,10)), datetime(2013,1,1))
+
+ self.assertEqual(offset_n.get_year_end(datetime(2013,1,1)), datetime(2013,12,31))
+ self.assertEqual(offset_n.get_year_end(datetime(2013,1,2)), datetime(2013,12,31))
+ self.assertEqual(offset_n.get_year_end(datetime(2013,1,3)), datetime(2013,12,31))
+ self.assertEqual(offset_n.get_year_end(datetime(2013,1,10)), datetime(2013,12,31))
+
+ JNJ = FY5253(n=1, startingMonth=12, weekday=6, variation="nearest")
+ self.assertEqual(JNJ.get_year_end(datetime(2006, 1, 1)), datetime(2006, 12, 31))
+
def test_onOffset(self):
offset_lom_aug_sat = makeFY5253NearestEndMonth(1, startingMonth=8, weekday=WeekDay.SAT)
offset_lom_aug_thu = makeFY5253NearestEndMonth(1, startingMonth=8, weekday=WeekDay.THU)
-
+ offset_n = FY5253(weekday=WeekDay.TUE, startingMonth=12,
+ variation="nearest")
+
tests = [
# From Wikipedia (see: http://en.wikipedia.org/wiki/4%E2%80%934%E2%80%935_calendar#Saturday_nearest_the_end_of_month)
# 2006-09-02 2006 September 2
@@ -1354,21 +1369,39 @@ def test_onOffset(self):
#From Micron, see: http://google.brand.edgar-online.com/?sym=MU&formtypeID=7
(offset_lom_aug_thu, datetime(2012, 8, 30), True),
(offset_lom_aug_thu, datetime(2011, 9, 1), True),
-
+
+ (offset_n, datetime(2012, 12, 31), False),
+ (offset_n, datetime(2013, 1, 1), True),
+ (offset_n, datetime(2013, 1, 2), False),
]
for offset, date, expected in tests:
assertOnOffset(offset, date, expected)
def test_apply(self):
- date_seq_nem_8_sat = [datetime(2006, 9, 2), datetime(2007, 9, 1), datetime(2008, 8, 30), datetime(2009, 8, 29), datetime(2010, 8, 28), datetime(2011, 9, 3)]
+ date_seq_nem_8_sat = [datetime(2006, 9, 2), datetime(2007, 9, 1),
+ datetime(2008, 8, 30), datetime(2009, 8, 29),
+ datetime(2010, 8, 28), datetime(2011, 9, 3)]
+
+ JNJ = [datetime(2005, 1, 2), datetime(2006, 1, 1),
+ datetime(2006, 12, 31), datetime(2007, 12, 30),
+ datetime(2008, 12, 28), datetime(2010, 1, 3),
+ datetime(2011, 1, 2), datetime(2012, 1, 1),
+ datetime(2012, 12, 30)]
+
+ DEC_SAT = FY5253(n=-1, startingMonth=12, weekday=5, variation="nearest")
tests = [
- (makeFY5253NearestEndMonth(startingMonth=8, weekday=WeekDay.SAT), date_seq_nem_8_sat),
- (makeFY5253NearestEndMonth(n=1, startingMonth=8, weekday=WeekDay.SAT), date_seq_nem_8_sat),
- (makeFY5253NearestEndMonth(startingMonth=8, weekday=WeekDay.SAT), [datetime(2006, 9, 1)] + date_seq_nem_8_sat),
- (makeFY5253NearestEndMonth(n=1, startingMonth=8, weekday=WeekDay.SAT), [datetime(2006, 9, 3)] + date_seq_nem_8_sat[1:]),
- (makeFY5253NearestEndMonth(n=-1, startingMonth=8, weekday=WeekDay.SAT), list(reversed(date_seq_nem_8_sat))),
+ (makeFY5253NearestEndMonth(startingMonth=8, weekday=WeekDay.SAT), date_seq_nem_8_sat),
+ (makeFY5253NearestEndMonth(n=1, startingMonth=8, weekday=WeekDay.SAT), date_seq_nem_8_sat),
+ (makeFY5253NearestEndMonth(startingMonth=8, weekday=WeekDay.SAT), [datetime(2006, 9, 1)] + date_seq_nem_8_sat),
+ (makeFY5253NearestEndMonth(n=1, startingMonth=8, weekday=WeekDay.SAT), [datetime(2006, 9, 3)] + date_seq_nem_8_sat[1:]),
+ (makeFY5253NearestEndMonth(n=-1, startingMonth=8, weekday=WeekDay.SAT), list(reversed(date_seq_nem_8_sat))),
+ (makeFY5253NearestEndMonth(n=1, startingMonth=12, weekday=WeekDay.SUN), JNJ),
+ (makeFY5253NearestEndMonth(n=-1, startingMonth=12, weekday=WeekDay.SUN), list(reversed(JNJ))),
+ (makeFY5253NearestEndMonth(n=1, startingMonth=12, weekday=WeekDay.SUN), [datetime(2005,1,2), datetime(2006, 1, 1)]),
+ (makeFY5253NearestEndMonth(n=1, startingMonth=12, weekday=WeekDay.SUN), [datetime(2006,1,2), datetime(2006, 12, 31)]),
+ (DEC_SAT, [datetime(2013,1,15), datetime(2012,12,29)])
]
for test in tests:
offset, data = test
@@ -1512,9 +1545,12 @@ def test_year_has_extra_week(self):
self.assertTrue(makeFY5253LastOfMonthQuarter(1, startingMonth=12, weekday=WeekDay.SAT, qtr_with_extra_week=1).year_has_extra_week(datetime(1994, 4, 2)))
def test_get_weeks(self):
- self.assertEqual(makeFY5253LastOfMonthQuarter(1, startingMonth=12, weekday=WeekDay.SAT, qtr_with_extra_week=1).get_weeks(datetime(2011, 4, 2)), [14, 13, 13, 13])
- self.assertEqual(makeFY5253LastOfMonthQuarter(1, startingMonth=12, weekday=WeekDay.SAT, qtr_with_extra_week=4).get_weeks(datetime(2011, 4, 2)), [13, 13, 13, 14])
- self.assertEqual(makeFY5253LastOfMonthQuarter(1, startingMonth=12, weekday=WeekDay.SAT, qtr_with_extra_week=1).get_weeks(datetime(2010, 12, 25)), [13, 13, 13, 13])
+ sat_dec_1 = makeFY5253LastOfMonthQuarter(1, startingMonth=12, weekday=WeekDay.SAT, qtr_with_extra_week=1)
+ sat_dec_4 = makeFY5253LastOfMonthQuarter(1, startingMonth=12, weekday=WeekDay.SAT, qtr_with_extra_week=4)
+
+ self.assertEqual(sat_dec_1.get_weeks(datetime(2011, 4, 2)), [14, 13, 13, 13])
+ self.assertEqual(sat_dec_4.get_weeks(datetime(2011, 4, 2)), [13, 13, 13, 14])
+ self.assertEqual(sat_dec_1.get_weeks(datetime(2010, 12, 25)), [13, 13, 13, 13])
class TestFY5253NearestEndMonthQuarter(TestBase):
@@ -1522,6 +1558,9 @@ def test_onOffset(self):
offset_nem_sat_aug_4 = makeFY5253NearestEndMonthQuarter(1, startingMonth=8, weekday=WeekDay.SAT, qtr_with_extra_week=4)
offset_nem_thu_aug_4 = makeFY5253NearestEndMonthQuarter(1, startingMonth=8, weekday=WeekDay.THU, qtr_with_extra_week=4)
+ offset_n = FY5253(weekday=WeekDay.TUE, startingMonth=12,
+ variation="nearest", qtr_with_extra_week=4)
+
tests = [
#From Wikipedia
(offset_nem_sat_aug_4, datetime(2006, 9, 2), True),
@@ -1563,6 +1602,9 @@ def test_onOffset(self):
(offset_nem_thu_aug_4, datetime(2007, 3, 1), True),
(offset_nem_thu_aug_4, datetime(1994, 3, 3), True),
+ (offset_n, datetime(2012, 12, 31), False),
+ (offset_n, datetime(2013, 1, 1), True),
+ (offset_n, datetime(2013, 1, 2), False)
]
for offset, date, expected in tests:
@@ -1580,7 +1622,12 @@ def test_offset(self):
assertEq(offset, datetime(2012, 5, 31), datetime(2012, 8, 30))
assertEq(offset, datetime(2012, 5, 30), datetime(2012, 5, 31))
-
+
+ offset2 = FY5253Quarter(weekday=5, startingMonth=12,
+ variation="last", qtr_with_extra_week=4)
+
+ assertEq(offset2, datetime(2013,1,15), datetime(2013, 3, 30))
+
class TestQuarterBegin(TestBase):
def test_repr(self):
| There are currently some issues with FY5253 working with `variation="nearest"` and `startingMonth=12`.
This PR fixes those issues and add some more tests.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5405 | 2013-11-01T03:52:05Z | 2013-11-07T21:58:18Z | 2013-11-07T21:58:18Z | 2014-07-04T19:06:17Z |
CLN: Remove unnecessary ExcelWriterMeta metaclass | diff --git a/pandas/io/excel.py b/pandas/io/excel.py
index 44b323abf45c2..ae844d1eeb5fc 100644
--- a/pandas/io/excel.py
+++ b/pandas/io/excel.py
@@ -24,6 +24,7 @@
_writer_extensions = ["xlsx", "xls", "xlsm"]
_writers = {}
+
def register_writer(klass):
"""Adds engine to the excel writer registry. You must use this method to
integrate with ``to_excel``. Also adds config options for any new
@@ -40,12 +41,14 @@ def register_writer(klass):
engine_name, validator=str)
_writer_extensions.append(ext)
+
def get_writer(engine_name):
try:
return _writers[engine_name]
except KeyError:
raise ValueError("No Excel writer '%s'" % engine_name)
+
def read_excel(io, sheetname, **kwds):
"""Read an Excel table into a pandas DataFrame
@@ -80,7 +83,7 @@ def read_excel(io, sheetname, **kwds):
engine: string, default None
If io is not a buffer or path, this must be set to identify io.
Acceptable values are None or xlrd
-
+
Returns
-------
parsed : DataFrame
@@ -90,9 +93,9 @@ def read_excel(io, sheetname, **kwds):
kwds.pop('kind')
warn("kind keyword is no longer supported in read_excel and may be "
"removed in a future version", FutureWarning)
-
- engine = kwds.pop('engine', None)
-
+
+ engine = kwds.pop('engine', None)
+
return ExcelFile(io, engine=engine).parse(sheetname=sheetname, **kwds)
@@ -119,9 +122,9 @@ def __init__(self, io, **kwds):
"support, current version " + xlrd.__VERSION__)
self.io = io
-
+
engine = kwds.pop('engine', None)
-
+
if engine is not None and engine != 'xlrd':
raise ValueError("Unknown engine: %s" % engine)
@@ -133,7 +136,8 @@ def __init__(self, io, **kwds):
data = io.read()
self.book = xlrd.open_workbook(file_contents=data)
else:
- raise ValueError('Must explicitly set engine if not passing in buffer or path for io.')
+ raise ValueError('Must explicitly set engine if not passing in'
+ ' buffer or path for io.')
def parse(self, sheetname, header=0, skiprows=None, skip_footer=0,
index_col=None, parse_cols=None, parse_dates=False,
@@ -291,6 +295,7 @@ def __enter__(self):
def __exit__(self, exc_type, exc_value, traceback):
self.close()
+
def _trim_excel_header(row):
# trim header row so auto-index inference works
# xlrd uses '' , openpyxl None
@@ -298,6 +303,7 @@ def _trim_excel_header(row):
row = row[1:]
return row
+
def _conv_value(val):
# Convert numpy types to Python types for the Excel writers.
if com.is_integer(val):
@@ -312,34 +318,45 @@ def _conv_value(val):
return val
-class ExcelWriterMeta(abc.ABCMeta):
+@add_metaclass(abc.ABCMeta)
+class ExcelWriter(object):
"""
- Metaclass that dynamically chooses the ExcelWriter to use.
-
- If you directly instantiate a subclass, it skips the engine lookup.
-
- Defining an ExcelWriter implementation (see abstract methods on ExcelWriter for more...).
-
- - Mandatory (but not checked at run time):
- - ``write_cells(self, cells, sheet_name=None, startrow=0, startcol=0)``
- --> called to write additional DataFrames to disk
- - ``supported_extensions`` (tuple of supported extensions), used to check
- that engine supports the given extension.
- - ``engine`` - string that gives the engine name. Necessary to
- instantiate class directly and bypass ``ExcelWriterMeta`` engine lookup.
- - ``save(self)`` --> called to save file to disk
- - Optional:
- - ``__init__(self, path, **kwargs)`` --> always called with path as first
- argument.
+ Class for writing DataFrame objects into excel sheets, default is to use
+ xlwt for xls, openpyxl for xlsx. See DataFrame.to_excel for typical usage.
- You also need to register the class with ``register_writer()``.
+ Parameters
+ ----------
+ path : string
+ Path to xls or xlsx file.
+ engine : string (optional)
+ Engine to use for writing. If None, defaults to
+ ``io.excel.<extension>.writer``. NOTE: can only be passed as a keyword
+ argument.
"""
-
- def __call__(cls, path, **kwargs):
- engine = kwargs.pop('engine', None)
- # if it's not an ExcelWriter baseclass, dont' do anything (you've
- # probably made an explicit choice here)
- if not isinstance(getattr(cls, 'engine', None), compat.string_types):
+ # Defining an ExcelWriter implementation (see abstract methods for more...)
+
+ # - Mandatory
+ # - ``write_cells(self, cells, sheet_name=None, startrow=0, startcol=0)``
+ # --> called to write additional DataFrames to disk
+ # - ``supported_extensions`` (tuple of supported extensions), used to
+ # check that engine supports the given extension.
+ # - ``engine`` - string that gives the engine name. Necessary to
+ # instantiate class directly and bypass ``ExcelWriterMeta`` engine
+ # lookup.
+ # - ``save(self)`` --> called to save file to disk
+ # - Mostly mandatory (i.e. should at least exist)
+ # - book, cur_sheet, path
+
+ # - Optional:
+ # - ``__init__(self, path, engine=None, **kwargs)`` --> always called
+ # with path as first argument.
+
+ # You also need to register the class with ``register_writer()``.
+ # Technically, ExcelWriter implementations don't need to subclass
+ # ExcelWriter.
+ def __new__(cls, path, engine=None, **kwargs):
+ # only switch class if generic(ExcelWriter)
+ if cls == ExcelWriter:
if engine is None:
ext = os.path.splitext(path)[-1][1:]
try:
@@ -348,31 +365,14 @@ def __call__(cls, path, **kwargs):
error = ValueError("No engine for filetype: '%s'" % ext)
raise error
cls = get_writer(engine)
- writer = cls.__new__(cls, path, **kwargs)
- writer.__init__(path, **kwargs)
- return writer
-
-@add_metaclass(ExcelWriterMeta)
-class ExcelWriter(object):
- """
- Class for writing DataFrame objects into excel sheets, default is to use
- xlwt for xls, openpyxl for xlsx. See DataFrame.to_excel for typical usage.
+ return object.__new__(cls)
- Parameters
- ----------
- path : string
- Path to xls or xlsx file.
- engine : string (optional)
- Engine to use for writing. If None, defaults to ``io.excel.<extension>.writer``.
- NOTE: can only be passed as a keyword argument.
- """
# declare external properties you can count on
book = None
curr_sheet = None
path = None
-
@abc.abstractproperty
def supported_extensions(self):
"extensions that writer engine supports"
@@ -407,9 +407,6 @@ def save(self):
pass
def __init__(self, path, engine=None, **engine_kwargs):
- # note that subclasses will *never* get anything for engine
- # included here so that it's visible as part of the public signature.
-
# validate that this engine can handle the extnesion
ext = os.path.splitext(path)[-1]
self.check_extension(ext)
@@ -455,7 +452,7 @@ class _OpenpyxlWriter(ExcelWriter):
engine = 'openpyxl'
supported_extensions = ('.xlsx', '.xlsm')
- def __init__(self, path, **engine_kwargs):
+ def __init__(self, path, engine=None, **engine_kwargs):
# Use the openpyxl module as the Excel writer.
from openpyxl.workbook import Workbook
@@ -511,6 +508,7 @@ def write_cells(self, cells, sheet_name=None, startrow=0, startcol=0):
startrow + cell.row + 1,
cletterend,
startrow + cell.mergestart + 1))
+
@classmethod
def _convert_to_style(cls, style_dict):
"""
@@ -539,7 +537,7 @@ class _XlwtWriter(ExcelWriter):
engine = 'xlwt'
supported_extensions = ('.xls',)
- def __init__(self, path, **engine_kwargs):
+ def __init__(self, path, engine=None, **engine_kwargs):
# Use the xlwt module as the Excel writer.
import xlwt
@@ -599,7 +597,8 @@ def write_cells(self, cells, sheet_name=None, startrow=0, startcol=0):
val, style)
@classmethod
- def _style_to_xlwt(cls, item, firstlevel=True, field_sep=',', line_sep=';'):
+ def _style_to_xlwt(cls, item, firstlevel=True, field_sep=',',
+ line_sep=';'):
"""helper which recursively generate an xlwt easy style string
for example:
@@ -617,12 +616,12 @@ def _style_to_xlwt(cls, item, firstlevel=True, field_sep=',', line_sep=';'):
if hasattr(item, 'items'):
if firstlevel:
it = ["%s: %s" % (key, cls._style_to_xlwt(value, False))
- for key, value in item.items()]
+ for key, value in item.items()]
out = "%s " % (line_sep).join(it)
return out
else:
it = ["%s %s" % (key, cls._style_to_xlwt(value, False))
- for key, value in item.items()]
+ for key, value in item.items()]
out = "%s " % (field_sep).join(it)
return out
else:
@@ -659,11 +658,11 @@ class _XlsxWriter(ExcelWriter):
engine = 'xlsxwriter'
supported_extensions = ('.xlsx',)
- def __init__(self, path, **engine_kwargs):
+ def __init__(self, path, engine=None, **engine_kwargs):
# Use the xlsxwriter module as the Excel writer.
import xlsxwriter
- super(_XlsxWriter, self).__init__(path, **engine_kwargs)
+ super(_XlsxWriter, self).__init__(path, engine=engine, **engine_kwargs)
self.book = xlsxwriter.Workbook(path, **engine_kwargs)
| Only `__new__` is really necessary. And subclasses just have to deal with
being passed an 'engine' keyword argument + a tad bit of style cleanup.
Thanks to @jseabold and @josef-pkt for making me realize that this was
unnecessary in https://github.com/statsmodels/statsmodels/issues/1167
:)
@jmcnamara - this has completely trivial impact on ExcelWriter
subclasses, just removes some magic.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5403 | 2013-10-31T22:20:02Z | 2013-11-01T00:21:36Z | 2013-11-01T00:21:36Z | 2014-06-30T12:55:30Z |
BUG: support for GA new segment format (GH5398) | diff --git a/doc/source/v0.13.0.txt b/doc/source/v0.13.0.txt
index 27794d6af1a8d..f2f958dc472a0 100644
--- a/doc/source/v0.13.0.txt
+++ b/doc/source/v0.13.0.txt
@@ -553,6 +553,7 @@ Enhancements
output datetime objects should be formatted. Datetimes encountered in the
index, columns, and values will all have this formatting applied. (:issue:`4313`)
- ``DataFrame.plot`` will scatter plot x versus y by passing ``kind='scatter'`` (:issue:`2215`)
+- Added support for Google Analytics v3 API segment IDs that also supports v2 IDs. (:issue:`5271`)
.. _whatsnew_0130.experimental:
@@ -726,7 +727,6 @@ Experimental
As of 10/10/13, there is a bug in Google's API preventing result sets
from being larger than 100,000 rows. A patch is scheduled for the week of
10/14/13.
-
.. _whatsnew_0130.refactoring:
Internal Refactoring
diff --git a/pandas/io/ga.py b/pandas/io/ga.py
index 78c331cda829c..4391b2637a837 100644
--- a/pandas/io/ga.py
+++ b/pandas/io/ga.py
@@ -360,7 +360,7 @@ def format_query(ids, metrics, start_date, end_date=None, dimensions=None,
[_maybe_add_arg(qry, n, d) for n, d in zip(names, lst)]
if isinstance(segment, compat.string_types):
- if re.match("^[a-zA-Z0-9]+\-*[a-zA-Z0-9]*$", segment):
+ if re.match("^[a-zA-Z0-9\-\_]+$", segment):
_maybe_add_arg(qry, 'segment', segment, 'gaid:')
else:
_maybe_add_arg(qry, 'segment', segment, 'dynamic::ga')
diff --git a/pandas/io/tests/test_ga.py b/pandas/io/tests/test_ga.py
index 166917799ca82..a2472a16f46a7 100644
--- a/pandas/io/tests/test_ga.py
+++ b/pandas/io/tests/test_ga.py
@@ -115,10 +115,16 @@ def test_v3_advanced_segment_common_format(self):
assert query['segment'] == 'gaid::' + str(advanced_segment_id), "A string value with just letters and numbers should be formatted as an advanced segment."
def test_v3_advanced_segment_weird_format(self):
- advanced_segment_id = 'aZwqR234-s1'
+ advanced_segment_id = '_aZwqR234-s1'
query = ga.format_query('google_profile_id', ['visits'], '2013-09-01', segment=advanced_segment_id)
assert query['segment'] == 'gaid::' + str(advanced_segment_id), "A string value with just letters, numbers, and hyphens should be formatted as an advanced segment."
+ def test_v3_advanced_segment_with_underscore_format(self):
+ advanced_segment_id = 'aZwqR234_s1'
+ query = ga.format_query('google_profile_id', ['visits'], '2013-09-01', segment=advanced_segment_id)
+ assert query['segment'] == 'gaid::' + str(advanced_segment_id), "A string value with just letters, numbers, and underscores should be formatted as an advanced segment."
+
+
@slow
@with_connectivity_check("http://www.google.com")
def test_segment(self):
| Adds support for underscores to Google's new segment format. The issue referenced is here:
closes https://github.com/pydata/pandas/issues/5398
| https://api.github.com/repos/pandas-dev/pandas/pulls/5400 | 2013-10-31T17:24:27Z | 2013-12-07T14:22:02Z | null | 2014-06-27T14:53:37Z |
Display the correct error message when calling a binary moment without appropriate parameters. | diff --git a/pandas/stats/moments.py b/pandas/stats/moments.py
index f3ec3880ec8b5..6671f0a9c958a 100644
--- a/pandas/stats/moments.py
+++ b/pandas/stats/moments.py
@@ -195,7 +195,7 @@ def _get_corr(a, b):
def _flex_binary_moment(arg1, arg2, f):
if not (isinstance(arg1,(np.ndarray, Series, DataFrame)) and
- isinstance(arg1,(np.ndarray, Series, DataFrame))):
+ isinstance(arg2,(np.ndarray, Series, DataFrame))):
raise ValueError("arguments to moment function must be of type ndarray/DataFrame")
if isinstance(arg1, (np.ndarray,Series)) and isinstance(arg2, (np.ndarray,Series)):
| This pr fixes a typo in the type checking of binary moments. It makes the error messages below consistent:
> > > import pandas
> > > a = pandas.DataFrame([1,2,3,4,5,6])
> > > pandas.rolling_cov(list(), a, 3)
> > > ValueError: arguments to moment function must be of type ndarray/DataFrame
> > >
> > > pandas.rolling_cov(a, list(), 3)
> > > TypeError: unsupported type: <type 'list'>
| https://api.github.com/repos/pandas-dev/pandas/pulls/5399 | 2013-10-31T15:41:15Z | 2013-11-21T13:44:48Z | 2013-11-21T13:44:48Z | 2014-06-22T05:58:40Z |
BUG/TST: fix downcasting of float-like object array | diff --git a/pandas/core/common.py b/pandas/core/common.py
index d05c3dbafdee6..e89ae44dacd31 100644
--- a/pandas/core/common.py
+++ b/pandas/core/common.py
@@ -1038,7 +1038,8 @@ def _possibly_downcast_to_dtype(result, dtype):
# try to upcast here
elif inferred_type == 'floating':
dtype = 'int64'
- trans = lambda x: x.round()
+ if issubclass(result.dtype.type, np.number):
+ trans = lambda x: x.round()
else:
dtype = 'object'
diff --git a/pandas/tests/test_common.py b/pandas/tests/test_common.py
index 3fd40062e1459..dfedfd629f736 100644
--- a/pandas/tests/test_common.py
+++ b/pandas/tests/test_common.py
@@ -135,6 +135,20 @@ def test_downcast_conv():
expected = np.array([8, 8, 8, 8, 9])
assert (np.array_equal(result, expected))
+ # conversions
+
+ expected = np.array([1,2])
+ for dtype in [np.float64,object,np.int64]:
+ arr = np.array([1.0,2.0],dtype=dtype)
+ result = com._possibly_downcast_to_dtype(arr,'infer')
+ tm.assert_almost_equal(result, expected)
+
+ expected = np.array([1.0,2.0,np.nan])
+ for dtype in [np.float64,object]:
+ arr = np.array([1.0,2.0,np.nan],dtype=dtype)
+ result = com._possibly_downcast_to_dtype(arr,'infer')
+ tm.assert_almost_equal(result, expected)
+
def test_datetimeindex_from_empty_datetime64_array():
for unit in [ 'ms', 'us', 'ns' ]:
idx = DatetimeIndex(np.array([], dtype='datetime64[%s]' % unit))
| related #5394
This now works
```
In [1]: arr = np.array([1.0,2.0],dtype=object)
In [3]: pandas.core.common._possibly_downcast_to_dtype(arr,'infer')
Out[3]: array([1, 2])
```
| https://api.github.com/repos/pandas-dev/pandas/pulls/5397 | 2013-10-31T12:04:13Z | 2013-10-31T12:30:10Z | 2013-10-31T12:30:10Z | 2014-07-16T08:38:18Z |
HTML Parsing Cleanup | diff --git a/doc/source/release.rst b/doc/source/release.rst
index d6a98157c76d3..9c27851c9cecf 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -209,7 +209,9 @@ Improvements to existing features
by color as expected.
- ``read_excel()`` now tries to convert integral floats (like ``1.0``) to int
by default. (:issue:`5394`)
-
+ - ``read_html`` can accept a subclass of ``Flavor`` rather than a string for
+ the parsing flavor. This allows user written HTML parsers.
+
API Changes
~~~~~~~~~~~
diff --git a/pandas/io/html.py b/pandas/io/html.py
index f3cfa3a16807a..86240fc9ffdbe 100644
--- a/pandas/io/html.py
+++ b/pandas/io/html.py
@@ -124,6 +124,14 @@ def _read(io):
return raw_text
+class Flavor(object):
+ """
+ Mixin class used to specify a user written HTML parsing flavor
+ Used by making the user written parser a subclass of Flavor
+ """
+ pass
+
+
class _HtmlFrameParser(object):
"""Base class for parsers that parse HTML into DataFrames.
@@ -165,13 +173,14 @@ class _HtmlFrameParser(object):
See each method's respective documentation for details on their
functionality.
"""
- def __init__(self, io, match, attrs):
- self.io = io
+ def __init__(self, match, attrs):
self.match = match
self.attrs = attrs
- def parse_tables(self):
- tables = self._parse_tables(self._build_doc(), self.match, self.attrs)
+ def parse_tables(self, io):
+ tables = self._parse_tables(self._build_doc(io),
+ self.match,
+ self.attrs)
return (self._build_table(table) for table in tables)
def _parse_raw_data(self, rows):
@@ -314,7 +323,7 @@ def _parse_tfoot(self, table):
"""
raise NotImplementedError
- def _build_doc(self):
+ def _build_doc(self, io):
"""Return a tree-like object that can be used to iterate over the DOM.
Returns
@@ -414,15 +423,15 @@ def _parse_tables(self, doc, match, attrs):
match.pattern)
return result
- def _setup_build_doc(self):
- raw_text = _read(self.io)
+ def _setup_build_doc(self, io):
+ raw_text = _read(io)
if not raw_text:
- raise ValueError('No text parsed from document: %s' % self.io)
+ raise ValueError('No text parsed from document: %s' % io)
return raw_text
- def _build_doc(self):
+ def _build_doc(self, io):
from bs4 import BeautifulSoup
- return BeautifulSoup(self._setup_build_doc(), features='html5lib')
+ return BeautifulSoup(self._setup_build_doc(io), features='html5lib')
def _build_xpath_expr(attrs):
@@ -500,7 +509,11 @@ def _parse_tables(self, doc, match, kwargs):
raise ValueError("No tables found matching regex %r" % pattern)
return tables
- def _build_doc(self):
+ def _get_parser(self):
+ from lxml.html import HTMLParser
+ return HTMLParser(recover=False)
+
+ def _build_doc(self, io):
"""
Raises
------
@@ -516,14 +529,14 @@ def _build_doc(self):
--------
pandas.io.html._HtmlFrameParser._build_doc
"""
- from lxml.html import parse, fromstring, HTMLParser
+ from lxml.html import parse, fromstring
from lxml.etree import XMLSyntaxError
- parser = HTMLParser(recover=False)
+ parser = self._get_parser()
try:
# try to parse the input in the simplest way
- r = parse(self.io, parser=parser)
+ r = parse(io, parser=parser)
try:
r = r.getroot()
@@ -531,8 +544,8 @@ def _build_doc(self):
pass
except (UnicodeDecodeError, IOError):
# if the input is a blob of html goop
- if not _is_url(self.io):
- r = fromstring(self.io, parser=parser)
+ if not _is_url(io):
+ r = fromstring(io, parser=parser)
try:
r = r.getroot()
@@ -540,7 +553,7 @@ def _build_doc(self):
pass
else:
# not a url
- scheme = parse_url(self.io).scheme
+ scheme = parse_url(io).scheme
if scheme not in _valid_schemes:
# lxml can't parse it
msg = ('%r is not a valid url scheme, valid schemes are '
@@ -611,7 +624,16 @@ def _data_to_frame(data, header, index_col, skiprows, infer_types,
_valid_parsers = {'lxml': _LxmlFrameParser, None: _LxmlFrameParser,
'html5lib': _BeautifulSoupHtml5LibFrameParser,
- 'bs4': _BeautifulSoupHtml5LibFrameParser}
+ 'bs4': _BeautifulSoupHtml5LibFrameParser,
+ }
+
+
+def _is_flavor(flav):
+ return np.issubclass_(flav, Flavor)
+
+
+def _is_string_or_flavor(flav):
+ return isinstance(flav, string_types) or _is_flavor(flav)
def _parser_dispatch(flavor):
@@ -634,6 +656,9 @@ def _parser_dispatch(flavor):
ImportError
* If you do not have the requested `flavor`
"""
+ if _is_flavor(flavor):
+ return flavor
+
valid_parsers = list(_valid_parsers.keys())
if flavor not in valid_parsers:
raise ValueError('%r is not a valid flavor, valid flavors are %s' %
@@ -665,10 +690,10 @@ def _print_as_set(s):
def _validate_flavor(flavor):
if flavor is None:
flavor = 'lxml', 'bs4'
- elif isinstance(flavor, string_types):
+ elif _is_string_or_flavor(flavor):
flavor = flavor,
elif isinstance(flavor, collections.Iterable):
- if not all(isinstance(flav, string_types) for flav in flavor):
+ if not all(_is_string_or_flavor(flav) for flav in flavor):
raise TypeError('Object of type %r is not an iterable of strings' %
type(flavor).__name__)
else:
@@ -679,8 +704,9 @@ def _validate_flavor(flavor):
flavor = tuple(flavor)
valid_flavors = set(_valid_parsers)
flavor_set = set(flavor)
+ flavor_set_flavors = [f for f in flavor_set if _is_flavor(f)]
- if not flavor_set & valid_flavors:
+ if not flavor_set & valid_flavors and not flavor_set_flavors:
raise ValueError('%s is not a valid set of flavors, valid flavors are '
'%s' % (_print_as_set(flavor_set),
_print_as_set(valid_flavors)))
@@ -696,10 +722,10 @@ def _parse(flavor, io, match, header, index_col, skiprows, infer_types,
retained = None
for flav in flavor:
parser = _parser_dispatch(flav)
- p = parser(io, compiled_match, attrs)
+ p = parser(compiled_match, attrs)
try:
- tables = p.parse_tables()
+ tables = p.parse_tables(io)
except Exception as caught:
retained = caught
else:
diff --git a/pandas/io/tests/test_html.py b/pandas/io/tests/test_html.py
index c26048d4cf20b..dcc91b4550ba5 100644
--- a/pandas/io/tests/test_html.py
+++ b/pandas/io/tests/test_html.py
@@ -22,7 +22,7 @@
date_range, Series)
from pandas.compat import map, zip, StringIO, string_types
from pandas.io.common import URLError, urlopen, file_path_to_url
-from pandas.io.html import read_html
+from pandas.io.html import read_html, Flavor
import pandas.util.testing as tm
from pandas.util.testing import makeCustomDataframe as mkdf, network
@@ -602,7 +602,34 @@ def test_data_fail(self):
with tm.assertRaises(XMLSyntaxError):
self.read_html(banklist_data, flavor=['lxml'])
-
+
+ def test_custom_html_parser1(self):
+ import re
+ t_match = re.compile(".")
+ t_attrs = object()
+ that = self
+ class _CustomHtmlFrameParser(Flavor):
+ def __init__(self, match, attrs):
+ that.assertTrue(t_match is match)
+ that.assertTrue(t_attrs is attrs)
+
+ def parse_tables(self, io):
+ return [[[],[["a", "b"],[1,2]],[]]]
+
+ banklist_data = os.path.join(DATA_PATH, 'banklist.html')
+
+ dfs = self.read_html(banklist_data, flavor=[_CustomHtmlFrameParser], match=t_match, attrs=t_attrs)
+ for df in dfs:
+ tm.assert_isinstance(df, DataFrame)
+ self.assertFalse(df.empty)
+ self.assertEqual(df[0][0], "a")
+
+ dfs = self.read_html(banklist_data, flavor=_CustomHtmlFrameParser, match=t_match, attrs=t_attrs)
+ for df in dfs:
+ tm.assert_isinstance(df, DataFrame)
+ self.assertFalse(df.empty)
+ self.assertEqual(df[1][1], 2)
+
def test_works_on_valid_markup(self):
filename = os.path.join(DATA_PATH, 'valid_markup.html')
dfs = self.read_html(filename, index_col=0, flavor=['lxml'])
| - Can pass `Flavor` to HTML parse (closes #4594 and #5130). Instead of #5131
- Cleanup API for HTML parsers
I added new (public class) `Flavor` which users can subclass. Currently the expectation is to pass in the class (not an instance of the class)
CC @cpcloud @jtratner @jreback
| https://api.github.com/repos/pandas-dev/pandas/pulls/5395 | 2013-10-31T02:43:58Z | 2014-02-16T22:04:20Z | null | 2016-03-20T15:25:36Z |
ENH: read_excel: try converting numeric to int | diff --git a/doc/source/io.rst b/doc/source/io.rst
index 0842893800dd5..1a879866c5516 100644
--- a/doc/source/io.rst
+++ b/doc/source/io.rst
@@ -1839,6 +1839,13 @@ one can pass an :class:`~pandas.io.excel.ExcelWriter`.
df1.to_excel(writer, sheet_name='Sheet1')
df2.to_excel(writer, sheet_name='Sheet2')
+.. note:: Wringing a little more performance out of ``read_excel``
+ Internally, Excel stores all numeric data as floats. Because this can
+ produce unexpected behavior when reading in data, pandas defaults to trying
+ to convert integers to floats if it doesn't lose information (``1.0 -->
+ 1``). You can pass ``convert_float=False`` to disable this behavior, which
+ may give a slight performance improvement.
+
.. _io.excel.writers:
Excel writer engines
diff --git a/doc/source/release.rst b/doc/source/release.rst
index 8a0e31859c185..721ef9a1cbbf3 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -207,6 +207,8 @@ Improvements to existing features
closed])
- Fixed bug in `tools.plotting.andrews_curvres` so that lines are drawn grouped
by color as expected.
+ - ``read_excel()`` now tries to convert integral floats (like ``1.0``) to int
+ by default. (:issue:`5394`)
API Changes
~~~~~~~~~~~
diff --git a/pandas/io/excel.py b/pandas/io/excel.py
index ae844d1eeb5fc..42c212caf41ca 100644
--- a/pandas/io/excel.py
+++ b/pandas/io/excel.py
@@ -83,6 +83,10 @@ def read_excel(io, sheetname, **kwds):
engine: string, default None
If io is not a buffer or path, this must be set to identify io.
Acceptable values are None or xlrd
+ convert_float : boolean, default True
+ convert integral floats to int (i.e., 1.0 --> 1). If False, all numeric
+ data will be read in as floats: Excel stores all numbers as floats
+ internally.
Returns
-------
@@ -142,7 +146,7 @@ def __init__(self, io, **kwds):
def parse(self, sheetname, header=0, skiprows=None, skip_footer=0,
index_col=None, parse_cols=None, parse_dates=False,
date_parser=None, na_values=None, thousands=None, chunksize=None,
- **kwds):
+ convert_float=True, **kwds):
"""Read an Excel table into DataFrame
Parameters
@@ -172,6 +176,10 @@ def parse(self, sheetname, header=0, skiprows=None, skip_footer=0,
NaN values are overridden, otherwise they're appended to
verbose : boolean, default False
Indicate number of NA values placed in non-numeric columns
+ convert_float : boolean, default True
+ convert integral floats to int (i.e., 1.0 --> 1). If False, all
+ numeric data will be read in as floats: Excel stores all numbers as
+ floats internally.
Returns
-------
@@ -191,7 +199,9 @@ def parse(self, sheetname, header=0, skiprows=None, skip_footer=0,
parse_dates=parse_dates,
date_parser=date_parser, na_values=na_values,
thousands=thousands, chunksize=chunksize,
- skip_footer=skip_footer, **kwds)
+ skip_footer=skip_footer,
+ convert_float=convert_float,
+ **kwds)
def _should_parse(self, i, parse_cols):
@@ -229,9 +239,11 @@ def _excel2num(x):
def _parse_excel(self, sheetname, header=0, skiprows=None, skip_footer=0,
index_col=None, has_index_names=None, parse_cols=None,
parse_dates=False, date_parser=None, na_values=None,
- thousands=None, chunksize=None, **kwds):
+ thousands=None, chunksize=None, convert_float=True,
+ **kwds):
from xlrd import (xldate_as_tuple, XL_CELL_DATE,
- XL_CELL_ERROR, XL_CELL_BOOLEAN)
+ XL_CELL_ERROR, XL_CELL_BOOLEAN,
+ XL_CELL_NUMBER)
datemode = self.book.datemode
if isinstance(sheetname, compat.string_types):
@@ -260,6 +272,13 @@ def _parse_excel(self, sheetname, header=0, skiprows=None, skip_footer=0,
value = np.nan
elif typ == XL_CELL_BOOLEAN:
value = bool(value)
+ elif convert_float and typ == XL_CELL_NUMBER:
+ # GH5394 - Excel 'numbers' are always floats
+ # it's a minimal perf hit and less suprising
+ val = int(value)
+ if val == value:
+ value = val
+
row.append(value)
data.append(row)
diff --git a/pandas/io/tests/data/test_types.xls b/pandas/io/tests/data/test_types.xls
new file mode 100644
index 0000000000000..2d387603a8307
Binary files /dev/null and b/pandas/io/tests/data/test_types.xls differ
diff --git a/pandas/io/tests/data/test_types.xlsx b/pandas/io/tests/data/test_types.xlsx
new file mode 100644
index 0000000000000..ef749e04ff3b5
Binary files /dev/null and b/pandas/io/tests/data/test_types.xlsx differ
diff --git a/pandas/io/tests/test_excel.py b/pandas/io/tests/test_excel.py
index 15130c552c8a8..311a0953f1c02 100644
--- a/pandas/io/tests/test_excel.py
+++ b/pandas/io/tests/test_excel.py
@@ -1,6 +1,7 @@
# pylint: disable=E1101
from pandas.compat import u, range, map
+from datetime import datetime
import os
import unittest
@@ -306,6 +307,56 @@ def test_reader_closes_file(self):
self.assertTrue(f.closed)
+ def test_reader_special_dtypes(self):
+ _skip_if_no_xlrd()
+
+ expected = DataFrame.from_items([
+ ("IntCol", [1, 2, -3, 4, 0]),
+ ("FloatCol", [1.25, 2.25, 1.83, 1.92, 0.0000000005]),
+ ("BoolCol", [True, False, True, True, False]),
+ ("StrCol", [1, 2, 3, 4, 5]),
+ # GH5394 - this is why convert_float isn't vectorized
+ ("Str2Col", ["a", 3, "c", "d", "e"]),
+ ("DateCol", [datetime(2013, 10, 30), datetime(2013, 10, 31),
+ datetime(1905, 1, 1), datetime(2013, 12, 14),
+ datetime(2015, 3, 14)])
+ ])
+
+ xlsx_path = os.path.join(self.dirpath, 'test_types.xlsx')
+ xls_path = os.path.join(self.dirpath, 'test_types.xls')
+
+ # should read in correctly and infer types
+ for path in (xls_path, xlsx_path):
+ actual = read_excel(path, 'Sheet1')
+ tm.assert_frame_equal(actual, expected)
+
+ # if not coercing number, then int comes in as float
+ float_expected = expected.copy()
+ float_expected["IntCol"] = float_expected["IntCol"].astype(float)
+ float_expected.loc[1, "Str2Col"] = 3.0
+ for path in (xls_path, xlsx_path):
+ actual = read_excel(path, 'Sheet1', convert_float=False)
+ tm.assert_frame_equal(actual, float_expected)
+
+ # check setting Index (assuming xls and xlsx are the same here)
+ for icol, name in enumerate(expected.columns):
+ actual = read_excel(xlsx_path, 'Sheet1', index_col=icol)
+ actual2 = read_excel(xlsx_path, 'Sheet1', index_col=name)
+ exp = expected.set_index(name)
+ tm.assert_frame_equal(actual, exp)
+ tm.assert_frame_equal(actual2, exp)
+
+ # convert_float and converters should be different but both accepted
+ expected["StrCol"] = expected["StrCol"].apply(str)
+ actual = read_excel(xlsx_path, 'Sheet1', converters={"StrCol": str})
+ tm.assert_frame_equal(actual, expected)
+
+ no_convert_float = float_expected.copy()
+ no_convert_float["StrCol"] = no_convert_float["StrCol"].apply(str)
+ actual = read_excel(xlsx_path, 'Sheet1', converters={"StrCol": str},
+ convert_float=False)
+ tm.assert_frame_equal(actual, no_convert_float)
+
class ExcelWriterBase(SharedItems):
# Base class for test cases to run with different Excel writers.
@@ -390,7 +441,7 @@ def test_roundtrip(self):
tm.assert_frame_equal(self.frame, recons)
self.frame.to_excel(path, 'test1', na_rep='88')
- recons = read_excel(path, 'test1', index_col=0, na_values=[88,88.0])
+ recons = read_excel(path, 'test1', index_col=0, na_values=[88, 88.0])
tm.assert_frame_equal(self.frame, recons)
def test_mixed(self):
@@ -417,6 +468,16 @@ def test_tsframe(self):
recons = reader.parse('test1')
tm.assert_frame_equal(df, recons)
+ def test_basics_with_nan(self):
+ _skip_if_no_xlrd()
+ ext = self.ext
+ path = '__tmp_to_excel_from_excel_int_types__.' + ext
+ self.frame['A'][:5] = nan
+ self.frame.to_excel(path, 'test1')
+ self.frame.to_excel(path, 'test1', cols=['A', 'B'])
+ self.frame.to_excel(path, 'test1', header=False)
+ self.frame.to_excel(path, 'test1', index=False)
+
def test_int_types(self):
_skip_if_no_xlrd()
ext = self.ext
@@ -425,20 +486,22 @@ def test_int_types(self):
for np_type in (np.int8, np.int16, np.int32, np.int64):
with ensure_clean(path) as path:
- self.frame['A'][:5] = nan
-
- self.frame.to_excel(path, 'test1')
- self.frame.to_excel(path, 'test1', cols=['A', 'B'])
- self.frame.to_excel(path, 'test1', header=False)
- self.frame.to_excel(path, 'test1', index=False)
-
- # Test np.int values read come back as float.
+ # Test np.int values read come back as int (rather than float
+ # which is Excel's format).
frame = DataFrame(np.random.randint(-10, 10, size=(10, 2)),
dtype=np_type)
frame.to_excel(path, 'test1')
reader = ExcelFile(path)
- recons = reader.parse('test1').astype(np_type)
- tm.assert_frame_equal(frame, recons, check_dtype=False)
+ recons = reader.parse('test1')
+ int_frame = frame.astype(int)
+ tm.assert_frame_equal(int_frame, recons)
+ recons2 = read_excel(path, 'test1')
+ tm.assert_frame_equal(int_frame, recons2)
+
+ # test with convert_float=False comes back as float
+ float_frame = frame.astype(float)
+ recons = read_excel(path, 'test1', convert_float=False)
+ tm.assert_frame_equal(recons, float_frame)
def test_float_types(self):
_skip_if_no_xlrd()
@@ -447,13 +510,6 @@ def test_float_types(self):
for np_type in (np.float16, np.float32, np.float64):
with ensure_clean(path) as path:
- self.frame['A'][:5] = nan
-
- self.frame.to_excel(path, 'test1')
- self.frame.to_excel(path, 'test1', cols=['A', 'B'])
- self.frame.to_excel(path, 'test1', header=False)
- self.frame.to_excel(path, 'test1', index=False)
-
# Test np.float values read come back as float.
frame = DataFrame(np.random.random_sample(10), dtype=np_type)
frame.to_excel(path, 'test1')
@@ -468,13 +524,6 @@ def test_bool_types(self):
for np_type in (np.bool8, np.bool_):
with ensure_clean(path) as path:
- self.frame['A'][:5] = nan
-
- self.frame.to_excel(path, 'test1')
- self.frame.to_excel(path, 'test1', cols=['A', 'B'])
- self.frame.to_excel(path, 'test1', header=False)
- self.frame.to_excel(path, 'test1', index=False)
-
# Test np.bool values read come back as float.
frame = (DataFrame([1, 0, True, False], dtype=np_type))
frame.to_excel(path, 'test1')
@@ -1007,11 +1056,11 @@ def test_ExcelWriter_dispatch(self):
writer = ExcelWriter('apple.xls')
tm.assert_isinstance(writer, _XlwtWriter)
-
def test_register_writer(self):
# some awkward mocking to test out dispatch and such actually works
called_save = []
called_write_cells = []
+
class DummyClass(ExcelWriter):
called_save = False
called_write_cells = False
| Adds a convert_float=True kwarg to read_excel and parse.
All Excel numeric data is stored as floats, so have to convert it specifically.
Changing default because it's suprising to save something with what looks like
a row/column of integers and get a column of floats instead. (especially
because it can lead to annoying Float64Indexes)
Resolves recent ML issue too...
| https://api.github.com/repos/pandas-dev/pandas/pulls/5394 | 2013-10-31T00:56:03Z | 2013-11-01T02:52:15Z | 2013-11-01T02:52:15Z | 2021-06-09T03:27:30Z |
BUG: groupby with a Float like index misbehaving when the index is non-monotonic (related GH5375) | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 0ef2c29af8139..13d8af52ee0dd 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -345,7 +345,7 @@ API Changes
indexing and slicing work exactly the same. Indexing on other index types
are preserved (and positional fallback for ``[],ix``), with the exception,
that floating point slicing on indexes on non ``Float64Index`` will raise a
- ``TypeError``, e.g. ``Series(range(5))[3.5:4.5]`` (:issue:`263`)
+ ``TypeError``, e.g. ``Series(range(5))[3.5:4.5]`` (:issue:`263`,:issue:`5375`)
- Make Categorical repr nicer (:issue:`4368`)
- Remove deprecated ``Factor`` (:issue:`3650`)
- Remove deprecated ``set_printoptions/reset_printoptions`` (:issue:``3046``)
diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py
index e5447e5f8f58f..4beb6ecf1a63b 100644
--- a/pandas/core/groupby.py
+++ b/pandas/core/groupby.py
@@ -2435,7 +2435,7 @@ def _get_sorted_data(self):
return self.data.take(self.sort_idx, axis=self.axis, convert=False)
def _chop(self, sdata, slice_obj):
- return sdata[slice_obj]
+ return sdata.iloc[slice_obj]
def apply(self, f):
raise NotImplementedError
@@ -2470,7 +2470,7 @@ def fast_apply(self, f, names):
def _chop(self, sdata, slice_obj):
if self.axis == 0:
- return sdata[slice_obj]
+ return sdata.iloc[slice_obj]
else:
return sdata._slice(slice_obj, axis=1) # ix[:, slice_obj]
diff --git a/pandas/tests/test_groupby.py b/pandas/tests/test_groupby.py
index 29f64090ddb11..f71d7ff9d096b 100644
--- a/pandas/tests/test_groupby.py
+++ b/pandas/tests/test_groupby.py
@@ -202,6 +202,20 @@ def test_first_last_nth_dtypes(self):
f = s.groupby(level=0).first()
self.assert_(f.dtype == 'int64')
+ def test_grouper_index_types(self):
+ # related GH5375
+ # groupby misbehaving when using a Floatlike index
+ df = DataFrame(np.arange(10).reshape(5,2),columns=list('AB'))
+ for index in [ tm.makeFloatIndex, tm.makeStringIndex,
+ tm.makeUnicodeIndex, tm.makeIntIndex,
+ tm.makeDateIndex, tm.makePeriodIndex ]:
+
+ df.index = index(len(df))
+ df.groupby(list('abcde')).apply(lambda x: x)
+
+ df.index = list(reversed(df.index.tolist()))
+ df.groupby(list('abcde')).apply(lambda x: x)
+
def test_grouper_iter(self):
self.assertEqual(sorted(self.df.groupby('A').grouper), ['bar', 'foo'])
| related #5375
| https://api.github.com/repos/pandas-dev/pandas/pulls/5393 | 2013-10-31T00:19:00Z | 2013-10-31T00:30:26Z | 2013-10-31T00:30:26Z | 2014-07-16T08:38:13Z |
API: raise/warn SettingWithCopy when chained assignment is detected | diff --git a/doc/source/indexing.rst b/doc/source/indexing.rst
index e03d10b045824..b95c515831f55 100644
--- a/doc/source/indexing.rst
+++ b/doc/source/indexing.rst
@@ -1330,24 +1330,34 @@ indexing operation, the result will be a copy. With single label / scalar
indexing and slicing, e.g. ``df.ix[3:6]`` or ``df.ix[:, 'A']``, a view will be
returned.
-In chained expressions, the order may determine whether a copy is returned or not:
+In chained expressions, the order may determine whether a copy is returned or not.
+If an expression will set values on a copy of a slice, then a ``SettingWithCopy``
+exception will be raised (this raise/warn behavior is new starting in 0.13.0)
-.. ipython:: python
+You can control the action of a chained assignment via the option ``mode.chained_assignment``,
+which can take the values ``['raise','warn',None]``, where showing a warning is the default.
+.. ipython:: python
dfb = DataFrame({'a' : ['one', 'one', 'two',
'three', 'two', 'one', 'six'],
- 'b' : ['x', 'y', 'y',
- 'x', 'y', 'x', 'x'],
- 'c' : randn(7)})
-
-
- # goes to copy (will be lost)
- dfb[dfb.a.str.startswith('o')]['c'] = 42
+ 'c' : np.arange(7)})
# passed via reference (will stay)
dfb['c'][dfb.a.str.startswith('o')] = 42
+This however is operating on a copy and will not work.
+
+::
+
+ >>> pd.set_option('mode.chained_assignment','warn')
+ >>> dfb[dfb.a.str.startswith('o')]['c'] = 42
+ Traceback (most recent call last)
+ ...
+ SettingWithCopyWarning:
+ A value is trying to be set on a copy of a slice from a DataFrame.
+ Try using .loc[row_index,col_indexer] = value instead
+
A chained assignment can also crop up in setting in a mixed dtype frame.
.. note::
@@ -1359,28 +1369,35 @@ This is the correct access method
.. ipython:: python
dfc = DataFrame({'A':['aaa','bbb','ccc'],'B':[1,2,3]})
- dfc_copy = dfc.copy()
- dfc_copy.loc[0,'A'] = 11
- dfc_copy
+ dfc.loc[0,'A'] = 11
+ dfc
This *can* work at times, but is not guaranteed, and so should be avoided
.. ipython:: python
- dfc_copy = dfc.copy()
- dfc_copy['A'][0] = 111
- dfc_copy
+ dfc = dfc.copy()
+ dfc['A'][0] = 111
+ dfc
This will **not** work at all, and so should be avoided
-.. ipython:: python
+::
+
+ >>> pd.set_option('mode.chained_assignment','raise')
+ >>> dfc.loc[0]['A'] = 1111
+ Traceback (most recent call last)
+ ...
+ SettingWithCopyException:
+ A value is trying to be set on a copy of a slice from a DataFrame.
+ Try using .loc[row_index,col_indexer] = value instead
+
+.. warning::
- dfc_copy = dfc.copy()
- dfc_copy.loc[0]['A'] = 1111
- dfc_copy
+ The chained assignment warnings / exceptions are aiming to inform the user of a possibly invalid
+ assignment. There may be false positives; situations where a chained assignment is inadvertantly
+ reported.
-When assigning values to subsets of your data, thus, make sure to either use the
-pandas access methods or explicitly handle the assignment creating a copy.
Fallback indexing
-----------------
diff --git a/doc/source/release.rst b/doc/source/release.rst
index 926e8f1d0c5ea..2e9654b2131f1 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -396,6 +396,9 @@ API Changes
3 4.000000
dtype: float64
+ - raise/warn ``SettingWithCopyError/Warning`` exception/warning when setting of a
+ copy thru chained assignment is detected, settable via option ``mode.chained_assignment``
+
Internal Refactoring
~~~~~~~~~~~~~~~~~~~~
diff --git a/doc/source/v0.13.0.txt b/doc/source/v0.13.0.txt
index c736a52cd1e71..b3f831af35339 100644
--- a/doc/source/v0.13.0.txt
+++ b/doc/source/v0.13.0.txt
@@ -104,6 +104,34 @@ API changes
- ``Series`` and ``DataFrame`` now have a ``mode()`` method to calculate the
statistical mode(s) by axis/Series. (:issue:`5367`)
+- Chained assignment will now by default warn if the user is assigning to a copy. This can be changed
+ with he option ``mode.chained_assignment``, allowed options are ``raise/warn/None``. See :ref:`the docs<indexing.view_versus_copy>`.
+
+ .. ipython:: python
+
+ dfc = DataFrame({'A':['aaa','bbb','ccc'],'B':[1,2,3]})
+ pd.set_option('chained_assignment','warn')
+
+ The following warning / exception will show if this is attempted.
+
+ .. ipython:: python
+
+ dfc.loc[0]['A'] = 1111
+
+ ::
+
+ Traceback (most recent call last)
+ ...
+ SettingWithCopyWarning:
+ A value is trying to be set on a copy of a slice from a DataFrame.
+ Try using .loc[row_index,col_indexer] = value instead
+
+ Here is the correct method of assignment.
+
+ .. ipython:: python
+
+ dfc.loc[0,'A'] = 11
+ dfc
Prior Version Deprecations/Changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/pandas/core/common.py b/pandas/core/common.py
index e89ae44dacd31..453227aec6e23 100644
--- a/pandas/core/common.py
+++ b/pandas/core/common.py
@@ -26,6 +26,11 @@
class PandasError(Exception):
pass
+class SettingWithCopyError(ValueError):
+ pass
+
+class SettingWithCopyWarning(Warning):
+ pass
class AmbiguousIndexError(PandasError, KeyError):
pass
diff --git a/pandas/core/config.py b/pandas/core/config.py
index 9de596142e7e0..20ec30398fd64 100644
--- a/pandas/core/config.py
+++ b/pandas/core/config.py
@@ -512,6 +512,13 @@ def _get_root(key):
cursor = cursor[p]
return cursor, path[-1]
+def _get_option_fast(key):
+ """ internal quick access routine, no error checking """
+ path = key.split('.')
+ cursor = _global_config
+ for p in path:
+ cursor = cursor[p]
+ return cursor
def _is_deprecated(key):
""" Returns True if the given option has been deprecated """
diff --git a/pandas/core/config_init.py b/pandas/core/config_init.py
index 13f7a3dbe7d4a..1275a5463cbe3 100644
--- a/pandas/core/config_init.py
+++ b/pandas/core/config_init.py
@@ -271,7 +271,6 @@ def mpl_style_cb(key):
# We don't want to start importing everything at the global context level
# or we'll hit circular deps.
-
def use_inf_as_null_cb(key):
from pandas.core.common import _use_inf_as_null
_use_inf_as_null(key)
@@ -281,6 +280,17 @@ def use_inf_as_null_cb(key):
cb=use_inf_as_null_cb)
+# user warnings
+chained_assignment = """
+: string
+ Raise an exception, warn, or no action if trying to use chained assignment, The default is warn
+"""
+
+with cf.config_prefix('mode'):
+ cf.register_option('chained_assignment', 'warn', chained_assignment,
+ validator=is_one_of_factory([None, 'warn', 'raise']))
+
+
# Set up the io.excel specific configuration.
writer_engine_doc = """
: string
diff --git a/pandas/core/frame.py b/pandas/core/frame.py
index 1e843e40037b1..280203fa65232 100644
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -1547,12 +1547,9 @@ def _ixs(self, i, axis=0, copy=False):
i = _maybe_convert_indices(i, len(self._get_axis(axis)))
return self.reindex(i, takeable=True)
else:
- try:
- new_values = self._data.fast_2d_xs(i, copy=copy)
- except:
- new_values = self._data.fast_2d_xs(i, copy=True)
+ new_values, copy = self._data.fast_2d_xs(i, copy=copy)
return Series(new_values, index=self.columns,
- name=self.index[i])
+ name=self.index[i])._setitem_copy(copy)
# icol
else:
@@ -1892,10 +1889,18 @@ def _set_item(self, key, value):
Series/TimeSeries will be conformed to the DataFrame's index to
ensure homogeneity.
"""
+
+ is_existing = key in self.columns
self._ensure_valid_index(value)
value = self._sanitize_column(key, value)
NDFrame._set_item(self, key, value)
+ # check if we are modifying a copy
+ # try to set first as we want an invalid
+ # value exeption to occur first
+ if is_existing:
+ self._check_setitem_copy()
+
def insert(self, loc, column, value, allow_duplicates=False):
"""
Insert column into DataFrame at specified location.
@@ -2093,13 +2098,16 @@ def xs(self, key, axis=0, level=None, copy=True, drop_level=True):
new_index = self.index[loc]
if np.isscalar(loc):
- new_values = self._data.fast_2d_xs(loc, copy=copy)
- return Series(new_values, index=self.columns,
- name=self.index[loc])
+
+ new_values, copy = self._data.fast_2d_xs(loc, copy=copy)
+ result = Series(new_values, index=self.columns,
+ name=self.index[loc])._setitem_copy(copy)
+
else:
result = self[loc]
result.index = new_index
- return result
+
+ return result
_xs = xs
diff --git a/pandas/core/generic.py b/pandas/core/generic.py
index b5e526e42a547..30dccb971ae18 100644
--- a/pandas/core/generic.py
+++ b/pandas/core/generic.py
@@ -19,9 +19,11 @@
from pandas import compat, _np_version_under1p7
from pandas.compat import map, zip, lrange, string_types, isidentifier
from pandas.core.common import (isnull, notnull, is_list_like,
- _values_from_object, _maybe_promote, ABCSeries)
+ _values_from_object, _maybe_promote, ABCSeries,
+ SettingWithCopyError, SettingWithCopyWarning)
import pandas.core.nanops as nanops
from pandas.util.decorators import Appender, Substitution
+from pandas.core import config
# goal is to be able to define the docs close to function, while still being
# able to share
@@ -69,7 +71,7 @@ class NDFrame(PandasObject):
copy : boolean, default False
"""
_internal_names = [
- '_data', 'name', '_cacher', '_subtyp', '_index', '_default_kind', '_default_fill_value']
+ '_data', 'name', '_cacher', '_is_copy', '_subtyp', '_index', '_default_kind', '_default_fill_value']
_internal_names_set = set(_internal_names)
_metadata = []
@@ -85,6 +87,7 @@ def __init__(self, data, axes=None, copy=False, dtype=None, fastpath=False):
for i, ax in enumerate(axes):
data = data.reindex_axis(ax, axis=i)
+ object.__setattr__(self, '_is_copy', False)
object.__setattr__(self, '_data', data)
object.__setattr__(self, '_item_cache', {})
@@ -988,6 +991,22 @@ def _set_item(self, key, value):
self._data.set(key, value)
self._clear_item_cache()
+ def _setitem_copy(self, copy):
+ """ set the _is_copy of the iiem """
+ self._is_copy = copy
+ return self
+
+ def _check_setitem_copy(self):
+ """ validate if we are doing a settitem on a chained copy """
+ if self._is_copy:
+ value = config._get_option_fast('mode.chained_assignment')
+
+ t = "A value is trying to be set on a copy of a slice from a DataFrame.\nTry using .loc[row_index,col_indexer] = value instead"
+ if value == 'raise':
+ raise SettingWithCopyError(t)
+ elif value == 'warn':
+ warnings.warn(t,SettingWithCopyWarning)
+
def __delitem__(self, key):
"""
Delete item
@@ -1049,7 +1068,7 @@ def take(self, indices, axis=0, convert=True):
new_data = self._data.reindex_axis(new_items, indexer=indices, axis=0)
else:
new_data = self._data.take(indices, axis=baxis)
- return self._constructor(new_data).__finalize__(self)
+ return self._constructor(new_data)._setitem_copy(True).__finalize__(self)
# TODO: Check if this was clearer in 0.12
def select(self, crit, axis=0):
diff --git a/pandas/core/internals.py b/pandas/core/internals.py
index 62aa95d270924..ae22d3d406c7e 100644
--- a/pandas/core/internals.py
+++ b/pandas/core/internals.py
@@ -2567,22 +2567,20 @@ def fast_2d_xs(self, loc, copy=False):
"""
get a cross sectional for a given location in the
items ; handle dups
+
+ return the result and a flag if a copy was actually made
"""
if len(self.blocks) == 1:
result = self.blocks[0].values[:, loc]
if copy:
result = result.copy()
- return result
-
- if not copy:
- raise TypeError('cannot get view of mixed-type or '
- 'non-consolidated DataFrame')
+ return result, copy
items = self.items
# non-unique (GH4726)
if not items.is_unique:
- return self._interleave(items).ravel()
+ return self._interleave(items).ravel(), True
# unique
dtype = _interleaved_dtype(self.blocks)
@@ -2593,7 +2591,7 @@ def fast_2d_xs(self, loc, copy=False):
i = items.get_loc(item)
result[i] = blk._try_coerce_result(blk.iget((j, loc)))
- return result
+ return result, True
def consolidate(self):
"""
diff --git a/pandas/core/series.py b/pandas/core/series.py
index e62bf2f36d209..3e8202c7ec0b6 100644
--- a/pandas/core/series.py
+++ b/pandas/core/series.py
@@ -22,7 +22,8 @@
_values_from_object,
_possibly_cast_to_datetime, _possibly_castable,
_possibly_convert_platform,
- ABCSparseArray, _maybe_match_name, _ensure_object)
+ ABCSparseArray, _maybe_match_name, _ensure_object,
+ SettingWithCopyError)
from pandas.core.index import (Index, MultiIndex, InvalidIndexError,
_ensure_index, _handle_legacy_indexes)
@@ -575,6 +576,8 @@ def __setitem__(self, key, value):
try:
self._set_with_engine(key, value)
return
+ except (SettingWithCopyError):
+ raise
except (KeyError, ValueError):
values = self.values
if (com.is_integer(key)
@@ -623,6 +626,7 @@ def _set_with_engine(self, key, value):
values = self.values
try:
self.index._engine.set_value(values, key, value)
+ self._check_setitem_copy()
return
except KeyError:
values[self.index.get_loc(key)] = value
diff --git a/pandas/tests/test_frame.py b/pandas/tests/test_frame.py
index e0abe7700f28d..ffc40ffbadc39 100644
--- a/pandas/tests/test_frame.py
+++ b/pandas/tests/test_frame.py
@@ -11059,9 +11059,11 @@ def test_xs_view(self):
dm.xs(2)[:] = 10
self.assert_((dm.xs(2) == 5).all())
+ # prior to chained assignment (GH5390)
+ # this would raise, but now just rrens a copy (and sets _is_copy)
# TODO (?): deal with mixed-type fiasco?
- with assertRaisesRegexp(TypeError, 'cannot get view of mixed-type'):
- self.mixed_frame.xs(self.mixed_frame.index[2], copy=False)
+ # with assertRaisesRegexp(TypeError, 'cannot get view of mixed-type'):
+ # self.mixed_frame.xs(self.mixed_frame.index[2], copy=False)
# unconsolidated
dm['foo'] = 6.
diff --git a/pandas/tests/test_indexing.py b/pandas/tests/test_indexing.py
index 2ad9f10d1b990..5732d2ad56a4f 100644
--- a/pandas/tests/test_indexing.py
+++ b/pandas/tests/test_indexing.py
@@ -987,6 +987,7 @@ def f():
NUM_COLS = 10
col_names = ['A'+num for num in map(str,np.arange(NUM_COLS).tolist())]
index_cols = col_names[:5]
+
df = DataFrame(np.random.randint(5, size=(NUM_ROWS,NUM_COLS)), dtype=np.int64, columns=col_names)
df = df.set_index(index_cols).sort_index()
grp = df.groupby(level=index_cols[:4])
@@ -1680,6 +1681,61 @@ def test_setitem_cache_updating(self):
self.assert_(df.ix[0,'c'] == 0.0)
self.assert_(df.ix[7,'c'] == 1.0)
+ def test_detect_chained_assignment(self):
+
+ pd.set_option('chained_assignment','raise')
+
+ # work with the chain
+ expected = DataFrame([[-5,1],[-6,3]],columns=list('AB'))
+ df = DataFrame(np.arange(4).reshape(2,2),columns=list('AB'))
+ self.assert_(not df._is_copy)
+
+ df['A'][0] = -5
+ df['A'][1] = -6
+ assert_frame_equal(df, expected)
+
+ expected = DataFrame([[-5,2],[np.nan,3.]],columns=list('AB'))
+ df = DataFrame({ 'A' : np.arange(2), 'B' : np.array(np.arange(2,4),dtype=np.float64)})
+ self.assert_(not df._is_copy)
+ df['A'][0] = -5
+ df['A'][1] = np.nan
+ assert_frame_equal(df, expected)
+ self.assert_(not df['A']._is_copy)
+
+ # using a copy (the chain), fails
+ df = DataFrame({ 'A' : np.arange(2), 'B' : np.array(np.arange(2,4),dtype=np.float64)})
+ def f():
+ df.loc[0]['A'] = -5
+ self.assertRaises(com.SettingWithCopyError, f)
+
+ # doc example
+ df = DataFrame({'a' : ['one', 'one', 'two',
+ 'three', 'two', 'one', 'six'],
+ 'c' : np.arange(7) })
+ self.assert_(not df._is_copy)
+ expected = DataFrame({'a' : ['one', 'one', 'two',
+ 'three', 'two', 'one', 'six'],
+ 'c' : [42,42,2,3,4,42,6]})
+
+ def f():
+ df[df.a.str.startswith('o')]['c'] = 42
+ self.assertRaises(com.SettingWithCopyError, f)
+ df['c'][df.a.str.startswith('o')] = 42
+ assert_frame_equal(df,expected)
+
+ expected = DataFrame({'A':[111,'bbb','ccc'],'B':[1,2,3]})
+ df = DataFrame({'A':['aaa','bbb','ccc'],'B':[1,2,3]})
+ df['A'][0] = 111
+ def f():
+ df.loc[0]['A'] = 111
+ self.assertRaises(com.SettingWithCopyError, f)
+ assert_frame_equal(df,expected)
+
+ # warnings
+ pd.set_option('chained_assignment','warn')
+ df = DataFrame({'A':['aaa','bbb','ccc'],'B':[1,2,3]})
+ df.loc[0]['A'] = 111
+
def test_floating_index_doc_example(self):
index = Index([1.5, 2, 3, 4.5, 5])
| ```
In [1]: df = DataFrame({"A": [1, 2, 3, 4, 5], "B": [3.125, 4.12, 3.1, 6.2, 7.]})
In [2]: row = df.loc[0]
```
Default is to warn
```
In [3]: row["A"] = 0
pandas/core/generic.py:1001: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_index,col_indexer] = value instead
warnings.warn(t,SettingWithCopyWarning)
In [4]: row
Out[4]:
A 0.000
B 3.125
Name: 0, dtype: float64
In [5]: df
Out[5]:
A B
0 1 3.125
1 2 4.120
2 3 3.100
3 4 6.200
4 5 7.000
```
You can turn it off
```
In [6]: pd.set_option('chained',None)
In [7]: row["A"] = 0
In [8]: row
Out[8]:
A 0.000
B 3.125
Name: 0, dtype: float64
In [9]: df
Out[9]:
A B
0 1 3.125
1 2 4.120
2 3 3.100
3 4 6.200
4 5 7.000
```
Or set to raise
```
In [10]: row["A"] = 0
SettingWithCopyError: A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_index,col_indexer] = value instead
```
| https://api.github.com/repos/pandas-dev/pandas/pulls/5390 | 2013-10-30T21:50:14Z | 2013-11-06T22:24:20Z | 2013-11-06T22:24:20Z | 2014-06-12T12:24:22Z |
ER/API: unicode indices not supported on table formats in py2 (GH5386) | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 4d628fac78cf0..0ef2c29af8139 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -277,6 +277,7 @@ API Changes
- ``numexpr`` 2.2.2 fixes incompatiblity in PyTables 2.4 (:issue:`4908`)
- ``flush`` now accepts an ``fsync`` parameter, which defaults to ``False``
(:issue:`5364`)
+ - ``unicode`` indices not supported on ``table`` formats (:issue:`5386`)
- ``JSON``
- added ``date_unit`` parameter to specify resolution of timestamps.
diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py
index 5919589978903..97dc8dcdec73a 100644
--- a/pandas/io/pytables.py
+++ b/pandas/io/pytables.py
@@ -1919,6 +1919,10 @@ def set_version(self):
def pandas_type(self):
return _ensure_decoded(getattr(self.group._v_attrs, 'pandas_type', None))
+ @property
+ def format_type(self):
+ return 'fixed'
+
def __unicode__(self):
""" return a pretty representation of myself """
self.infer_axes()
@@ -2146,7 +2150,8 @@ def write_index(self, key, index):
self.write_sparse_intindex(key, index)
else:
setattr(self.attrs, '%s_variety' % key, 'regular')
- converted = _convert_index(index, self.encoding).set_name('index')
+ converted = _convert_index(index, self.encoding,
+ self.format_type).set_name('index')
self.write_array(key, converted.values)
node = getattr(self.group, key)
node._v_attrs.kind = converted.kind
@@ -2192,7 +2197,8 @@ def write_multi_index(self, key, index):
index.names)):
# write the level
level_key = '%s_level%d' % (key, i)
- conv_level = _convert_index(lev, self.encoding).set_name(level_key)
+ conv_level = _convert_index(lev, self.encoding,
+ self.format_type).set_name(level_key)
self.write_array(level_key, conv_level.values)
node = getattr(self.group, level_key)
node._v_attrs.kind = conv_level.kind
@@ -2609,6 +2615,10 @@ def __init__(self, *args, **kwargs):
def table_type_short(self):
return self.table_type.split('_')[0]
+ @property
+ def format_type(self):
+ return 'table'
+
def __unicode__(self):
""" return a pretty representatgion of myself """
self.infer_axes()
@@ -2991,7 +3001,7 @@ def create_axes(self, axes, obj, validate=True, nan_rep=None,
if i in axes:
name = obj._AXIS_NAMES[i]
index_axes_map[i] = _convert_index(
- a, self.encoding).set_name(name).set_axis(i)
+ a, self.encoding, self.format_type).set_name(name).set_axis(i)
else:
# we might be able to change the axes on the appending data if
@@ -3823,7 +3833,7 @@ def _get_info(info, name):
idx = info[name] = dict()
return idx
-def _convert_index(index, encoding=None):
+def _convert_index(index, encoding=None, format_type=None):
index_name = getattr(index, 'name', None)
if isinstance(index, DatetimeIndex):
@@ -3870,9 +3880,13 @@ def _convert_index(index, encoding=None):
converted, 'string', _tables().StringCol(itemsize), itemsize=itemsize,
index_name=index_name)
elif inferred_type == 'unicode':
- atom = _tables().ObjectAtom()
- return IndexCol(np.asarray(values, dtype='O'), 'object', atom,
- index_name=index_name)
+ if format_type == 'fixed':
+ atom = _tables().ObjectAtom()
+ return IndexCol(np.asarray(values, dtype='O'), 'object', atom,
+ index_name=index_name)
+ raise TypeError(
+ "[unicode] is not supported as a in index type for [{0}] formats".format(format_type))
+
elif inferred_type == 'integer':
# take a guess for now, hope the values fit
atom = _tables().Int64Col()
diff --git a/pandas/io/tests/test_pytables.py b/pandas/io/tests/test_pytables.py
index a08073bd7bd35..598f374e0fcf7 100644
--- a/pandas/io/tests/test_pytables.py
+++ b/pandas/io/tests/test_pytables.py
@@ -755,6 +755,38 @@ def test_append_series(self):
store.append('mi', s)
tm.assert_series_equal(store['mi'], s)
+ def test_store_index_types(self):
+ # GH5386
+ # test storing various index types
+
+ with ensure_clean(self.path) as store:
+
+ def check(format,index):
+ df = DataFrame(np.random.randn(10,2),columns=list('AB'))
+ df.index = index(len(df))
+
+ _maybe_remove(store, 'df')
+ store.put('df',df,format=format)
+ assert_frame_equal(df,store['df'])
+
+ for index in [ tm.makeFloatIndex, tm.makeStringIndex, tm.makeIntIndex,
+ tm.makeDateIndex, tm.makePeriodIndex ]:
+
+ check('table',index)
+ check('fixed',index)
+
+ # unicode
+ index = tm.makeUnicodeIndex
+ if compat.PY3:
+ check('table',index)
+ check('fixed',index)
+ else:
+
+ # only support for fixed types (and they have a perf warning)
+ self.assertRaises(TypeError, check, 'table', index)
+ with tm.assert_produces_warning(expected_warning=PerformanceWarning):
+ check('fixed',index)
+
def test_encoding(self):
if sys.byteorder != 'little':
diff --git a/pandas/util/testing.py b/pandas/util/testing.py
index f40a8e1a5a9d6..2e4d1f3e8df74 100644
--- a/pandas/util/testing.py
+++ b/pandas/util/testing.py
@@ -336,7 +336,8 @@ def ensure_clean(filename=None, return_filelike=False):
yield filename
finally:
try:
- os.remove(filename)
+ if os.path.exists(filename):
+ os.remove(filename)
except Exception as e:
print(e)
| closes #5386
| https://api.github.com/repos/pandas-dev/pandas/pulls/5387 | 2013-10-30T13:20:45Z | 2013-10-30T13:43:13Z | 2013-10-30T13:43:13Z | 2014-06-23T13:40:00Z |
Update offset prefix map | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 49de8dddd7210..32ec73284ea88 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -275,6 +275,7 @@ API Changes
- store `datetime.date` objects as ordinals rather then timetuples to avoid
timezone issues (:issue:`2852`), thanks @tavistmorph and @numpand
- ``numexpr`` 2.2.2 fixes incompatiblity in PyTables 2.4 (:issue:`4908`)
+
- ``JSON``
- added ``date_unit`` parameter to specify resolution of timestamps.
@@ -503,6 +504,7 @@ Bug Fixes
names weren't strings (:issue:`4956`)
- A zero length series written in Fixed format not deserializing properly.
(:issue:`4708`)
+
- Fixed bug in tslib.tz_convert(vals, tz1, tz2): it could raise IndexError
exception while trying to access trans[pos + 1] (:issue:`4496`)
- The ``by`` argument now works correctly with the ``layout`` argument
@@ -755,6 +757,7 @@ Bug Fixes
- Bug when renaming then set_index on a DataFrame (:issue:`5344`)
- Test suite no longer leaves around temporary files when testing graphics. (:issue:`5347`)
(thanks for catching this @yarikoptic!)
+ - Add missing entries to ``tseries.offsets.prefix_mapping`` (:issue: `5382`)
pandas 0.12.0
-------------
diff --git a/pandas/tseries/offsets.py b/pandas/tseries/offsets.py
index 8830d66b245ef..55a05eb677cbb 100644
--- a/pandas/tseries/offsets.py
+++ b/pandas/tseries/offsets.py
@@ -16,8 +16,8 @@
'MonthBegin', 'BMonthBegin', 'MonthEnd', 'BMonthEnd',
'YearBegin', 'BYearBegin', 'YearEnd', 'BYearEnd',
'QuarterBegin', 'BQuarterBegin', 'QuarterEnd', 'BQuarterEnd',
- 'LastWeekOfMonth', 'FY5253Quarter', 'FY5253',
- 'Week', 'WeekOfMonth',
+ 'FY5253Quarter', 'FY5253',
+ 'Week', 'WeekOfMonth', 'LastWeekOfMonth',
'Hour', 'Minute', 'Second', 'Milli', 'Micro', 'Nano']
# convert to/from datetime/timestamp to allow invalid Timestamp ranges to pass thru
@@ -1848,32 +1848,7 @@ def generate_range(start=None, end=None, periods=None,
raise ValueError('Offset %s did not increment date' % offset)
cur = next_date
-prefix_mapping = dict((offset._prefix, offset) for offset in [
- YearBegin, # 'AS'
- YearEnd, # 'A'
- BYearBegin, # 'BAS'
- BYearEnd, # 'BA'
- BusinessDay, # 'B'
- BusinessMonthBegin, # 'BMS'
- BusinessMonthEnd, # 'BM'
- BQuarterEnd, # 'BQ'
- BQuarterBegin, # 'BQS'
- CustomBusinessDay, # 'C'
- MonthEnd, # 'M'
- MonthBegin, # 'MS'
- Week, # 'W'
- Second, # 'S'
- Minute, # 'T'
- Micro, # 'U'
- QuarterEnd, # 'Q'
- QuarterBegin, # 'QS'
- Milli, # 'L'
- Hour, # 'H'
- Day, # 'D'
- WeekOfMonth, # 'WOM'
- FY5253,
- FY5253Quarter,
-])
+prefix_mapping = dict([(locals()[offset]._prefix, offset) for offset in __all__])
if not _np_version_under1p7:
# Only 1.7+ supports nanosecond resolution
| This should address issue #5382
| https://api.github.com/repos/pandas-dev/pandas/pulls/5383 | 2013-10-30T05:08:02Z | 2013-11-01T20:57:08Z | null | 2014-07-01T17:16:52Z |
WIP: Add value_counts() to DataFrame | diff --git a/pandas/core/frame.py b/pandas/core/frame.py
index 0ea53920ffe3c..8ed39f002345b 100644
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -4297,6 +4297,55 @@ def mode(self, axis=0, numeric_only=False):
f = lambda s: s.mode()
return data.apply(f, axis=axis)
+ def value_counts(self, axis=0, normalize=False, sort=True,
+ ascending=False, bins=None, numeric_only=False):
+ """
+ Returns DataFrame containing counts of unique values. The resulting
+ DataFrame will be in descending order so that the first element is the
+ most frequently-occurring element among *all* columns. Excludes NA
+ values. Maintains order along axis (i.e., column/row)
+
+ Parameters
+ ----------
+ axis : {0, 1, 'index', 'columns'} (default 0)
+ 0/'index' : get value_counts by column
+ 1/'columns' : get value_counts by row
+ normalize: boolean, default False
+ If True then the Series returned will contain the relative
+ frequencies of the unique values.
+ sort : boolean, default True
+ Sort by sum of counts across columns (if False, DataFrame will be
+ sorted by union of all the unique values found)
+ ascending : boolean, default False
+ Sort in ascending order
+ bins : integer or sequence of scalars, optional
+ Rather than count values, group them into half-open bins, a
+ convenience for pd.cut, only works with numeric data. If integer,
+ then creates bins based upon overall max and overall min. If
+ passed, assumes numeric_only.
+ numeric_only : bool, default False
+ only apply to numeric columns.
+
+ Returns
+ -------
+ counts : DataFrame
+ """
+ data = self if not numeric_only else self._get_numeric_data()
+ from pandas.tools.tile import _generate_bins
+ if bins is not None and not com._is_sequence(bins):
+ max_val = self.max().max()
+ min_val = self.min().min()
+ bins = _generate_bins(bins=bins, min_val=min_val, max_val=max_val)
+
+ f = lambda s: s.value_counts(normalize=normalize, bins=bins)
+ res = data.apply(f, axis=axis)
+
+ if sort:
+ order = res.sum(1).order(ascending=ascending).index
+ res = res.reindex(order)
+
+ return res
+
def quantile(self, q=0.5, axis=0, numeric_only=True):
"""
Return values at the given quantile over requested axis, a la
diff --git a/pandas/tests/test_frame.py b/pandas/tests/test_frame.py
index 312a5df475d6e..a438ff0b9148e 100644
--- a/pandas/tests/test_frame.py
+++ b/pandas/tests/test_frame.py
@@ -11253,6 +11253,39 @@ def test_count(self):
expected = Series(0, index=[])
assert_series_equal(result, expected)
+ def test_value_counts(self):
+ df = DataFrame({"A": [0, 5, 8, 10, 13], "B": [4, 16, 2, 30, 10]})
+ expected = DataFrame({"A": pd.Series([1, 1, 1, 1, 1],
+ index=[0, 5, 8, 10, 13]),
+ "B": pd.Series([1, 1, 1, 1, 1],
+ index=[4, 16, 2, 30, 10])})
+ expected = expected.reindex([10, 30, 16, 13, 8, 5, 4, 2, 0])
+ assert_frame_equal(df.value_counts(), expected)
+ df = DataFrame({"A": ['a', 'a', 'a', 'c', 'd', 'e'],
+ "B": ['e', 'c', 'd', 'x', 'y', 'a']})
+ actual = df.value_counts()
+ expected = DataFrame({"A": Series([3, 1, 1, 1], index=['a', 'e', 'd',
+ 'c']),
+ "B": Series([1, 1, 1, 1, 1, 1],
+ index=['e', 'c', 'd', 'x', 'y',
+ 'a'])})
+ expected = expected.ix[expected.sum(1).order(ascending=False).index]
+ assert_frame_equal(actual, expected)
+
+ # finally, with bins
+
+ # levels = Index(['(-0.03, 3]', '(3, 6]', '(6, 9]', '(9, 12]',
+ # '(12, 15]', '(15, 18]', '(18, 21]', '(21, 24]',
+ # '(24, 27]', '(27, 30]'], dtype=object)
+ bins = [-0.03, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30]
+ actual = df.value_counts(bins=bins)
+ expected = DataFrame({
+ "A": pd.cut(df["A"], bins=bins).value_counts(),
+ "B": pd.cut(df["B"], bins=bins).value_counts()
+ })
+ expected = expected.ix[expected.sum(1).order(ascending=False).index]
+ assert_frame_equal(actual, expected)
+
def test_sum(self):
self._check_stat_op('sum', np.sum, has_numeric_only=True)
diff --git a/pandas/tools/tile.py b/pandas/tools/tile.py
index 6830919d9c09f..1a279ce494b88 100644
--- a/pandas/tools/tile.py
+++ b/pandas/tools/tile.py
@@ -12,6 +12,60 @@
import numpy as np
+def _generate_bins(x=None, bins=None, min_val=None, max_val=None, right=True):
+ """
+ Generate bins for cut, must either pass x (an array-like) or a min and max
+ value. If min or max are passed, ignores x.
+
+ Adds .1% space around bins if integer.
+ """
+ if bins is None:
+ raise ValueError("bins cannot be None.")
+ # ignore x if min and max are passed
+ if min_val is not None or max_val is not None:
+ assert min_val is not None and max_val is not None, (
+ "Must pass *both* min_val and max_val")
+ else:
+ assert x is not None, "Must pass either min/max vals or array-like"
+
+ # NOTE: this binning code is changed a bit from histogram for var(x) == 0
+ if not np.iterable(bins):
+ if np.isscalar(bins) and bins < 1:
+ raise ValueError("`bins` should be a positive integer.")
+ if min_val is not None:
+ mn, mx = min_val, max_val
+ else:
+ try: # for array-like
+ sz = x.size
+ except AttributeError:
+ x = np.asarray(x)
+ sz = x.size
+ if sz == 0:
+ raise ValueError('Cannot cut empty array')
+ # handle empty arrays. Can't determine range, so use 0-1.
+ # rng = (0, 1)
+ else:
+ rng = (nanops.nanmin(x), nanops.nanmax(x))
+ mn, mx = [mi + 0.0 for mi in rng]
+
+ if mn == mx: # adjust end points before binning
+ mn -= .001 * mn
+ mx += .001 * mx
+ bins = np.linspace(mn, mx, bins + 1, endpoint=True)
+ else: # adjust end points after binning
+ bins = np.linspace(mn, mx, bins + 1, endpoint=True)
+ adj = (mx - mn) * 0.001 # 0.1% of the range
+ if right:
+ bins[0] -= adj
+ else:
+ bins[-1] += adj
+
+ else:
+ bins = np.asarray(bins)
+ if (np.diff(bins) < 0).any():
+ raise ValueError('bins must increase monotonically.')
+ return bins
+
def cut(x, bins, right=True, labels=None, retbins=False, precision=3,
include_lowest=False):
@@ -75,39 +129,10 @@ def cut(x, bins, right=True, labels=None, retbins=False, precision=3,
>>> pd.cut(np.ones(5), 4, labels=False)
array([1, 1, 1, 1, 1], dtype=int64)
"""
- # NOTE: this binning code is changed a bit from histogram for var(x) == 0
- if not np.iterable(bins):
- if np.isscalar(bins) and bins < 1:
- raise ValueError("`bins` should be a positive integer.")
- try: # for array-like
- sz = x.size
- except AttributeError:
- x = np.asarray(x)
- sz = x.size
- if sz == 0:
- raise ValueError('Cannot cut empty array')
- # handle empty arrays. Can't determine range, so use 0-1.
- # rng = (0, 1)
- else:
- rng = (nanops.nanmin(x), nanops.nanmax(x))
- mn, mx = [mi + 0.0 for mi in rng]
+ if x is None:
+ raise TypeError("Must pass array-like as first argument, not None")
- if mn == mx: # adjust end points before binning
- mn -= .001 * mn
- mx += .001 * mx
- bins = np.linspace(mn, mx, bins + 1, endpoint=True)
- else: # adjust end points after binning
- bins = np.linspace(mn, mx, bins + 1, endpoint=True)
- adj = (mx - mn) * 0.001 # 0.1% of the range
- if right:
- bins[0] -= adj
- else:
- bins[-1] += adj
-
- else:
- bins = np.asarray(bins)
- if (np.diff(bins) < 0).any():
- raise ValueError('bins must increase monotonically.')
+ bins = _generate_bins(x, bins, right=right)
return _bins_to_cuts(x, bins, right=right, labels=labels,retbins=retbins, precision=precision,
include_lowest=include_lowest)
| - abstract bin generation from cut to use elsewhere. Panel goes to ndarray on
apply so that's a future TODO.
I'm relatively certain that this works, but I don't have explicit tests
for it. I'm hoping others who are interested (cough cough @rockg) will
be willing to create some of them. Key to test are that binning,
normalization and sorting all work correctly.
Will close #5377 when completed.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5381 | 2013-10-30T03:43:00Z | 2015-01-18T21:39:35Z | null | 2015-01-18T21:39:35Z |
ENH: Add mode method to Series and DataFrame | diff --git a/doc/source/api.rst b/doc/source/api.rst
index 20bfe037f7373..c2c2bc8710af2 100644
--- a/doc/source/api.rst
+++ b/doc/source/api.rst
@@ -348,6 +348,7 @@ Computations / Descriptive Stats
Series.mean
Series.median
Series.min
+ Series.mode
Series.nunique
Series.pct_change
Series.prod
@@ -632,6 +633,7 @@ Computations / Descriptive Stats
DataFrame.mean
DataFrame.median
DataFrame.min
+ DataFrame.mode
DataFrame.pct_change
DataFrame.prod
DataFrame.quantile
diff --git a/doc/source/basics.rst b/doc/source/basics.rst
index 78b0a54b8893f..19f293561efb7 100644
--- a/doc/source/basics.rst
+++ b/doc/source/basics.rst
@@ -378,6 +378,7 @@ optional ``level`` parameter which applies only if the object has a
``median``, Arithmetic median of values
``min``, Minimum
``max``, Maximum
+ ``mode``, Mode
``abs``, Absolute Value
``prod``, Product of values
``std``, Unbiased standard deviation
@@ -473,8 +474,8 @@ value, ``idxmin`` and ``idxmax`` return the first matching index:
.. _basics.discretization:
-Value counts (histogramming)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Value counts (histogramming) / Mode
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ``value_counts`` Series method and top-level function computes a histogram
of a 1D array of values. It can also be used as a function on regular arrays:
@@ -487,6 +488,17 @@ of a 1D array of values. It can also be used as a function on regular arrays:
s.value_counts()
value_counts(data)
+Similarly, you can get the most frequently occuring value(s) (the mode) of the values in a Series or DataFrame:
+
+.. ipython:: python
+
+ data = [1, 1, 3, 3, 3, 5, 5, 7, 7, 7]
+ s = Series(data)
+ s.mode()
+ df = pd.DataFrame({"A": np.random.randint(0, 7, size=50),
+ "B": np.random.randint(-10, 15, size=50)})
+ df.mode()
+
Discretization and quantiling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -514,6 +526,7 @@ normally distributed data into equal-size quartiles like so:
value_counts(factor)
We can also pass infinite values to define the bins:
+
.. ipython:: python
arr = np.random.randn(20)
diff --git a/doc/source/release.rst b/doc/source/release.rst
index 4b33c20424b33..5fef061b9e447 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -65,6 +65,8 @@ New features
string via the ``date_format`` keyword (:issue:`4313`)
- Added ``LastWeekOfMonth`` DateOffset (:issue:`4637`)
- Added ``FY5253``, and ``FY5253Quarter`` DateOffsets (:issue:`4511`)
+ - Added ``mode()`` method to ``Series`` and ``DataFrame`` to get the
+ statistical mode(s) of a column/series. (:issue:`5367`)
Experimental Features
~~~~~~~~~~~~~~~~~~~~~
diff --git a/doc/source/v0.13.0.txt b/doc/source/v0.13.0.txt
index 27794d6af1a8d..9b958d59d5a74 100644
--- a/doc/source/v0.13.0.txt
+++ b/doc/source/v0.13.0.txt
@@ -81,6 +81,8 @@ API changes
``SparsePanel``, etc.), now support the entire set of arithmetic operators
and arithmetic flex methods (add, sub, mul, etc.). ``SparsePanel`` does not
support ``pow`` or ``mod`` with non-scalars. (:issue:`3765`)
+- ``Series`` and ``DataFrame`` now have a ``mode()`` method to calculate the
+ statistical mode(s) by axis/Series. (:issue:`5367`)
Prior Version Deprecations/Changes
diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py
index 5778a524a584a..6ab6f15aaab15 100644
--- a/pandas/core/algorithms.py
+++ b/pandas/core/algorithms.py
@@ -3,6 +3,7 @@
intended for public consumption
"""
+from warnings import warn
import numpy as np
import pandas.core.common as com
@@ -221,6 +222,41 @@ def value_counts(values, sort=True, ascending=False, normalize=False, bins=None)
return result
+def mode(values):
+ "Returns the mode or mode(s) of the passed Series or ndarray (sorted)"
+ # must sort because hash order isn't necessarily defined.
+ from pandas.core.series import Series
+
+ if isinstance(values, Series):
+ constructor = values._constructor
+ values = values.values
+ else:
+ values = np.asanyarray(values)
+ constructor = Series
+
+ dtype = values.dtype
+ if com.is_integer_dtype(values.dtype):
+ values = com._ensure_int64(values)
+ result = constructor(sorted(htable.mode_int64(values)), dtype=dtype)
+
+ elif issubclass(values.dtype.type, (np.datetime64,np.timedelta64)):
+ dtype = values.dtype
+ values = values.view(np.int64)
+ result = constructor(sorted(htable.mode_int64(values)), dtype=dtype)
+
+ else:
+ mask = com.isnull(values)
+ values = com._ensure_object(values)
+ res = htable.mode_object(values, mask)
+ try:
+ res = sorted(res)
+ except TypeError as e:
+ warn("Unable to sort modes: %s" % e)
+ result = constructor(res, dtype=dtype)
+
+ return result
+
+
def rank(values, axis=0, method='average', na_option='keep',
ascending=True):
"""
diff --git a/pandas/core/frame.py b/pandas/core/frame.py
index 0a5306de9bbb5..1cb0c4adcf5d4 100644
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -4083,6 +4083,28 @@ def _get_agg_axis(self, axis_num):
else:
raise ValueError('Axis must be 0 or 1 (got %r)' % axis_num)
+ def mode(self, axis=0, numeric_only=False):
+ """
+ Gets the mode of each element along the axis selected. Empty if nothing
+ has 2+ occurrences. Adds a row for each mode per label, fills in gaps
+ with nan.
+
+ Parameters
+ ----------
+ axis : {0, 1, 'index', 'columns'} (default 0)
+ 0/'index' : get mode of each column
+ 1/'columns' : get mode of each row
+ numeric_only : bool, default False
+ if True, only apply to numeric columns
+
+ Returns
+ -------
+ modes : DataFrame (sorted)
+ """
+ data = self if not numeric_only else self._get_numeric_data()
+ f = lambda s: s.mode()
+ return data.apply(f, axis=axis)
+
def quantile(self, q=0.5, axis=0, numeric_only=True):
"""
Return values at the given quantile over requested axis, a la
diff --git a/pandas/core/series.py b/pandas/core/series.py
index 798183a29c48b..3fe9540ba3fe0 100644
--- a/pandas/core/series.py
+++ b/pandas/core/series.py
@@ -1127,6 +1127,26 @@ def value_counts(self, normalize=False, sort=True, ascending=False, bins=None):
return value_counts(self.values, sort=sort, ascending=ascending,
normalize=normalize, bins=bins)
+ def mode(self):
+ """Returns the mode(s) of the dataset.
+
+ Empty if nothing occurs at least 2 times. Always returns Series even
+ if only one value.
+
+ Parameters
+ ----------
+ sort : bool, default True
+ if True, will lexicographically sort values, if False skips
+ sorting. Result ordering when ``sort=False`` is not defined.
+
+ Returns
+ -------
+ modes : Series (sorted)
+ """
+ # TODO: Add option for bins like value_counts()
+ from pandas.core.algorithms import mode
+ return mode(self)
+
def unique(self):
"""
Return array of unique values in the Series. Significantly faster than
diff --git a/pandas/hashtable.pyx b/pandas/hashtable.pyx
index 1b132ea91f515..10c43478a5352 100644
--- a/pandas/hashtable.pyx
+++ b/pandas/hashtable.pyx
@@ -890,15 +890,12 @@ cdef class Int64Factorizer:
return labels
-
-def value_count_int64(ndarray[int64_t] values):
+cdef build_count_table_int64(ndarray[int64_t] values, kh_int64_t *table):
cdef:
+ int k
Py_ssize_t i, n = len(values)
- kh_int64_t *table
int ret = 0
- list uniques = []
- table = kh_init_int64()
kh_resize_int64(table, n)
for i in range(n):
@@ -910,8 +907,17 @@ def value_count_int64(ndarray[int64_t] values):
k = kh_put_int64(table, val, &ret)
table.vals[k] = 1
- # for (k = kh_begin(h); k != kh_end(h); ++k)
- # if (kh_exist(h, k)) kh_value(h, k) = 1;
+
+cpdef value_count_int64(ndarray[int64_t] values):
+ cdef:
+ Py_ssize_t i
+ kh_int64_t *table
+ int ret = 0
+ int k
+
+ table = kh_init_int64()
+ build_count_table_int64(values, table)
+
i = 0
result_keys = np.empty(table.n_occupied, dtype=np.int64)
result_counts = np.zeros(table.n_occupied, dtype=np.int64)
@@ -924,15 +930,15 @@ def value_count_int64(ndarray[int64_t] values):
return result_keys, result_counts
-def value_count_object(ndarray[object] values,
- ndarray[uint8_t, cast=True] mask):
+
+cdef build_count_table_object(ndarray[object] values,
+ ndarray[uint8_t, cast=True] mask,
+ kh_pymap_t *table):
cdef:
+ int k
Py_ssize_t i, n = len(values)
- kh_pymap_t *table
int ret = 0
- list uniques = []
- table = kh_init_pymap()
kh_resize_pymap(table, n // 10)
for i in range(n):
@@ -947,6 +953,17 @@ def value_count_object(ndarray[object] values,
k = kh_put_pymap(table, <PyObject*> val, &ret)
table.vals[k] = 1
+
+cpdef value_count_object(ndarray[object] values,
+ ndarray[uint8_t, cast=True] mask):
+ cdef:
+ Py_ssize_t i = len(values)
+ kh_pymap_t *table
+ int k
+
+ table = kh_init_pymap()
+ build_count_table_object(values, mask, table)
+
i = 0
result_keys = np.empty(table.n_occupied, dtype=object)
result_counts = np.zeros(table.n_occupied, dtype=np.int64)
@@ -959,3 +976,64 @@ def value_count_object(ndarray[object] values,
return result_keys, result_counts
+
+def mode_object(ndarray[object] values, ndarray[uint8_t, cast=True] mask):
+ cdef:
+ int count, max_count = 2
+ int j = -1 # so you can do +=
+ int k
+ Py_ssize_t i, n = len(values)
+ kh_pymap_t *table
+ int ret = 0
+
+ table = kh_init_pymap()
+ build_count_table_object(values, mask, table)
+
+ modes = np.empty(table.n_buckets, dtype=np.object_)
+ for k in range(table.n_buckets):
+ if kh_exist_pymap(table, k):
+ count = table.vals[k]
+
+ if count == max_count:
+ j += 1
+ elif count > max_count:
+ max_count = count
+ j = 0
+ else:
+ continue
+ modes[j] = <object> table.keys[k]
+
+ kh_destroy_pymap(table)
+
+ return modes[:j+1]
+
+
+def mode_int64(ndarray[int64_t] values):
+ cdef:
+ int val, max_val = 2
+ int j = -1 # so you can do +=
+ int k
+ kh_int64_t *table
+ list uniques = []
+
+ table = kh_init_int64()
+
+ build_count_table_int64(values, table)
+
+ modes = np.empty(table.n_buckets, dtype=np.int64)
+ for k in range(table.n_buckets):
+ if kh_exist_int64(table, k):
+ val = table.vals[k]
+
+ if val == max_val:
+ j += 1
+ elif val > max_val:
+ max_val = val
+ j = 0
+ else:
+ continue
+ modes[j] = table.keys[k]
+
+ kh_destroy_int64(table)
+
+ return modes[:j+1]
diff --git a/pandas/tests/test_frame.py b/pandas/tests/test_frame.py
index 2f7696f2520fc..e0abe7700f28d 100644
--- a/pandas/tests/test_frame.py
+++ b/pandas/tests/test_frame.py
@@ -10050,6 +10050,59 @@ def wrapper(x):
self.assert_(np.isnan(r0).all())
self.assert_(np.isnan(r1).all())
+ def test_mode(self):
+ df = pd.DataFrame({"A": [12, 12, 11, 12, 19, 11],
+ "B": [10, 10, 10, np.nan, 3, 4],
+ "C": [8, 8, 8, 9, 9, 9],
+ "D": range(6),
+ "E": [8, 8, 1, 1, 3, 3]})
+ assert_frame_equal(df[["A"]].mode(),
+ pd.DataFrame({"A": [12]}))
+ assert_frame_equal(df[["D"]].mode(),
+ pd.DataFrame(pd.Series([], dtype="int64"),
+ columns=["D"]))
+ assert_frame_equal(df[["E"]].mode(),
+ pd.DataFrame(pd.Series([1, 3, 8], dtype="int64"),
+ columns=["E"]))
+ assert_frame_equal(df[["A", "B"]].mode(),
+ pd.DataFrame({"A": [12], "B": [10.]}))
+ assert_frame_equal(df.mode(),
+ pd.DataFrame({"A": [12, np.nan, np.nan],
+ "B": [10, np.nan, np.nan],
+ "C": [8, 9, np.nan],
+ "D": [np.nan, np.nan, np.nan],
+ "E": [1, 3, 8]}))
+
+ # outputs in sorted order
+ df["C"] = list(reversed(df["C"]))
+ print(df["C"])
+ print(df["C"].mode())
+ a, b = (df[["A", "B", "C"]].mode(),
+ pd.DataFrame({"A": [12, np.nan],
+ "B": [10, np.nan],
+ "C": [8, 9]}))
+ print(a)
+ print(b)
+ assert_frame_equal(a, b)
+ # should work with heterogeneous types
+ df = pd.DataFrame({"A": range(6),
+ "B": pd.date_range('2011', periods=6),
+ "C": list('abcdef')})
+ exp = pd.DataFrame({"A": pd.Series([], dtype=df["A"].dtype),
+ "B": pd.Series([], dtype=df["B"].dtype),
+ "C": pd.Series([], dtype=df["C"].dtype)})
+ assert_frame_equal(df.mode(), exp)
+
+ # and also when not empty
+ df.loc[1, "A"] = 0
+ df.loc[4, "B"] = df.loc[3, "B"]
+ df.loc[5, "C"] = 'e'
+ exp = pd.DataFrame({"A": pd.Series([0], dtype=df["A"].dtype),
+ "B": pd.Series([df.loc[3, "B"]], dtype=df["B"].dtype),
+ "C": pd.Series(['e'], dtype=df["C"].dtype)})
+
+ assert_frame_equal(df.mode(), exp)
+
def test_sum_corner(self):
axis0 = self.empty.sum(0)
axis1 = self.empty.sum(1)
diff --git a/pandas/tests/test_series.py b/pandas/tests/test_series.py
index e5186cb3030ff..91fa1f1a19ffc 100644
--- a/pandas/tests/test_series.py
+++ b/pandas/tests/test_series.py
@@ -19,10 +19,8 @@
from pandas.core.index import MultiIndex
from pandas.tseries.index import Timestamp, DatetimeIndex
import pandas.core.config as cf
-import pandas.core.series as smod
import pandas.lib as lib
-import pandas.core.common as com
import pandas.core.datetools as datetools
import pandas.core.nanops as nanops
@@ -1721,6 +1719,35 @@ def test_median(self):
int_ts = Series(np.ones(10, dtype=int), index=lrange(10))
self.assertAlmostEqual(np.median(int_ts), int_ts.median())
+ def test_mode(self):
+ s = Series([12, 12, 11, 10, 19, 11])
+ exp = Series([11, 12])
+ assert_series_equal(s.mode(), exp)
+
+ assert_series_equal(Series([1, 2, 3]).mode(), Series([], dtype=int))
+
+ lst = [5] * 20 + [1] * 10 + [6] * 25
+ np.random.shuffle(lst)
+ s = Series(lst)
+ assert_series_equal(s.mode(), Series([6]))
+
+ s = Series([5] * 10)
+ assert_series_equal(s.mode(), Series([5]))
+
+ s = Series(lst)
+ s[0] = np.nan
+ assert_series_equal(s.mode(), Series([6], dtype=float))
+
+ s = Series(list('adfasbasfwewefwefweeeeasdfasnbam'))
+ assert_series_equal(s.mode(), Series(['e']))
+
+ s = Series(['2011-01-03', '2013-01-02', '1900-05-03'], dtype='M8[ns]')
+ assert_series_equal(s.mode(), Series([], dtype="M8[ns]"))
+ s = Series(['2011-01-03', '2013-01-02', '1900-05-03', '2011-01-03',
+ '2013-01-02'], dtype='M8[ns]')
+ assert_series_equal(s.mode(), Series(['2011-01-03', '2013-01-02'],
+ dtype='M8[ns]'))
+
def test_prod(self):
self._check_stat_op('prod', np.prod)
| Closes #5367 - generally as fast or faster than value_counts (which makes sense because it has to construct Series), so should be relatively good performance-wise. Also, doesn't get stuck on value_counts' pathological case (huge array with # uniques close to/at the size of the array).
Not using result of hashtable.value_count() under the hood and instead iterating over klib table directly gives a _huge_ speedup. I just moved the value_count table creation method to a separate function (zero perf hit). For performance breakouts check out this gist:
https://gist.github.com/jtratner/7225878
DataFrame version delegates to Series' version at each level.
| https://api.github.com/repos/pandas-dev/pandas/pulls/5380 | 2013-10-30T03:32:21Z | 2013-11-05T06:00:57Z | 2013-11-05T06:00:57Z | 2014-06-15T23:15:45Z |
BUG: Fixes color selection in andrews_curve | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 4d628fac78cf0..f628917238e47 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -205,6 +205,8 @@ Improvements to existing features
wrapper is updated inplace, a copy is still made internally.
(:issue:`1960`, :issue:`5247`, and related :issue:`2325` [still not
closed])
+ - Fixed bug in `tools.plotting.andrews_curvres` so that lines are drawn grouped
+ by color as expected.
API Changes
~~~~~~~~~~~
diff --git a/pandas/tools/plotting.py b/pandas/tools/plotting.py
index 7de5840384974..c4255e706b19f 100644
--- a/pandas/tools/plotting.py
+++ b/pandas/tools/plotting.py
@@ -454,13 +454,14 @@ def f(x):
n = len(data)
class_col = data[class_column]
+ uniq_class = class_col.drop_duplicates()
columns = [data[col] for col in data.columns if (col != class_column)]
x = [-pi + 2.0 * pi * (t / float(samples)) for t in range(samples)]
used_legends = set([])
- colors = _get_standard_colors(num_colors=n, colormap=colormap,
+ colors = _get_standard_colors(num_colors=len(uniq_class), colormap=colormap,
color_type='random', color=kwds.get('color'))
-
+ col_dict = dict([(klass, col) for klass, col in zip(uniq_class, colors)])
if ax is None:
ax = plt.gca(xlim=(-pi, pi))
for i in range(n):
@@ -471,9 +472,9 @@ def f(x):
if com.pprint_thing(class_col[i]) not in used_legends:
label = com.pprint_thing(class_col[i])
used_legends.add(label)
- ax.plot(x, y, color=colors[i], label=label, **kwds)
+ ax.plot(x, y, color=col_dict[class_col[i]], label=label, **kwds)
else:
- ax.plot(x, y, color=colors[i], **kwds)
+ ax.plot(x, y, color=col_dict[class_col[i]], **kwds)
ax.legend(loc='upper right')
ax.grid()
@@ -656,10 +657,10 @@ def lag_plot(series, lag=1, ax=None, **kwds):
ax: Matplotlib axis object
"""
import matplotlib.pyplot as plt
-
+
# workaround because `c='b'` is hardcoded in matplotlibs scatter method
kwds.setdefault('c', plt.rcParams['patch.facecolor'])
-
+
data = series.values
y1 = data[:-lag]
y2 = data[lag:]
@@ -1212,20 +1213,20 @@ def __init__(self, data, x, y, **kwargs):
y = self.data.columns[y]
self.x = x
self.y = y
-
-
+
+
def _make_plot(self):
x, y, data = self.x, self.y, self.data
ax = self.axes[0]
ax.scatter(data[x].values, data[y].values, **self.kwds)
-
+
def _post_plot_logic(self):
ax = self.axes[0]
- x, y = self.x, self.y
+ x, y = self.x, self.y
ax.set_ylabel(com.pprint_thing(y))
ax.set_xlabel(com.pprint_thing(x))
-
-
+
+
class LinePlot(MPLPlot):
def __init__(self, data, **kwargs):
@@ -1658,25 +1659,25 @@ def plot_frame(frame=None, x=None, y=None, subplots=False, sharex=True,
elif kind == 'kde':
klass = KdePlot
elif kind == 'scatter':
- klass = ScatterPlot
+ klass = ScatterPlot
else:
raise ValueError('Invalid chart type given %s' % kind)
if kind == 'scatter':
- plot_obj = klass(frame, x=x, y=y, kind=kind, subplots=subplots,
- rot=rot,legend=legend, ax=ax, style=style,
+ plot_obj = klass(frame, x=x, y=y, kind=kind, subplots=subplots,
+ rot=rot,legend=legend, ax=ax, style=style,
fontsize=fontsize, use_index=use_index, sharex=sharex,
- sharey=sharey, xticks=xticks, yticks=yticks,
- xlim=xlim, ylim=ylim, title=title, grid=grid,
- figsize=figsize, logx=logx, logy=logy,
- sort_columns=sort_columns, secondary_y=secondary_y,
+ sharey=sharey, xticks=xticks, yticks=yticks,
+ xlim=xlim, ylim=ylim, title=title, grid=grid,
+ figsize=figsize, logx=logx, logy=logy,
+ sort_columns=sort_columns, secondary_y=secondary_y,
**kwds)
else:
if x is not None:
if com.is_integer(x) and not frame.columns.holds_integer():
x = frame.columns[x]
frame = frame.set_index(x)
-
+
if y is not None:
if com.is_integer(y) and not frame.columns.holds_integer():
y = frame.columns[y]
@@ -1691,7 +1692,7 @@ def plot_frame(frame=None, x=None, y=None, subplots=False, sharex=True,
grid=grid, logx=logx, logy=logy,
secondary_y=secondary_y, title=title,
figsize=figsize, fontsize=fontsize, **kwds)
-
+
else:
plot_obj = klass(frame, kind=kind, subplots=subplots, rot=rot,
legend=legend, ax=ax, style=style, fontsize=fontsize,
@@ -1700,7 +1701,7 @@ def plot_frame(frame=None, x=None, y=None, subplots=False, sharex=True,
title=title, grid=grid, figsize=figsize, logx=logx,
logy=logy, sort_columns=sort_columns,
secondary_y=secondary_y, **kwds)
-
+
plot_obj.generate()
plot_obj.draw()
if subplots:
| Fixed bug introduced in b5265a5b84ae1aeaf5fff88f1f9e5872a9b404e6 which change from picking a single random color for the class to picking a random color for each line.
This returns the color selection to a per-set basis.
See http://stackoverflow.com/questions/19667209/colors-in-andrews-curves
| https://api.github.com/repos/pandas-dev/pandas/pulls/5378 | 2013-10-30T02:46:42Z | 2013-10-31T03:28:25Z | 2013-10-31T03:28:25Z | 2014-06-22T05:09:45Z |
repr for PeriodIndex does not handle <=2 elements well (GH5372) | diff --git a/doc/source/release.rst b/doc/source/release.rst
index 0ef2c29af8139..f65c613ddb96a 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -760,7 +760,8 @@ Bug Fixes
(thanks for catching this @yarikoptic!)
- Fixed html tests on win32. (:issue:`4580`)
- Make sure that ``head/tail`` are ``iloc`` based, (:issue:`5370`)
-
+ - Fixed bug for ``PeriodIndex`` string representation if there are 1 or 2
+ elements. (:issue:`5372`)
pandas 0.12.0
-------------
diff --git a/pandas/tseries/period.py b/pandas/tseries/period.py
index c25d16e8b28f8..974c0a52a35de 100644
--- a/pandas/tseries/period.py
+++ b/pandas/tseries/period.py
@@ -1082,7 +1082,11 @@ def __repr__(self):
output = com.pprint_thing(self.__class__) + '\n'
output += 'freq: %s\n' % self.freq
n = len(self)
- if n:
+ if n == 1:
+ output += '[%s]\n' % (self[0])
+ elif n == 2:
+ output += '[%s, %s]\n' % (self[0], self[-1])
+ elif n:
output += '[%s, ..., %s]\n' % (self[0], self[-1])
output += 'length: %d' % n
return output
diff --git a/pandas/tseries/tests/test_period.py b/pandas/tseries/tests/test_period.py
index 312a88bcbc5a9..de6918eb8a1d1 100644
--- a/pandas/tseries/tests/test_period.py
+++ b/pandas/tseries/tests/test_period.py
@@ -1672,7 +1672,19 @@ def test_asfreq(self):
def test_ts_repr(self):
index = PeriodIndex(freq='A', start='1/1/2001', end='12/31/2010')
ts = Series(np.random.randn(len(index)), index=index)
- repr(ts)
+ repr(ts) # ??
+
+ val = period_range('2013Q1', periods=1, freq="Q")
+ expected = "<class 'pandas.tseries.period.PeriodIndex'>\nfreq: Q-DEC\n[2013Q1]\nlength: 1"
+ assert_equal(repr(val), expected)
+
+ val = period_range('2013Q1', periods=2, freq="Q")
+ expected = "<class 'pandas.tseries.period.PeriodIndex'>\nfreq: Q-DEC\n[2013Q1, 2013Q2]\nlength: 2"
+ assert_equal(repr(val), expected)
+
+ val = period_range('2013Q1', periods=3, freq="Q")
+ expected = "<class 'pandas.tseries.period.PeriodIndex'>\nfreq: Q-DEC\n[2013Q1, ..., 2013Q3]\nlength: 3"
+ assert_equal(repr(val), expected)
def test_period_index_unicode(self):
pi = PeriodIndex(freq='A', start='1/1/2001', end='12/1/2009')
| closes https://github.com/pydata/pandas/issues/5372
| https://api.github.com/repos/pandas-dev/pandas/pulls/5376 | 2013-10-29T19:33:00Z | 2013-10-31T01:24:57Z | 2013-10-31T01:24:56Z | 2014-07-16T08:37:57Z |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.