Skip to content

Commit 40972df

Browse files
committed
DOC: doc fixes
1 parent 3bc1f17 commit 40972df

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

doc/source/indexing.rst

+1
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,7 @@ As a convenience, you can pass a list of arrays directly into Series or
611611
DataFrame to construct a MultiIndex automatically:
612612
613613
.. ipython:: python
614+
614615
arrays = [np.array(['bar', 'bar', 'baz', 'baz', 'foo', 'foo', 'qux', 'qux']),
615616
np.array(['one', 'two', 'one', 'two', 'one', 'two', 'one', 'two'])]
616617
s = Series(randn(8), index=arrays)

doc/source/timeseries.rst

+13-13
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ alias parsing is case sensitive.
250250
.. _timeseries.daterange:
251251

252252
Generating date ranges (date_range)
253-
----------------------------------
253+
-----------------------------------
254254

255255
The ``date_range`` class utilizes these offsets (and any ones that we might add)
256256
to generate fixed-frequency date ranges:
@@ -260,9 +260,9 @@ to generate fixed-frequency date ranges:
260260
start = datetime(2009, 1, 1)
261261
end = datetime(2010, 1, 1)
262262
263-
rng = date_range(start, end, offset=BDay())
263+
rng = date_range(start, end, freq=BDay())
264264
rng
265-
date_range(start, end, offset=BMonthEnd())
265+
date_range(start, end, freq=BMonthEnd())
266266
267267
**Business day frequency** is the default for ``date_range``. You can also
268268
strictly generate a ``date_range`` of a certain length by providing either a
@@ -277,7 +277,7 @@ The start and end dates are strictly inclusive. So it will not generate any
277277
dates outside of those dates if specified.
278278

279279
date_range is a valid Index
280-
~~~~~~~~~~~~~~~~~~~~~~~~~~
280+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
281281

282282
One of the main uses for ``date_range`` is as an index for pandas objects. When
283283
working with a lot of time series data, there are several reasons to use
@@ -295,7 +295,7 @@ slicing, etc.
295295

296296
.. ipython:: python
297297
298-
rng = date_range(start, end, offset=BMonthEnd())
298+
rng = date_range(start, end, freq=BMonthEnd())
299299
ts = Series(randn(len(rng)), index=rng)
300300
ts.index
301301
ts[:5].index
@@ -339,8 +339,8 @@ rule <timeseries.timerule>`:
339339

340340
.. ipython:: python
341341
342-
ts.shift(5, offset=datetools.bday)
343-
ts.shift(5, offset='EOM')
342+
ts.shift(5, freq=datetools.bday)
343+
ts.shift(5, freq='EOM')
344344
345345
Frequency conversion
346346
~~~~~~~~~~~~~~~~~~~~
@@ -351,7 +351,7 @@ generates a ``date_range`` and calls ``reindex``.
351351

352352
.. ipython:: python
353353
354-
dr = date_range('1/1/2010', periods=3, offset=3 * datetools.bday)
354+
dr = date_range('1/1/2010', periods=3, freq=3 * datetools.bday)
355355
ts = Series(randn(3), index=dr)
356356
ts
357357
ts.asfreq(BDay())
@@ -377,9 +377,9 @@ view) application of GroupBy. Carry out the following steps:
377377

378378
.. code-block:: python
379379
380-
dr1hour = date_range(start, end, offset=Hour())
381-
dr5day = date_range(start, end, offset=5 * datetools.day)
382-
dr10day = date_range(start, end, offset=10 * datetools.day)
380+
dr1hour = date_range(start, end, freq=Hour())
381+
dr5day = date_range(start, end, freq=5 * datetools.day)
382+
dr10day = date_range(start, end, freq=10 * datetools.day)
383383
384384
385385
2. Use the ``asof`` function ("as of") of the date_range to do a groupby
@@ -396,11 +396,11 @@ Here is a fully-worked example:
396396
397397
# some minutely data
398398
minutely = date_range('1/3/2000 00:00:00', '1/3/2000 12:00:00',
399-
offset=datetools.Minute())
399+
freq=datetools.Minute())
400400
ts = Series(randn(len(minutely)), index=minutely)
401401
ts.index
402402
403-
hourly = date_range('1/3/2000', '1/4/2000', offset=datetools.Hour())
403+
hourly = date_range('1/3/2000', '1/4/2000', freq=datetools.Hour())
404404
405405
grouped = ts.groupby(hourly.asof)
406406
grouped.mean()

0 commit comments

Comments
 (0)