Skip to content

Commit 5753e12

Browse files
committed
Merge commit 'v0.9.1rc1-27-ge374f0f' into debian
* commit 'v0.9.1rc1-27-ge374f0f': (52 commits) BUG: axes.color_cycle from mpl rcParams should not be joined as single string BUG: icol duplicate columns with integer sequence failure. close pandas-dev#2228 TST: unit test for pandas-dev#2214 BUG: coerce ndarray dtype to object when comparing series ENH: make vbench_suite/run_suite executable ENH: Use __file__ to determine REPO_PATH in vb_suite/suite.py BUG: 1 ** NA issue in computing new fill value in SparseSeries. close pandas-dev#2220 BUG: make inplace semantics of DataFrame.where consistent. pandas-dev#2230 BUG: fix internal error in constructing DataFrame.values with duplicate column names. close pandas-dev#2236 added back mask method that does condition inversion added condition testing to where that raised ValueError on an invalid condition (e.g. not an ndarray like object) added tests for same in core/frame.py TST: getting column from and applying op to a df should commute TST: add dual ( x op y <-> y op x ) tests for arith operators BUG: Incorrect error message due to zero based levels. close pandas-dev#2226 fixed file modes for core/frame.py, test/test_frame.py relaxed __setitem__ restriction on boolean indexing a frame on an equal sized frame in core/frame.py ENH: warn user when invoking to_dict() on df with non-unique columns BUG: modify df.iteritems to support duplicate column labels pandas-dev#2219 TST: df.iteritems() should yield Series even with non-unique column labels ...
2 parents 6654568 + e374f0f commit 5753e12

32 files changed

+608
-128
lines changed

Diff for: RELEASE.rst

