Errata for Python for Data Analysis
Submit your own errata for this product.
The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".
The following errata were submitted by our customers and approved as valid errors by the author or editor.
Color Key: Serious Technical Mistake Minor Technical Mistake Language or formatting error Typo Question Note Update
| Version |
Location |
Description |
Submitted By |
Date Submitted |
Date Corrected |
| Printed |
Page vi
United States |
The technical editor Hugh Brown is listed as Hugh White.
Not sure of the page number.
Note from the Author or Editor: Yes, many apologies. His name is Hugh Brown (and he was a great editor!)
|
Hugh Brown |
Nov 05, 2012 |
May 17, 2013 |
| Mobi |
Page 1
On Kindle: "Location 325 of 13301" |
Sorry, don't know the proper page number (I'm on a kindle), so I entered 1.
In Chapter 1, under the numpy description, one of the bullet points has a minor grammatical error. It reads"
"Tools for integrating connecting C, C + +, and Fortran code to Python"
I assume "integrating connecting" was not intended as is.
Note from the Author or Editor: on page 4 of the print text / PDF change "integrating connecting C, C++, ..." to "integrating C, C++, ..."
|
Anonymous |
Oct 24, 2012 |
May 17, 2013 |
| PDF |
Page 23
|
For the code example following:
In [301]: tz_counts[:10].plot(kind='barh', rot=0)
The 'plot' function has no visible effect. Should be in iPython? (which also doesn't work.)
Note from the Author or Editor: There should be a note at the beginning of the chapter to run IPython in pylab mode.
Editors: please place a note at the end of the opening paragraph that says:
"To follow along with these examples, you should run IPython in Pylab mode by running <literal>ipython --pylab</literal> at the command prompt."
|
Brian Piercy |
Dec 04, 2012 |
May 17, 2013 |
| Printed, PDF |
Page 23
middle of page |
In the PDF version, the url overshoots the page
Note from the Author or Editor: Editors please insert a line break like so in the console output
Out[304]: u'Mozilla/5.0 (Linux; U; Android 2.2.2; en-us; LG-P925/V10e Build/FRG83G) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1'
|
Anonymous |
Apr 18, 2013 |
May 17, 2013 |
| Printed, PDF, ePub, Mobi, Safari Books Online, Other Digital Version |
Page 24
two fifths down the page |
Found same problem as CJ:
66
In the following line:
operating_system = np.where(cframe['a'].str.contains('Windows'), 'Windows', 'Not Windows')
np was not defined, so this line gives an error
99
Question: Why don't any of these known errata get confirmed/addressed by the author or staff at O'Reilly?
Note from the Author or Editor: On page 21 please change the code line In [290]: about halfway down the page from
In [290]: import pandas as pd
to
In [290]: import pandas as pd; import numpy as np
This mistake is fairly minor (all things considered) as these code examples are intended to be run in IPython in "pylab" mode (ipython --pylab) which will have imported NumPy and created the np alias. Sorry about that
|
Moritz Heukamp |
May 11, 2013 |
May 17, 2013 |
| PDF |
Page 40
in [3] |
While executing the code from the book:
In [3]: data = {i : randn() for i in range(7)}
I got the following error: NameError: global name 'randn' is not defined.
I solved it by using "from scipy import randn".
(Perhaps included packages depend on ipython configuration.)
Note from the Author or Editor: Page 46 in the printed text, please insert the line
In [541]: import numpy as np
right above the In [542]: ...
and make sure there is a blank line for consistent formatting
|
Anonymous |
Aug 15, 2012 |
May 17, 2013 |
| PDF |
Page 53
Table 3-1 |
Commands are given as 'Ctrl-P', 'CTRL-A', etc. with the letter in UPPERCASE, which is potentially confusing, since the keys are to be pressed without the shift key (except 'Ctrl-Shift-v'). In fact, without the example containing a 'Shift', I would not be sure this is an error.
Note from the Author or Editor: A fair point.
Editors: Please change the single letters in the command shortcuts in Table 3-1 to lowercase. E.g.
Ctrl-Shift-V
should be
Ctrl-Shift-v
and Ctrl-B should be Ctrl-b
Thanks
|
Steven Pav |
Dec 27, 2012 |
May 17, 2013 |
| Printed |
Page 54
2nd paragraph |
... designed to faciliate common tasks ...
Note from the Author or Editor: Please fix facilitate typo
|
Frans Koning |
Nov 22, 2012 |
May 17, 2013 |
| Printed |
Page 65
Paragraph 1 |
what is referred to as Table 3-3 in the text is actually displayed as Table 3-4
Note from the Author or Editor: Confirmed. Please fix reference to Table 3-4
|
Anonymous |
Apr 18, 2013 |
May 17, 2013 |
| Printed |
Page 69
Paragraph 4, last sentence |
'while' should be 'whole'
Note from the Author or Editor: Confirmed, thanks
|
Anonymous |
Apr 18, 2013 |
May 17, 2013 |
| Printed |
Page 75
paragraph 2, sentence 2 |
'willl' should be 'will'
Note from the Author or Editor: Confirmed. thanks
|
Anonymous |
Apr 18, 2013 |
May 17, 2013 |
| Printed |
Page 83
Last line in table 4-2 on this page |
"float64, float128" should read "float64" only. "float128" already correctly appears on the next line in the table (on page 84).
Note from the Author or Editor: Correct. Please delete the ", float128" there
|
Dan Grossman |
Jan 25, 2013 |
May 17, 2013 |
| Printed |
Page 86
Final paragraph, first sentence. |
"... especially if they have used ..."
should read
"... especially if you have used ..."
Note from the Author or Editor: Thanks, please correct typo as described
|
Dan Grossman |
Jan 25, 2013 |
May 17, 2013 |
| Printed |
Page 90
paragraph 1, sentence 2 |
par 1, sentence 2 is a fragment
Note from the Author or Editor: Change the first two sentences of that paragraph to
Suppose each name corresponds to a row in the <literal>data</literal> array, and we wanted to select all the rows with corresponding name <literal>'Bob'</literal>.
|
Anonymous |
Apr 18, 2013 |
May 17, 2013 |
| Printed, PDF |
Page 99
Second to last paragraph |
"scalers" should be "scalars"
|
 Wes McKinney
|
May 13, 2013 |
May 17, 2013 |
| Printed, PDF |
Page 100
United States |
1 * cond1 + 2 * cond2 + 3 * -(cond1 | cond2)
is not equivalent to the two other code examples offered. In particular, if cond1 and cond2 are both False, the result is 0, not 3.
Note from the Author or Editor: Oops.
Please change that line of code to
1 * (cond1 & -cond2) + 2 * (cond2 & -cond1) + 3 * -(cond1 | cond2)
|
Aaron Schumacher |
Apr 07, 2013 |
May 17, 2013 |
| Printed, PDF |
Page 106
Table 4-7 |
For pinv description remove the word "square" (this function does not require that the matrices be square)
|
 Wes McKinney
|
May 13, 2013 |
May 17, 2013 |
| Printed, PDF |
Page 106
Table 4-7 |
In description of lstsq, replace "y = Xb" with the more commonly used "Ax = b"
|
 Wes McKinney
|
May 13, 2013 |
May 17, 2013 |
|
Page 107
Table 4-8 |
Table 4-8: the description for binomial should read 'Draw samples
from a binomial distribution'
Note from the Author or Editor: Please fix as described. thanks!
|
Anonymous |
Apr 18, 2013 |
May 17, 2013 |
| Printed, PDF, ePub, Mobi, Safari Books Online, Other Digital Version |
Page 107
Middle of page |
Change "See table Table 4-8..." to "See Table 4-8..."
|
 Wes McKinney
|
May 12, 2013 |
May 17, 2013 |
| PDF |
Page 119
Table 5-5 |
The description of the copy option for reindex in table 5-5 of the current (as of 8/2/12) preprint version may be wrong. It says that copy is "Do not copy underlying data if new index is equivalent to old index."
I believe this is the opposite of copy's behavior, and the words "Do not" should be removed.
Note from the Author or Editor: Change text to
If True, always copy underlying data even if new index is equivalent to old index. Otherwise, do not copy the data when the indexes are equivalent.
|
Dan Becker |
Aug 02, 2012 |
May 17, 2013 |
| PDF |
Page 123
Table 5-6, 2nd row |
"Selects single row of subset of rows from the DataFrame."
shoud probably be
"Selects single row or subset of rows from the DataFrame."
Note from the Author or Editor: Confirmed typo as described
|
Guan Yang |
Aug 16, 2012 |
May 17, 2013 |
| Printed |
Page 125
Last sentence |
last sentence: should read 'Here are some examples of this:'
Note from the Author or Editor: please fix as described. thanks!
|
Anonymous |
Apr 18, 2013 |
May 17, 2013 |
| Printed, PDF |
Page 152
Final code block |
The line currently is:
frame = DataFrame(np.arange(6).reshape(3, 2)), index=[2, 0, 1])
It should instead be:
frame = DataFrame(np.arange(6).reshape(3, 2), index=[2, 0, 1])
Note from the Author or Editor: Confirmed. please change as described
|
Joshua Lande |
Mar 14, 2013 |
May 17, 2013 |
| PDF |
Page 160
United States |
keep_date_col description is inconsistent with the pandas documention. Should be:
If joining columns to parse date, keep the joined columns. Default False
Note from the Author or Editor: Confirmed. Please change as described
|
Thomas Maloney |
Jan 04, 2013 |
May 17, 2013 |
| PDF |
Page 170
Middle |
The Output of perf = DataFrame(data) is not correct. As printed:
In [928]: perf
Out[928]:
Empty DataFrame
Columns: array([], dtype=int64)
Index: array([], dtype=int64)
But should be:
<class 'pandas.core.frame.DataFrame'>
Int64Index: 648 entries, 0 to 647
Data columns:
AGENCY_NAME 648 non-null values
CATEGORY 648 non-null values
DESCRIPTION 648 non-null values
FREQUENCY 648 non-null values
INDICATOR_NAME 648 non-null values
INDICATOR_UNIT 648 non-null values
MONTHLY_ACTUAL 648 non-null values
MONTHLY_TARGET 648 non-null values
PERIOD_MONTH 648 non-null values
PERIOD_YEAR 648 non-null values
YTD_ACTUAL 648 non-null values
YTD_TARGET 648 non-null values
dtypes: int64(2), object(10)
Note from the Author or Editor: Confirmed. Please change the text of Out[928]: to
<class 'pandas.core.frame.DataFrame'>
Int64Index: 648 entries, 0 to 647
Data columns:
AGENCY_NAME 648 non-null values
CATEGORY 648 non-null values
DESCRIPTION 648 non-null values
FREQUENCY 648 non-null values
INDICATOR_NAME 648 non-null values
INDICATOR_UNIT 648 non-null values
MONTHLY_ACTUAL 648 non-null values
MONTHLY_TARGET 648 non-null values
PERIOD_MONTH 648 non-null values
PERIOD_YEAR 648 non-null values
YTD_ACTUAL 648 non-null values
YTD_TARGET 648 non-null values
dtypes: int64(2), object(10)
|
Thomas Maloney |
Jan 04, 2013 |
May 17, 2013 |
| PDF, ePub, Mobi |
Page 192
Beginning of section Pivoting “long” to “wide” Format |
The section begins:
A common way to store multiple time series in databases and CSV is in so-called long or stacked format:
In [116]: ldata[:10]
However, the variable ldata has not been defined or initialized previously (or later) in the book.
Note from the Author or Editor: Yeah, I left the code to make that DataFrame out as it was derived in a mungy way from the macrodata used earlier.
Editors: please put a note in parentheses after "stacked format" that says
"... or stacked format (code to create this DataFrame omitted for brevity):" or something. pretty trivial for the user to type this in
|
David Kimery |
Apr 17, 2013 |
May 17, 2013 |
| PDF |
Page 204
somewhere |
ch07/movies.dat is not there (is in ch02/movielens)
Note from the Author or Editor: Thanks.
please change 'ch07/movies.dat' to 'ch02/movielens/movies.dat' in the code
|
Miki Tebeka |
Nov 09, 2012 |
May 17, 2013 |
|
Page 223
Table 8-1 |
Table 8-1: the description for 'subplot_kw' is cut off
Note from the Author or Editor: Please change the description for subplot_kw to
Dict of keywords passed to <literal>add_subplot</literal> call used to create each subplot.
|
Anonymous |
Apr 18, 2013 |
May 17, 2013 |
|
Page 235
paragraph1, sentence 1 |
par 1 sentence 1: should read '... is as simple as ...'
Note from the Author or Editor: Please fix typo as described. thanks!
|
Anonymous |
Apr 18, 2013 |
May 17, 2013 |
| PDF |
Page 241
somewhere |
scatter_matrix(trans_data, diagonal='kde', color='k', alpha=0.3)
should be
pd.scatter_matrix(trans_data, diagonal='kde', color='k', alpha=0.3)
Note from the Author or Editor: Thanks. Please change code as described (add pd. to start of statement)
|
Miki Tebeka |
Nov 09, 2012 |
May 17, 2013 |
| Printed, PDF, ePub, Mobi, Safari Books Online, Other Digital Version |
Page 241-242
Fig 8-23 |
Fig 8-23 appears to be identical to Fig 8-22
Note from the Author or Editor: Not sure what happened here, 8-23 is supposed to be a different figure if you read the text closely.
Here is a figure to replace 8-23 (should just be a drop-in replacement), editors please contact me if you need any changes to this:
https://www.dropbox.com/s/annqtoank0snrwu/scatter_matrix_fix_20130512.pdf
|
Anonymous |
Apr 18, 2013 |
May 17, 2013 |
| PDF |
Page 282
somewhere |
Should be return totals.order(ascending=False)[:n] (was [-n:])
Note from the Author or Editor: Correct. Please fix code typo as described (replace [-n:] with [:n])
|
Miki Tebeka |
Nov 09, 2012 |
May 17, 2013 |
| Printed |
Page 308
middle of page |
Out[470] should be 'Period('2007-06', 'M')'
Note from the Author or Editor: Confirmed, please make change as described
There is also a formatting mistake right before "Out [470]:" , please fix that also
|
Anonymous |
Apr 18, 2013 |
May 17, 2013 |
| Printed, PDF, ePub, Mobi, Safari Books Online, Other Digital Version |
Page 324
bottom of page |
In[570]: spx_px is has not been defined in the chapter yet
Note from the Author or Editor: Please add code line just above In [570]:
In [569]: spx_px = close_px_all['SPX']
Make sure there is a blank line between that code line and the next one to keep the styling consistent
|
Anonymous |
Apr 18, 2013 |
May 17, 2013 |
| Printed, PDF, ePub, Mobi, Safari Books Online, Other Digital Version |
Page 358
In Figure 12-3 |
arr.reshape((3,4), order=?)
should read
arr.reshape((4,3), order=?)
Note from the Author or Editor: Correct, please fix figure text as described. Surprised this one evaded me but it's obvious once you see it =)
|
Dan Grossman |
Jan 25, 2013 |
May 17, 2013 |
| Printed |
Page 363
Bottom of page |
In box, The Broadcasting Ru should be The Broadcasting Rule
|
 Wes McKinney
