Python for Data Analysis

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
Safari Books Online
percentage=42.66560818558702
5th of "Manually Working With Delimited Formats"

Following the text, using Python 2.7.3, I did: ================================================== class my_dialect(csv.Dialect): lineterminator = '\n' delimiter = ';' quotechar = '"' reader = csv.reader(f, dialect=my_dialect) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-290-0a8ad3677c01> in <module>() ----> 1 reader = csv.reader(f, dialect=my_dialect) TypeError: "quoting" must be an integer ================================================== The following code, which includes the required specification of the quoting field in the my_dialect subclass, gives no error: ================================================== class my_dialect(csv.Dialect): lineterminator = '\n' delimiter = ';' quotechar = '"' quoting = csv.QUOTE_MINIMAL reader = csv.reader(f, dialect=my_dialect) ==================================================

Note from the Author or Editor:
I think you're right. Editors, could you add the following line in the my_dialect class as indicated quoting = csv.QUOTE_MINIMAL please mind the 4 space indentation; this line should align with the quotechar, delimiter, etc. as listed

Ruchira S. Datta  Jun 06, 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
Printed, PDF, ePub
Page 6-8
Installation and Setup

Dear Sirs: I have just purchased Wes McKinney’s Python for Data Analysis. I am trying to install Python as instructed on pages 6-8 of the book, but I am running into problems. It appears that the Python package that comes with EDPFree and the Pandas library are both essential for me to use the book. When I try to install Pandas on top of EDPFree (which is now Canopy Express), I get the error message: “Python version 2.7 required, which was not found in the registry.” I am running Windows 7 (32-bit). The author recommends uninstalling the previous version of Python and then installing EPDFree, which has been changed to Enthought Canopy. After I do that, Python does not appear in Add or Remove Programs anymore, but Enthought Canopy does. The Canopy interface works, and it can run a simple script. It says that – contrary to the error message – I do have version 2.7 of Python installed. The author recommends installing pandas-0.9.0.win32-py2.7.exe. Only version 11 is now available, so I downloaded that. When I googled the error message, I got a suggestion to add C:\Python27; and C:\Python27\Scripts; to my system path, but that did not help. Google also gave me a suggestion to uninstall Python (which means Canopy in this case) for all users and re-install for just me. This also did not help. As things now stand, I do not think I will be able to make any use of the book. Is there a forum or an author’s page that addresses this problem? Thank you, John Chesnut

Note from the Author or Editor:
Since publishing the book Enthought have changed their Python distribution so that the directions are now incompatible. If you run into this problem please install the free Anaconda distribution for your platform (which includes pandas) from here: http://continuum.io/downloads

Anonymous  May 28, 2013 
PDF
Page 9
2nd paragraph

In the OS X installation it states that we should type "gcc" at the terminal command line to see if gcc is installed. I'm running Mavericks and it is not installed. I believe it's been depreciated by Apple. Is there a workaround for this issue? Thanks

Note from the Author or Editor:
Yes, Mavericks now uses clang instead of gcc. Editors, could you add a parenthesis that states "(or clang on newer versions of OS X)"

scottclausen@mac.com  Oct 23, 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 29
2nd paragraph

totals should be titles: "This produced another DataFrame containing mean ratings with movie totals as row labels and gender as column labels. " should read "This produced another DataFrame containing mean ratings with movie titles as row labels and gender as column labels. "

Note from the Author or Editor:
Good catch. Editors, please make the indicated change. Thanks

vrajmohan  Sep 26, 2013 
PDF
Page 38
Code on bottom of page 38 and top of page 39

searchsorted() is a method available for NumPy arrays, not Pandas Series. So to get the code in the book to work, I needed to first convert the Series to a NumPy array with array(). In final code, the get_quantile_count() function is as follows: # Get number of distinct names in the top 50% of births using clever NumPy hack def get_quantile_count(group, q=0.5): group = group.sort_index(by='prop', ascending=False) return array(group.prop.cumsum()).searchsorted(q) + 1

Note from the Author or Editor:
Ah, this is a casualty of some API changes in pandas: Editors, could you change the indicated line to be instead: group.prop.cumsum().values.searchsorted(q) + 1

Todd Leonhardt  Sep 14, 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 43
United States

filename m1-1m /users.dat should be movielens/users.dat

Note from the Author or Editor:
Correct -- editors, could you make the indicated change (replace ml-1m with movielens)?

Anonymous  Dec 07, 2013 
ePub
Page 46
printed text,

Code from Safari: In [541]: import numpy as np In [542]: data = {i : randn() for i in range(7)} This causes an error: NameError: global name 'randn' is not defined This works data = {i : np.random.randn() for i in range(7)} Appears there is a problem with the 'import numpy as np' being incomplete.

Note from the Author or Editor:
Good catch, and I believe we tried to correct this error in the last revision. Editors, could you replace the indicated randn with np.random.randn ? thanks

Anonymous  Jun 24, 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
PDF
Page 54
Code example at bottom of page

When I try to do 'a' in _ip.user_ns it throws a NameError exception and says "name '_ip' is not defined. I can use the IPython magic %who to see if the variable is in memory or not.

Note from the Author or Editor:
I should have known better than to use a private IPython API. editors, could we remove this altogether: In [8]: 'a' in _ip.user_ns Out[8]: True change the line number of the subsequent prompt to 8 (instead of 9) then, remove the following lines: In [1]: 'a' in _ip.user_ns Out[1]: False and add these lines in its place: In [10]: a --------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-10-60b725f10c9c> in <module>() ----> 1 a NameError: name 'a' is not defined thanks

Todd Leonhardt  Sep 15, 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 67
Last sentence of third paragraph

Text reads "Here is a simple list of 700,000 strings ..." but the sample code produces 600,000 strings.

Note from the Author or Editor:
Good catch. Editors, could you change the copy to say 600,000 instead of 700,000?

James Williamson  May 26, 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 77
Top bullet points

The third bullet point in the sample configuration changes is unnecessary: it repeats the first clause of the second bullet point.

Note from the Author or Editor:
good catch. Editors, could you remove the 3rd bullet point?

jworeilly  May 26, 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
PDF
Page 89
In [84]:

As randn is a function in the numpy.random module, the line should read: data = np.random.randn(7, 4)

Note from the Author or Editor:
yes: editors, please make the indicated change

vrajmohan  Sep 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
Wes McKinney
O'Reilly Author 
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
Wes McKinney
O'Reilly Author 
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
Wes McKinney
O'Reilly Author 
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
Wes McKinney
O'Reilly Author 
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 124
table 5.5

Description for argument copy is self contradictory. Appears to say copy true means don't copy

Note from the Author or Editor:
The text could be clearer. Editors, could you change "Otherwise" to read "If False" (use fixed width font for the False) in the table?

gwideman  Jul 03, 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
Printed
Page 152
Second paragraph

Duplicate colons introduce the second example code block.

Note from the Author or Editor:
Please remove the unnecessary colon

jworeilly  Jun 07, 2013 
Printed
Page 152
Middle

For line [294] of the iget_value code example, the second ")" after the call to reshape(3, 2) is incorrect.

Note from the Author or Editor:
I believe this is already fixed in the second printing

jworeilly  Jun 07, 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
Printed
Page 162
Middle op the page

In order for data.to_csv(sys.stdout, sep='|') to work you must import sys first

Note from the Author or Editor:
Editors, find this text on the page (writing to sys.stdout so it just prints the text result) change it to (writing to sys.stdout so it just prints the text result; make sure to import sys) use fixed width font for "import sys"

Arie Ellerbrak  Aug 01, 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
Printed
Page 172
Last paragraph, 2nd sentence

Interally -> Internally

Note from the Author or Editor:
Confirmed typo

Arie Ellerbrak  Aug 02, 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
Printed
Page 192
Belgique

A reader posted earlier the following comment: "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. " Perhaps would it be helpful to slightly alter the example to make it immediately testable by the audience of the book: from pandas.core.reshape import melt, pivot df = pd.read_csv('ch07/macrodata.csv') # original format data = df.ix[:,['year', 'quarter', 'realgdp', 'infl', 'unemp']] # selection of variables data['date'] = 10*data['year']+data['quarter'] # some quick identificator for the 'date' instead of separate year and quarter variables del data['year'] del data['quarter'] ldata = melt(data, id_vars = ['date']) # long format pivoted = ldata.pivot('date', 'variable', 'value'); pivoted.head() # Note: 'item' becomes 'variable' in the rest of the example

Note from the Author or Editor:
OK, sounds good. Editors, could you remove this text: (code to create this DataFrame omitted for brevity) then, after the first code example (ldata[:10]), could you put a code block with this code used to create the example: data = pd.read_csv('ch07/macrodata.csv') periods = pd.PeriodIndex(year=data.year, quarter=data.quarter, name='date') data = DataFrame(data.to_records(), columns=pd.Index(['realgdp', 'infl', 'unemp'], name='item'), index=periods.to_timestamp('D', 'end')) ldata = data.stack().reset_index().rename(columns={0: 'value'})

Patrick Jeuniaux  Oct 14, 2013 
Printed
Page 199
Top of page.

The bins are divided into 18 to 25, 26 to 35, 35 to 60 and 60 and older. Should be 18 to 26, 26 to 35, 35 to 60, 60 and older or 18 to 25, 25 to 35, 35 to 60, 60 and older.

Note from the Author or Editor:
editors, can you please change the copy to: 18 to 25, 26 to 35, 36 to 60, and finally 61 and older

Arie Ellerbrak  Aug 02, 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
Page 324
First paragraph of Exponentially-weighted functions

The formula for the moving average is written as ma_t = a * ma_{t-1} + (a-1) * x_{-t} with a the decay factor. It should be: ma_t = a * ma_{t-1} + (1-a) * x_{t}

Note from the Author or Editor:
Good catch, please make this change

Bertrand Haut  Mar 06, 2014 
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
Wes McKinney
O'Reilly Author 
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
ePub
Page 712
1st code example, list comprehension for enough_es within for loop

In the first code example for the Nest list comprehensions section, the "if name.count('e') > 2" within the list comprehension should have a ">=" instead of a ">".

Note from the Author or Editor:
You're right. Editors, could you please make the indicated change?

Todd Leonhardt  Sep 14, 2013 
ePub
Page 727
Top of page, 1st code example

For the output to work as intended in the example, the print statement within def squares() needs to be outside the for loop within that generator function. The way the code is written, the 'Generating squares....' print will occur each time a new number is generated. But if you move the print outside the for, it will print exactly once.

Note from the Author or Editor:
Good catch. Authors could you change the code cited to look like this (mind the 4-space indents): def squares(n=10): print 'Generating squares from 1 to %d' % (n ** 2) for i in xrange(1, n + 1): yield i ** 2

Todd Leonhardt  Sep 14, 2013