Skip to content

Commit 26545b0

Browse files
committed
Merge commit 'v0.7.0rc1-205-g8610be5' into debian
* commit 'v0.7.0rc1-205-g8610be5': (22 commits) BUG: open file in Python 3 with given encoding BUG: actually pass encoding to UnicodeWriter BUG: use UnicodeWriter on Python 2.x TST: fix vbench per Series constructor api change TST: fix numerical stability issue present on certain platforms DOC: readme update TST: fix debian / 2.5 test BUG: always return True for onOffset for regular DateOffset, close pandas-dev#770 Fixed regression with Panels caused by NDFrame not checking if it was DataFrame before assuming it had a 'columns' attribute. Tests for 'mixed depth' hierarchical columns. Tests for getting, setting, dropping and popping columns from dataframes which have MultiIndexed columns containing some empty strings at the lower levels, by indexing with only the upper levels. Also modified NDFrame._set_item to use the same shorthand. Modifications to column-hierarchical behaviour as per "'Mixed depth' hierarchical column labels'" discussion on pystatsmodels. If column label tuples contain only empty strings at the lower levels, allows the DataFrame to be indexed with only the higher levels. So for example if a column has the hierarchical label ('a','',''), and there are no other columns with 'a' at their top level, then this change allows the column to be pulled out with df['a'], rather than df['a','','']. It also names the resulting series 'a'. The use case for this is when some columns have a deeper hierarchy than others, and you want to treat the shallower columns as if the lower levels of the hierarchy weren't there. STY: fit in 80 columns Add sheet_names property to ExcelFile, with tests Put ExcelWriter in pandas namespace TST: test coverage TST: test coverage, pep8 TST: skip test on Python 3 TST: use BytesIO with encoded text for python3 DOC: update docs to reflect new PyData home STY: pep8 ...
2 parents b5d2a0a + 8610be5 commit 26545b0

32 files changed

+594
-269
lines changed

README.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Here are just a few of the things that pandas does well:
4747
Where to get it
4848
===============
4949

50-
The source code is currently hosted on GitHub at: http://github.com/wesm/pandas
50+
The source code is currently hosted on GitHub at: http://github.com/pydata/pandas
5151

5252
Binary installers for the latest released version are available at the Python
5353
package index::
@@ -91,7 +91,7 @@ On Windows, you will need to install MinGW and execute::
9191
python setup.py build --compiler=mingw32
9292
python setup.py install
9393

94-
See http://pandas.sourceforge.net/ for more information.
94+
See http://pandas.pydata.org/ for more information.
9595

9696
License
9797
=======
@@ -101,7 +101,7 @@ BSD
101101
Documentation
102102
=============
103103

104-
The official documentation is hosted on SourceForge: http://pandas.sourceforge.net/
104+
The official documentation is hosted on PyData.org: http://pandas.pydata.org/
105105

106106
The Sphinx documentation should provide a good starting point for learning how
107107
to use the library. Expect the docs to continue to expand as time goes on.
@@ -124,4 +124,3 @@ the pystatsmodels mailing list / Google group, where
124124
http://groups.google.com/group/pystatsmodels
125125

126126
.. _NumPy: http://numpy.scipy.org/
127-
.. _downloaded there: https://github.com/wesm/pandas/archives/master

RELEASE.rst

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Release Notes
33
=============
44

55
This is the list of changes to pandas between each release. For full details,
6-
see the commit logs at http://github.com/wesm/pandas
6+
see the commit logs at http://github.com/pydata/pandas
77

88
What is it
99
----------
@@ -18,14 +18,14 @@ analysis / manipulation tool available in any language.
1818
Where to get it
1919
---------------
2020

21-
* Source code: http://github.com/wesm/pandas
21+
* Source code: http://github.com/pydata/pandas
2222
* Binary installers on PyPI: http://pypi.python.org/pypi/pandas
23-
* Documentation: http://pandas.sourceforge.net
23+
* Documentation: http://pandas.pydata.org
2424

2525
pandas 0.7.0
2626
============
2727

28-
**Release date:** NOT YET RELEASED
28+
**Release date:** 2/9/2012
2929

3030
**New features / modules**
3131

@@ -91,11 +91,13 @@ pandas 0.7.0
9191
- Add ``sort`` option to ``DataFrame.join`` (GH #731)
9292
- Improved handling of NAs (propagation) in binary operations with
9393
dtype=object arrays (GH #737)
94+
- Add ``abs`` method to Pandas objects
95+
- Added ``algorithms`` module to start collecting central algos
9496

9597
**API Changes**
9698

9799
- Label-indexing with integer indexes now raises KeyError if a label is not
98-
found instead of falling back on location-based indexing
100+
found instead of falling back on location-based indexing (GH #700)
99101
- Label-based slicing via ``ix`` or ``[]`` on Series will now only work if
100102
exact matches for the labels are found or if the index is monotonic (for
101103
range selections)
@@ -119,6 +121,8 @@ pandas 0.7.0
119121
#395)
120122
- The default delimiter for ``read_csv`` is comma rather than letting
121123
``csv.Sniffer`` infer it
124+
- Rename ``col_or_columns`` argument in ``DataFrame.drop_duplicates`` (GH
125+
#734)
122126

123127
**Improvements to existing features**
124128

@@ -178,6 +182,14 @@ pandas 0.7.0
178182
- Substantially improved performance of groupby on DataFrames with many
179183
columns by aggregating blocks of columns all at once (GH #745)
180184
- Can pass a file handle or StringIO to Series/DataFrame.to_csv (GH #765)
185+
- Can pass sequence of integers to DataFrame.irow(icol) and Series.iget, (GH
186+
#654)
187+
- Prototypes for some vectorized string functions
188+
- Add float64 hash table to solve the Series.unique problem with NAs (GH #714)
189+
- Memoize objects when reading from file to reduce memory footprint
190+
- Can get and set a column of a DataFrame with hierarchical columns
191+
containing "empty" ('') lower levels without passing the empty levels (PR
192+
#768)
181193

182194
**Bug fixes**
183195

@@ -261,12 +273,41 @@ pandas 0.7.0
261273
- Use right dropna function for SparseSeries. Return dense Series for NA fill
262274
value (GH #730)
263275
- Fix Index.format bug causing incorrectly string-formatted Series with
264-
datetime indexes (# 758)
276+
datetime indexes (# 726, 758)
265277
- Fix errors caused by object dtype arrays passed to ols (GH #759)
278+
- Fix error where column names lost when passing list of labels to
279+
DataFrame.__getitem__, (GH #662)
280+
- Fix error whereby top-level week iterator overwrote week instance
281+
- Fix circular reference causing memory leak in sparse array / series /
282+
frame, (GH #663)
283+
- Fix integer-slicing from integers-as-floats (GH #670)
284+
- Fix zero division errors in nanops from object dtype arrays in all NA case
285+
(GH #676)
286+
- Fix csv encoding when using unicode (GH #705, #717, #738)
287+
- Fix assumption that each object contains every unique block type in concat,
288+
(GH #708)
289+
- Fix sortedness check of multiindex in to_panel (GH #719, 720)
290+
- Fix that None was not treated as NA in PyObjectHashtable
291+
- Fix hashing dtype because of endianness confusion (GH #747, #748)
292+
- Fix SparseSeries.dropna to return dense Series in case of NA fill value (GH
293+
#730)
294+
- Use map_infer instead of np.vectorize. handle NA sentinels if converter
295+
yields numeric array, (GH #753)
296+
- Fixes and improvements to DataFrame.rank (GH #742)
297+
- Fix catching AttributeError instead of NameError for bottleneck
298+
- Try to cast non-MultiIndex to better dtype when calling reset_index (GH #726
299+
#440)
300+
- Fix #1.QNAN0' float bug on 2.6/win64
301+
- Allow subclasses of dicts in DataFrame constructor, with tests
302+
- Fix problem whereby set_index destroys column multiindex (GH #764)
303+
- Hack around bug in generating DateRange from naive DateOffset (GH #770)
304+
- Fix bug in DateRange.intersection causing incorrect results with some
305+
overlapping ranges (GH #771)
266306

267307
Thanks
268308
------
269309
- Craig Austin
310+
- Chris Billington
270311
- Marius Cobzarenco
271312
- Mario Gamboa-Cavazos
272313
- Hans-Martin Gaudecker

doc/source/basics.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ optional ``level`` parameter which applies only if the object has a
277277
``median``, Arithmetic median of values
278278
``min``, Minimum
279279
``max``, Maximum
280+
``abs``, Absolute Value
280281
``prod``, Product of values
281282
``std``, Unbiased standard deviation
282283
``var``, Unbiased variance

doc/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pandas: powerful Python data analysis toolkit
1212

1313
**Installers:** http://pypi.python.org/pypi/pandas
1414

15-
**Code Repository:** http://github.com/wesm/pandas
15+
**Code Repository:** http://github.com/pydata/pandas
1616

1717
**Mailing List:** http://groups.google.com/group/pystatsmodels
1818

doc/source/indexing.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ label, respectively.
140140
panel.major_xs(date)
141141
panel.minor_xs('A')
142142
143+
143144
Slicing ranges
144145
~~~~~~~~~~~~~~
145146

@@ -473,6 +474,12 @@ operators:
473474
a & b
474475
a - b
475476
477+
``isin`` method of Index objects
478+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
479+
480+
One additional operation is the ``isin`` method that works analogously to the
481+
``Series.isin`` method found :ref:`here <indexing.boolean>`.
482+
476483
.. _indexing.hierarchical:
477484

478485
Hierarchical indexing (MultiIndex)
@@ -643,6 +650,18 @@ but as you use it you may uncover corner cases or unintuitive behavior. If you
643650
do find something like this, do not hesitate to report the issue or ask on the
644651
mailing list.
645652

653+
.. _indexing.xs:
654+
655+
Cross-section with hierarchical index
656+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
657+
658+
The ``xs`` method of ``DataFrame`` additionally takes a level argument to make
659+
selecting data at a particular level of a MultiIndex easier.
660+
661+
.. ipython:: python
662+
663+
df.xs('one', level='second')
664+
646665
.. _indexing.advanced_reindex:
647666

648667
Advanced reindexing and alignment with hierarchical index

doc/source/install.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Installation
88

99
You have the option to install an `official release
1010
<http://pypi.python.org/pypi/pandas>`__ or to build the `development version
11-
<http://github.com/wesm/pandas>`__. If you choose to install from source and
11+
<http://github.com/pydata/pandas>`__. If you choose to install from source and
1212
are running Windows, you will have to ensure that you have a compatible C
1313
compiler (MinGW or Visual Studio) installed. `How-to install MinGW on Windows
1414
<http://docs.cython.org/src/tutorial/appendix.html>`__
@@ -63,12 +63,12 @@ Installing from source
6363
files. I recommend installing the latest Cython via ``easy_install -U
6464
Cython``
6565

66-
The source code is hosted at http://github.com/wesm/pandas, it can be checked
66+
The source code is hosted at http://github.com/pydata/pandas, it can be checked
6767
out using git and compiled / installed like so:
6868

6969
::
7070

71-
git clone git://github.com/wesm/pandas.git
71+
git clone git://github.com/pydata/pandas.git
7272
cd pandas
7373
python setup.py install
7474

doc/source/io.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ data into a DataFrame object. They can take a number of arguments:
9595
columns, where keys are either integers or column labels
9696
- ``encoding``: a string representing the encoding to use if the contents are
9797
non-ascii, for python versions prior to 3
98+
- ``verbose`` : show number of NA values inserted in non-numeric columns
9899

99100
.. ipython:: python
100101
:suppress:

doc/source/reshaping.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,39 @@ calling ``to_string`` if you wish:
284284
285285
Note that ``pivot_table`` is also available as an instance method on DataFrame.
286286

287+
Cross tabulations
288+
~~~~~~~~~~~~~~~~~
289+
290+
Use the ``crosstab`` function to compute a cross-tabulation of two (or more)
291+
factors. By default ``crosstab`` computes a frequency table of the factors
292+
unless an array of values and an aggregation function are passed.
293+
294+
It takes a number of arguments
295+
296+
- ``rows``: array-like, values to group by in the rows
297+
- ``cols``: array-like, values to group by in the columns
298+
- ``values``: array-like, optional, array of values to aggregate according to
299+
the factors
300+
- ``aggfunc``: function, optional, If no values array is passed, computes a
301+
frequency table
302+
- ``rownames``: sequence, default None, must match number of row arrays passed
303+
- ``colnames``: sequence, default None, if passed, must match number of column
304+
arrays passed
305+
- ``margins``: boolean, default False, Add row/column margins (subtotals)
306+
307+
Any Series passed will have their name attributes used unless row or column
308+
names for the cross-tabulation are specified
309+
310+
For example:
311+
312+
.. ipython:: python
313+
314+
foo, bar, dull, shiny, one, two = 'foo', 'bar', 'dull', 'shiny', 'one', 'two'
315+
a = np.array([foo, foo, bar, bar, foo, foo], dtype=object)
316+
b = np.array([one, one, two, one, two, one], dtype=object)
317+
c = np.array([dull, dull, shiny, dull, dull, shiny], dtype=object)
318+
crosstab(a, [b, c], rownames=['a'], colnames=['b', 'c'])
319+
287320
.. _reshaping.pivot.margins:
288321

289322
Adding margins (partial aggregates)

doc/source/whatsnew/v0.4.x.txt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,21 @@ Performance Enhancements
5757
- Wrote fast time series merging / joining methods in Cython. Will be
5858
integrated later into DataFrame.join and related functions
5959

60-
.. _PR146: https://github.com/wesm/pandas/pull/146
61-
.. _ENH1b: https://github.com/wesm/pandas/commit/1ba56251f0013ff7cd8834e9486cef2b10098371
62-
.. _ENHdc: https://github.com/wesm/pandas/commit/dca3c5c5a6a3769ee01465baca04cfdfa66a4f76
63-
.. _GH135: https://github.com/wesm/pandas/issues/135
64-
.. _PR151: https://github.com/wesm/pandas/pull/151
65-
.. _ENHed: https://github.com/wesm/pandas/commit/edd9f1945fc010a57fa0ae3b3444d1fffe592591
66-
.. _PR142: https://github.com/wesm/pandas/pull/142
67-
.. _PR141: https://github.com/wesm/pandas/pull/141
68-
.. _IS188: https://github.com/wesm/pandas/issues/188
69-
.. _ENH56: https://github.com/wesm/pandas/commit/56e0c9ffafac79ce262b55a6a13e1b10a88fbe93
70-
.. _GH187: https://github.com/wesm/pandas/issues/187
71-
.. _GH176: https://github.com/wesm/pandas/issues/176
72-
.. _GH104: https://github.com/wesm/pandas/issues/104
73-
.. _GH205: https://github.com/wesm/pandas/issues/205
74-
.. _PR209: https://github.com/wesm/pandas/pull/209
75-
.. _GH203: https://github.com/wesm/pandas/issues/203
76-
.. _PR200: https://github.com/wesm/pandas/pull/200
60+
.. _PR146: https://github.com/pydata/pandas/pull/146
61+
.. _ENH1b: https://github.com/pydata/pandas/commit/1ba56251f0013ff7cd8834e9486cef2b10098371
62+
.. _ENHdc: https://github.com/pydata/pandas/commit/dca3c5c5a6a3769ee01465baca04cfdfa66a4f76
63+
.. _GH135: https://github.com/pydata/pandas/issues/135
64+
.. _PR151: https://github.com/pydata/pandas/pull/151
65+
.. _ENHed: https://github.com/pydata/pandas/commit/edd9f1945fc010a57fa0ae3b3444d1fffe592591
66+
.. _PR142: https://github.com/pydata/pandas/pull/142
67+
.. _PR141: https://github.com/pydata/pandas/pull/141
68+
.. _IS188: https://github.com/pydata/pandas/issues/188
69+
.. _ENH56: https://github.com/pydata/pandas/commit/56e0c9ffafac79ce262b55a6a13e1b10a88fbe93
70+
.. _GH187: https://github.com/pydata/pandas/issues/187
71+
.. _GH176: https://github.com/pydata/pandas/issues/176
72+
.. _GH104: https://github.com/pydata/pandas/issues/104
73+
.. _GH205: https://github.com/pydata/pandas/issues/205
74+
.. _PR209: https://github.com/pydata/pandas/pull/209
75+
.. _GH203: https://github.com/pydata/pandas/issues/203
76+
.. _PR200: https://github.com/pydata/pandas/pull/200
7777

doc/source/whatsnew/v0.5.0.txt

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,22 @@ Performance Enhancements
3939
- VBENCH Significantly sped up conversion of nested dict into DataFrame (GH212_)
4040
- VBENCH Significantly speed up DataFrame ``__repr__`` and ``count`` on large mixed-type DataFrame objects
4141

42-
.. _GH214: https://github.com/wesm/pandas/issues/214
43-
.. _GH248: https://github.com/wesm/pandas/issues/248
44-
.. _GH253: https://github.com/wesm/pandas/issues/253
45-
.. _GH261: https://github.com/wesm/pandas/issues/261
46-
.. _GH234: https://github.com/wesm/pandas/issues/234
47-
.. _GH243: https://github.com/wesm/pandas/issues/243
48-
.. _GH223: https://github.com/wesm/pandas/issues/223
49-
.. _PR244: https://github.com/wesm/pandas/pull/244
50-
.. _PR233: https://github.com/wesm/pandas/pull/233
51-
.. _GH230: https://github.com/wesm/pandas/issues/230
52-
.. _PR241: https://github.com/wesm/pandas/pull/241
53-
.. _GH242: https://github.com/wesm/pandas/issues/242
54-
.. _GH212: https://github.com/wesm/pandas/issues/212
55-
.. _GH211: https://github.com/wesm/pandas/issues/211
56-
.. _GH215: https://github.com/wesm/pandas/issues/215
57-
.. _GH213: https://github.com/wesm/pandas/issues/213
58-
.. _ENH61: https://github.com/wesm/pandas/commit/6141961
59-
.. _PR334: https://github.com/wesm/pandas/pull/334
60-
.. _ENH5c: https://github.com/wesm/pandas/commit/5ca6ff5d822ee4ddef1ec0d87b6d83d8b4bbd3eb
42+
.. _GH214: https://github.com/pydata/pandas/issues/214
43+
.. _GH248: https://github.com/pydata/pandas/issues/248
44+
.. _GH253: https://github.com/pydata/pandas/issues/253
45+
.. _GH261: https://github.com/pydata/pandas/issues/261
46+
.. _GH234: https://github.com/pydata/pandas/issues/234
47+
.. _GH243: https://github.com/pydata/pandas/issues/243
48+
.. _GH223: https://github.com/pydata/pandas/issues/223
49+
.. _PR244: https://github.com/pydata/pandas/pull/244
50+
.. _PR233: https://github.com/pydata/pandas/pull/233
51+
.. _GH230: https://github.com/pydata/pandas/issues/230
52+
.. _PR241: https://github.com/pydata/pandas/pull/241
53+
.. _GH242: https://github.com/pydata/pandas/issues/242
54+
.. _GH212: https://github.com/pydata/pandas/issues/212
55+
.. _GH211: https://github.com/pydata/pandas/issues/211
56+
.. _GH215: https://github.com/pydata/pandas/issues/215
57+
.. _GH213: https://github.com/pydata/pandas/issues/213
58+
.. _ENH61: https://github.com/pydata/pandas/commit/6141961
59+
.. _PR334: https://github.com/pydata/pandas/pull/334
60+
.. _ENH5c: https://github.com/pydata/pandas/commit/5ca6ff5d822ee4ddef1ec0d87b6d83d8b4bbd3eb

0 commit comments

Comments
 (0)