+11-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ pandas 0.9.1
3333
- New `top` and `bottom` options for handling NAs in rank (#1508, #2159)
3434
- Add `where` and `mask` functions to DataFrame (#2109, #2151)
3535
- Add `at_time` and `between_time` functions to DataFrame (#2149)
36+
- Add flexible `pow` and `rpow` methods to DataFrame (#2190)
3637

3738
**API Changes**
3839

@@ -55,6 +56,8 @@ pandas 0.9.1
5556
- Make .drop(...) work with non-unique indexes (#2101)
5657
- Improve performance of Series/DataFrame.diff (re: #2087)
5758
- Support unary ~ (__invert__) in DataFrame (#2110)
59+
- Turn off pandas-style tick locators and formatters (#2205)
60+
- DataFrame[DataFrame] uses DataFrame.where to compute masked frame (#2230)
5861

5962
**Bug fixes**
6063

@@ -92,7 +95,14 @@ pandas 0.9.1
9295
- Fix Series and DataFrame.diff for integer dtypes (#2087, #2174)
9396
- Fix bug when taking intersection of DatetimeIndex with empty index (#2129)
9497
- Pass through timezone information when calling DataFrame.align (#2127)
95-
98+
- Properly sort when joining on datetime64 values (#2196)
99+
- Fix indexing bug in which False/True were being coerced to 0/1 (#2199)
100+
- Many unicode formatting fixes (#2201)
101+
- Fix improper MultiIndex conversion issue when assigning
102+
e.g. DataFrame.index (#2200)
103+
- Fix conversion of mixed-type DataFrame to ndarray with dup columns (#2236)
104+
- Fix duplicate columns issue (#2218, #2219)
105+
- Fix SparseSeries.__pow__ issue with NA input (#2220)
96106
97107
pandas 0.9.0
98108
============

Diff for: doc/make.py

+36-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,33 @@ def upload_stable_pdf():
4949
':/usr/share/nginx/pandas/pandas-docs/stable/'):
5050
raise SystemExit('PDF upload to stable failed')
5151

52+
def upload_prev(ver, doc_root='./'):
53+
'push a copy of older release to appropriate version directory'
54+
local_dir = doc_root + 'build/html'
55+
remote_dir = '/usr/share/nginx/pandas/pandas-docs/version/%s/' % ver
56+
cmd = 'cd %s; rsync -avz . [email protected]:%s -essh'
57+
cmd = cmd % (local_dir, remote_dir)
58+
print cmd
59+
if os.system(cmd):
60+
raise SystemExit('Upload to %s from %s failed' % (remote_dir, local_dir))
61+
62+
local_dir = doc_root + 'build/latex'
63+
pdf_cmd = 'cd %s; scp pandas.pdf [email protected]:%s'
64+
pdf_cmd = pdf_cmd % (local_dir, remote_dir)
65+
if os.system(pdf_cmd):
66+
raise SystemExit('Upload PDF to %s from %s failed' % (ver, doc_root))
67+
68+
def build_prev(ver):
69+
if os.system('git checkout v%s' % ver) != 1:
70+
os.chdir('..')
71+
os.system('python setup.py clean')
72+
os.system('python setup.py build_ext --inplace')
73+
os.chdir('doc')
74+
os.system('python make.py clean')
75+
os.system('python make.py html')
76+
os.system('python make.py latex')
77+
os.system('git checkout master')
78+
5279
def clean():
5380
if os.path.exists('build'):
5481
shutil.rmtree('build')
@@ -201,7 +228,15 @@ def _get_config():
201228
# current_dir = os.getcwd()
202229
# os.chdir(os.path.dirname(os.path.join(current_dir, __file__)))
203230

204-
if len(sys.argv)>1:
231+
if len(sys.argv) > 2:
232+
ftype = sys.argv[1]
233+
ver = sys.argv[2]
234+
235+
if ftype == 'build_previous':
236+
build_prev(ver)
237+
if ftype == 'upload_previous':
238+
upload_prev(ver)
239+
elif len(sys.argv) > 1:
205240
for arg in sys.argv[1:]:
206241
func = funcd.get(arg)
207242
if func is None:

Diff for: doc/source/faq.rst

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Frequently Asked Questions (FAQ)
2121
import matplotlib.pyplot as plt
2222
plt.close('all')
2323
24+
.. _ref-scikits-migration:
2425

2526
Migrating from scikits.timeseries to pandas >= 0.8.0
2627
----------------------------------------------------

Diff for: doc/source/related.rst

+10
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,13 @@ customizable by the user (so 5-minutely data is easier to do with pandas for
4545
example).
4646

4747
We are aiming to merge these libraries together in the near future.
48+
49+
Progress:
50+
51+
- It has a collection of moving window statistics implemented in
52+
`Bottleneck <http://pandas.pydata.org/developers.html#development-roadmap>`__
53+
- `Outstanding issues <https://github.com/pydata/pandas/issues?labels=timeseries&milestone=&page=1&state=open>`__
54+
55+
Summarising, Pandas offers superior functionality due to its combination with the :py:class:`pandas.DataFrame`.
56+
57+
An introduction for former users of :mod:`scikits.timeseries` is provided in the :ref:`migration guide <ref-scikits-migration>`.

Diff for: doc/source/v0.9.1.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ New features
6060
parse_cols='A:D')
6161

6262

63+
- Added option to disable pandas-style tick locators and formatters
64+
using `series.plot(x_compat=True)` or `pandas.plot_params['x_compat'] =
65+
True` (GH2205_)
6366
- Existing TimeSeries methods `at_time` and `between_time` were added to
6467
DataFrame (GH2149_)
6568
- DataFrame.dot can now accept ndarrays (GH2042_)
@@ -122,6 +125,7 @@ on GitHub for a complete list.
122125
.. _GH2124: https://github.com/pydata/pandas/issues/2124
123126
.. _GH2110: https://github.com/pydata/pandas/issues/2110
124127
.. _GH2184: https://github.com/pydata/pandas/issues/2184
128+
.. _GH2205: https://github.com/pydata/pandas/issues/2205
125129

126130
.. _GH2181: https://github.com/pydata/pandas/issues/2181
127131
.. _GH2180: https://github.com/pydata/pandas/issues/2180
@@ -197,4 +201,3 @@ on GitHub for a complete list.
197201
.. _GH1959: https://github.com/pydata/pandas/issues/1959
198202
.. _GH1890: https://github.com/pydata/pandas/issues/1890
199203
.. _GH1555: https://github.com/pydata/pandas/issues/1555
200-

Diff for: doc/source/visualization.rst

+46-2
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ To plot data on a secondary y-axis, use the ``secondary_y`` keyword:
123123
Selective Plotting on Secondary Y-axis
124124
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
125125

126-
To plot some columns in a DataFrame, give the column names to the `secondary_y`
126+
To plot some columns in a DataFrame, give the column names to the ``secondary_y``
127127
keyword:
128128

129129
.. ipython:: python
@@ -135,7 +135,7 @@ keyword:
135135
136136
Note that the columns plotted on the secondary y-axis is automatically marked
137137
with "(right)" in the legend. To turn off the automatic marking, use the
138-
`mark_right=False` keyword:
138+
``mark_right=False`` keyword:
139139

140140
.. ipython:: python
141141
@@ -145,6 +145,50 @@ with "(right)" in the legend. To turn off the automatic marking, use the
145145
df.plot(secondary_y=['A', 'B'], mark_right=False)
146146
147147
148+
Suppressing tick resolution adjustment
149+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
150+
151+
Pandas includes automatically tick resolution adjustment for regular frequency
152+
time-series data. For limited cases where pandas cannot infer the frequency
153+
information (e.g., in an externally created ``twinx``), you can choose to
154+
suppress this behavior for alignment purposes.
155+
156+
Here is the default behavior, notice how the x-axis tick labelling is performed:
157+
158+
.. ipython:: python
159+
160+
plt.figure()
161+
162+
@savefig ser_plot_suppress.png width=4.5in
163+
df.A.plot()
164+
165+
166+
Using the ``x_compat`` parameter, you can suppress this bevahior:
167+
168+
.. ipython:: python
169+
170+
plt.figure()
171+
172+
@savefig ser_plot_suppress_parm.png width=4.5in
173+
df.A.plot(x_compat=True)
174+
175+
176+
If you have more than one plot that needs to be suppressed, the ``use`` method
177+
in ``pandas.plot_params`` can be used in a `with statement`:
178+
179+
.. ipython:: python
180+
181+
import pandas as pd
182+
183+
plt.figure()
184+
185+
@savefig ser_plot_suppress_context.png width=4.5in
186+
with pd.plot_params.use('x_compat', True):
187+
df.A.plot(color='r')
188+
df.B.plot(color='g')
189+
df.C.plot(color='b')
190+
191+
148192
Targeting different subplots
149193
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
150194

Diff for: pandas/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@
3636
from pandas.tools.describe import value_range
3737
from pandas.tools.merge import merge, concat, ordered_merge
3838
from pandas.tools.pivot import pivot_table, crosstab
39-
from pandas.tools.plotting import scatter_matrix
39+
from pandas.tools.plotting import scatter_matrix, plot_params
4040
from pandas.tools.tile import cut, qcut

Diff for: pandas/core/common.py

+10
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,13 @@ def is_integer_dtype(arr_or_dtype):
852852
(issubclass(tipo, np.datetime64) or
853853
issubclass(tipo, np.timedelta64)))
854854

855+
def _is_int_or_datetime_dtype(arr_or_dtype):
856+
# also timedelta64
857+
if isinstance(arr_or_dtype, np.dtype):
858+
tipo = arr_or_dtype.type
859+
else:
860+
tipo = arr_or_dtype.dtype.type
861+
return issubclass(tipo, np.integer)
855862

856863
def is_datetime64_dtype(arr_or_dtype):
857864
if isinstance(arr_or_dtype, np.dtype):
@@ -1140,6 +1147,9 @@ def pprint_thing(thing, _nest_lvl=0):
11401147
from pandas.core.format import print_config
11411148
if thing is None:
11421149
result = ''
1150+
elif (py3compat.PY3 and hasattr(thing,'__next__')) or \
1151+
hasattr(thing,'next'):
1152+
return unicode(thing)
11431153
elif (isinstance(thing, dict) and
11441154
_nest_lvl < print_config.pprint_nest_depth):
11451155
result = _pprint_dict(thing, _nest_lvl)

Diff for: pandas/core/format.py

+4-10
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,8 @@ def to_string(self, force_unicode=False):
268268
if len(frame.columns) == 0 or len(frame.index) == 0:
269269
info_line = (u'Empty %s\nColumns: %s\nIndex: %s'
270270
% (type(self.frame).__name__,
271-
frame.columns, frame.index))
271+
com.pprint_thing(frame.columns),
272+
com.pprint_thing(frame.index)))
272273
text = info_line
273274
else:
274275
strcols = self._to_str_columns(force_unicode)
@@ -405,13 +406,6 @@ def _get_column_name_list(self):
405406
names.append('' if columns.name is None else columns.name)
406407
return names
407408

408-
409-
def _str(x):
410-
if not isinstance(x, basestring):
411-
return str(x)
412-
return x
413-
414-
415409
class HTMLFormatter(object):
416410

417411
indent_delta = 2
@@ -436,7 +430,7 @@ def _maybe_bold_row(x):
436430
self._maybe_bold_row = _maybe_bold_row
437431

438432
def write(self, s, indent=0):
439-
self.elements.append(' ' * indent + _str(s))
433+
self.elements.append(' ' * indent + com.pprint_thing(s))
440434

441435
def write_th(self, s, indent=0, tags=None):
442436
return self._write_cell(s, kind='th', indent=indent, tags=tags)
@@ -449,7 +443,7 @@ def _write_cell(self, s, kind='td', indent=0, tags=None):
449443
start_tag = '<%s %s>' % (kind, tags)
450444
else:
451445
start_tag = '<%s>' % kind
452-
self.write('%s%s</%s>' % (start_tag, _str(s), kind), indent)
446+
self.write('%s%s</%s>' % (start_tag, com.pprint_thing(s), kind), indent)
453447

454448
def write_tr(self, line, indent=0, indent_delta=4, header=False,
455449
align=None, tags=None):

0 commit comments

Comments
 (0)