diff --git a/doc/source/cookbook.rst b/doc/source/cookbook.rst index 0c192a0aab24a..0f9726dc94816 100644 --- a/doc/source/cookbook.rst +++ b/doc/source/cookbook.rst @@ -1236,7 +1236,7 @@ the following Python code will read the binary file ``'binary.dat'`` into a pandas ``DataFrame``, where each element of the struct corresponds to a column in the frame: -.. ipython:: python +.. code-block:: python names = 'count', 'avg', 'scale' diff --git a/doc/source/integer_na.rst b/doc/source/integer_na.rst index befcf7016f155..eb0c5e3d05863 100644 --- a/doc/source/integer_na.rst +++ b/doc/source/integer_na.rst @@ -2,7 +2,7 @@ {{ header }} - .. _integer_na: +.. _integer_na: ************************** Nullable Integer Data Type diff --git a/doc/source/io.rst b/doc/source/io.rst index 3bbd4e8410fa5..967648f3a168a 100644 --- a/doc/source/io.rst +++ b/doc/source/io.rst @@ -4880,7 +4880,7 @@ below and the SQLAlchemy `documentation 0 - (s > 0).dtype - crit = (s > 0).reindex(list(range(8))) - crit - crit.dtype + s = pd.Series([0, 1, np.nan, 3, 4], dtype="Int64") + s See :ref:`integer_na` for more. diff --git a/doc/source/timeseries.rst b/doc/source/timeseries.rst index 59e8fa58fd9cf..84fca37318091 100644 --- a/doc/source/timeseries.rst +++ b/doc/source/timeseries.rst @@ -1874,7 +1874,7 @@ has multiplied span. .. ipython:: python - pd.PeriodIndex(start='2014-01', freq='3M', periods=4) + pd.period_range(start='2014-01', freq='3M', periods=4) If ``start`` or ``end`` are ``Period`` objects, they will be used as anchor endpoints for a ``PeriodIndex`` with frequency matching that of the @@ -1882,8 +1882,8 @@ endpoints for a ``PeriodIndex`` with frequency matching that of the .. ipython:: python - pd.PeriodIndex(start=pd.Period('2017Q1', freq='Q'), - end=pd.Period('2017Q2', freq='Q'), freq='M') + pd.period_range(start=pd.Period('2017Q1', freq='Q'), + end=pd.Period('2017Q2', freq='Q'), freq='M') Just like ``DatetimeIndex``, a ``PeriodIndex`` can also be used to index pandas objects: diff --git a/doc/source/tutorials.rst b/doc/source/tutorials.rst index f4f33a921dcce..8e23c643280c1 100644 --- a/doc/source/tutorials.rst +++ b/doc/source/tutorials.rst @@ -33,7 +33,7 @@ repository `_. Learn Pandas by Hernan Rojas ---------------------------- -A set of lesson for new pandas users: `Learn pandas `__. +A set of lesson for new pandas users: https://bitbucket.org/hrojas/learn-pandas Practical data analysis with Python ----------------------------------- diff --git a/doc/source/whatsnew/v0.20.0.rst b/doc/source/whatsnew/v0.20.0.rst index c78d5c1d178d2..c720e075012eb 100644 --- a/doc/source/whatsnew/v0.20.0.rst +++ b/doc/source/whatsnew/v0.20.0.rst @@ -189,14 +189,15 @@ URLs and paths are now inferred using their file extensions. Additionally, support for bz2 compression in the python 2 C-engine improved (:issue:`14874`). .. ipython:: python - :okwarning: url = ('https://github.com/{repo}/raw/{branch}/{path}' .format(repo='pandas-dev/pandas', branch='master', path='pandas/tests/io/parser/data/salaries.csv.bz2')) - df = pd.read_table(url, compression='infer') # default, infer compression - df = pd.read_table(url, compression='bz2') # explicitly specify compression + # default, infer compression + df = pd.read_csv(url, sep='\t', compression='infer') + # explicitly specify compression + df = pd.read_csv(url, sep='\t', compression='bz2') df.head(2) .. _whatsnew_0200.enhancements.pickle_compression: