Skip to content

Commit dbc7112

Browse files
committed
small doc updates
1 parent 0a7c659 commit dbc7112

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

doc/library-developers.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ Patsy is a good houseguest:
1616
* Pure Python, no compilation necessary.
1717
* Exhaustive tests (>98% statement coverage at time of writing) and
1818
documentation (you're looking at it).
19-
* No dependencies besides numpy (and we even test against numpy 1.2.1,
20-
as distributed by RHEL 5).
21-
* Tested and supported on every version of Python since 2.4.
19+
* No dependencies besides numpy.
20+
* Tested and supported on every version of Python since 2.5. (And 2.4
21+
probably still works too if you really want it, it's just become too
22+
hard to keep a working 2.4 environment on the test server.)
2223

2324
So you can be pretty confident that adding a dependency on Patsy
2425
won't create much hassle for your users.
@@ -162,7 +163,7 @@ it's quite straightforward to add custom operators to the formula
162163
parser, or otherwise extend the formula evaluation machinery. (Heck,
163164
it only took an hour or two to repurpose it for a totally different
164165
purpose, parsing linear constraints.) But extending Patsy in a
165-
more fundamental way this will require just a wee bit more complicated
166+
more fundamental way then this will require just a wee bit more complicated
166167
API than just calling :func:`dmatrices`, and for this initial release,
167168
we've been busy enough getting the basics working that we haven't yet
168169
taken the time to pin down a public extension API we can support.

patsy/splines.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,14 @@ class BS(object):
103103
A spline with ``degree=0`` is piecewise constant with breakpoints at each
104104
knot, and the default knot positions are quantiles of the input. So if you
105105
find yourself in the situation of wanting to quantize a continuous
106-
variable into equal-sized bins with a constant effect across each bin, you
107-
can use ``bs(x, num_bins, degree=0)``.
108-
109-
Similarly, a spline with ``degree=1`` is piecewise linear with breakpoints
110-
at each knot.
106+
variable into ``num_bins`` equal-sized bins with a constant effect across
107+
each bin, you can use ``bs(x, num_bins - 1, degree=0)``. (The ``- 1`` is
108+
because one degree of freedom will be taken by the intercept;
109+
alternatively, you could leave the intercept term out of your model and
110+
use ``bs(x, num_bins, degree=0, include_intercept=True)``.
111+
112+
A spline with ``degree=1`` is piecewise linear with breakpoints at each
113+
knot.
111114
112115
The default is ``degree=3``, which gives a cubic b-spline.
113116

0 commit comments

Comments
 (0)