|
May 12, 2013 |
May 17, 2013 |
| PDF |
Page 365
image |
Quote from page 364:
"See Figure 12-6 for another illustration, this time subtracting a two-dimensional array from a three-dimensional one across axis 0."
Figure 12-6 does not show subtraction nor numbers representing numpy data make any sense
Note from the Author or Editor: The figure and text needs fixing
The text: change "subtracting... from ..." to "adding...to..."
In the Figure 12-6, change the numbers in the result to be double what they are, so instead of 0, 1, 2, 3, 4, 5, 6, 7, make then in the corresponding order double that, 0, 2, 4, 6, ...
|
klo |
Oct 31, 2012 |
May 17, 2013 |
| Printed |
Page 400
middle of page |
The text currently says:
"When aggregating of otherwise grouping time series data, ..."
It probably should say
"When aggregating or otherwise grouping time series data"
Note from the Author or Editor: Please fix typo as described, thanks
|
Anonymous |
Apr 15, 2013 |
May 17, 2013 |
| Printed, PDF, ePub, Mobi, Safari Books Online, Other Digital Version |
Page 418
last line |
IT IS:
loc_mapping = dict((val, idx) for idx, val in enumerate(strings)}
SHOULD BE:
loc_mapping = dict((val, idx) for idx, val in enumerate(strings))
NOTE: Last character of code line should be ) and not }... probably from wrong copy&paster of previous code line. It's obvious, but I checked this with IPython.
Note from the Author or Editor: Please fix typo as submitter described (replace curly brace with parenthesis)
Thanks!
|
jose.m.marti@uv.es |
May 09, 2013 |
May 17, 2013 |
| Printed, PDF, ePub, Mobi, Safari Books Online, Other Digital Version |
Page 427
Last code example in section "Currying: Partial Argument Application" |
In the code comment:
# Take the 60-day moving average of of all time series in data
"of" is repeated.
Note from the Author or Editor: Please fix typo as described (remove duplicate "of")
|
jose.m.marti@uv.es |
May 09, 2013 |
May 17, 2013 |
| Printed, PDF, ePub, Mobi, Safari Books Online, Other Digital Version |
Page 432
Last line in Table A-6 |
IS:
True is the file is closed.
SHOULD BE:
True if the file is closed.
Note from the Author or Editor: Please make change as submitter described (replace is with if)
|
jose.m.marti@uv.es |
May 10, 2013 |
May 17, 2013 |
|