diff --git a/doc/source/enhancingperf.rst b/doc/source/enhancingperf.rst index e6b735173110b..d007446a5b922 100644 --- a/doc/source/enhancingperf.rst +++ b/doc/source/enhancingperf.rst @@ -66,7 +66,7 @@ Here's the function in pure python: s += f(a + i * dx) return s * dx -We achieve our result by by using ``apply`` (row-wise): +We achieve our result by using ``apply`` (row-wise): .. ipython:: python @@ -86,7 +86,7 @@ hence we'll concentrate our efforts cythonizing these two functions. .. note:: In python 2 replacing the ``range`` with its generator counterpart (``xrange``) - would mean the ``range`` line would vanish. In python 3 range is already a generator. + would mean the ``range`` line would vanish. In python 3 ``range`` is already a generator. .. _enhancingperf.plain: @@ -248,7 +248,7 @@ efforts here. More advanced techniques ~~~~~~~~~~~~~~~~~~~~~~~~ -There is still scope for improvement, here's an example of using some more +There is still hope for improvement. Here's an example of using some more advanced cython techniques: .. ipython:: @@ -373,7 +373,7 @@ This Python syntax is **not** allowed: :func:`~pandas.eval` Examples ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:func:`pandas.eval` works well with expressions containing large arrays +:func:`pandas.eval` works well with expressions containing large arrays. First let's create a few decent-sized arrays to play with: diff --git a/doc/source/remote_data.rst b/doc/source/remote_data.rst index ac9b6c9aecc4a..65fcf600cdfd2 100644 --- a/doc/source/remote_data.rst +++ b/doc/source/remote_data.rst @@ -49,7 +49,7 @@ Yahoo! Finance import datetime start = datetime.datetime(2010, 1, 1) end = datetime.datetime(2013, 1, 27) - f=web.DataReader("F", 'yahoo', start, end) + f = web.DataReader("F", 'yahoo', start, end) f.ix['2010-01-04'] .. _remote_data.yahoo_options: @@ -58,10 +58,10 @@ Yahoo! Finance Options ---------------------- ***Experimental*** -The Options class allows the download of options data from Yahoo! Finance. +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 +and provides a formatted ``DataFrame`` with a hierarchical index, so it is easy to get to the specific option you want. .. ipython:: python @@ -71,10 +71,10 @@ to the specific option you want. data = aapl.get_all_data() data.iloc[0:5, 0:5] - #Show the $100 strike puts at all expiry dates: + # Show the $100 strike puts at all expiry dates: data.loc[(100, slice(None), 'put'),:].iloc[0:5, 0:5] - #Show the volume traded of $100 strike puts at all expiry dates: + # Show the volume traded of $100 strike puts at all expiry dates: data.loc[(100, slice(None), 'put'),'Vol'].head() If you don't want to download all the data, more specific requests can be made. @@ -121,7 +121,7 @@ Google Finance import datetime start = datetime.datetime(2010, 1, 1) end = datetime.datetime(2013, 1, 27) - f=web.DataReader("F", 'google', start, end) + f = web.DataReader("F", 'google', start, end) f.ix['2010-01-04'] .. _remote_data.fred: @@ -152,7 +152,7 @@ Dataset names are listed at `Fama/French Data Library .. ipython:: python import pandas.io.data as web - ip=web.DataReader("5_Industry_Portfolios", "famafrench") + ip = web.DataReader("5_Industry_Portfolios", "famafrench") ip[4].ix[192607] .. _remote_data.wb: @@ -302,9 +302,8 @@ Problematic Country Codes & Indicators :func:`wb.download()` is more flexible. To achieve this, the warning and exception logic changed. -The world bank converts some country codes, -in their response, which makes error checking by pandas difficult. -Retired indicators still persist in the search. +The world bank converts some country codes in their response, which makes error +checking by pandas difficult. Retired indicators still persist in the search. Given the new flexibility of 0.15.1, improved error handling by the user may be necessary for fringe cases. @@ -377,13 +376,13 @@ The following will fetch users and pageviews (metrics) data per day of the week, filters = "pagePath=~aboutus;ga:country==France", ) -The only mandatory arguments are ``metrics,`` ``dimensions`` and ``start_date``. We can only strongly recommend you to always specify the ``account_id``, ``profile_id`` and ``property_id`` to avoid accessing the wrong data bucket in Google Analytics. +The only mandatory arguments are ``metrics,`` ``dimensions`` and ``start_date``. We strongly recommend that you always specify the ``account_id``, ``profile_id`` and ``property_id`` to avoid accessing the wrong data bucket in Google Analytics. The ``index_col`` argument indicates which dimension(s) has to be taken as index. -The ``filters`` argument indicates the filtering to apply to the query. In the above example, the page has URL has to contain ``aboutus`` AND the visitors country has to be France. +The ``filters`` argument indicates the filtering to apply to the query. In the above example, the page URL has to contain ``aboutus`` AND the visitors country has to be France. -Detailed informations in the followings: +Detailed information in the following: * `pandas & google analytics, by yhat `__ * `Google Analytics integration in pandas, by Chang She `__ diff --git a/doc/source/timedeltas.rst b/doc/source/timedeltas.rst index 786a46d343be1..8215414e425fe 100644 --- a/doc/source/timedeltas.rst +++ b/doc/source/timedeltas.rst @@ -29,13 +29,13 @@ Time Deltas Starting in v0.15.0, we introduce a new scalar type ``Timedelta``, which is a subclass of ``datetime.timedelta``, and behaves in a similar manner, but allows compatibility with ``np.timedelta64`` types as well as a host of custom representation, parsing, and attributes. -Timedeltas are differences in times, expressed in difference units, e.g. days,hours,minutes,seconds. +Timedeltas are differences in times, expressed in difference units, e.g. days, hours, minutes, seconds. They can be both positive and negative. Parsing ------- -You can construct a ``Timedelta`` scalar thru various arguments: +You can construct a ``Timedelta`` scalar through various arguments: .. ipython:: python @@ -46,7 +46,7 @@ You can construct a ``Timedelta`` scalar thru various arguments: Timedelta('-1 days 2 min 3us') # like datetime.timedelta - # note: these MUST be specified as keyword argments + # note: these MUST be specified as keyword arguments Timedelta(days=1,seconds=1) # integers with a unit @@ -100,7 +100,7 @@ It will construct Series if the input is a Series, a scalar if the input is scal Operations ---------- -You can operate on Series/DataFrames and construct ``timedelta64[ns]`` Series thru +You can operate on Series/DataFrames and construct ``timedelta64[ns]`` Series through subtraction operations on ``datetime64[ns]`` Series, or ``Timestamps``. .. ipython:: python @@ -290,7 +290,7 @@ TimedeltaIndex .. versionadded:: 0.15.0 -To generate an index with time delta, you can use either the TimedeltaIndex or +To generate an index with time delta, you can use either the ``TimedeltaIndex`` or the ``timedelta_range`` constructor. Using ``TimedeltaIndex`` you can pass string-like, ``Timedelta``, ``timedelta``,