BrandonFors/pandas-github-issues huggingface dataset:
ENH: Intuitive Barplot Series Ordering
State: closed

Modifies the horizontal bar plot behavior to plot series in order from top-to-bottom.

Plotting a regular bar graph from a DataFrame object will plot each series of data from left-to-right in the same order as presented in the legend from top-to-bottom. When plotting a horizontal bar graph the series of data are plotted from bottom-to-top, which is the reverse of the legend and unintuitive. 

Pandas allows a `legend='reverse'` option which reverses the order of the legend and preserves series colors, but does not fix the unintuitive bottom-to-top ordering of series.
###### Pandas Standard `barh` Behavior:

![original_behaviour](https://cloud.githubusercontent.com/assets/3064019/7130265/1a2724a0-e23b-11e4-8940-9f54d8cd14c2.png)
###### Desired `barh` Behavior:

![alternate_behaviour](https://cloud.githubusercontent.com/assets/3064019/7130270/324a4242-e23b-11e4-9b29-f4bcb60c3b14.png)
###### Pandas Standard `barh` `legend='reverse'` Behavior:

![reversed_legend](https://cloud.githubusercontent.com/assets/3064019/7130274/4b5d2ec0-e23b-11e4-88e4-48e938c8e7a8.png)


Labels:
name: Visualization
description: plotting
name: API Design

Comments:
Thanks for the informative summary (with pictures). I think the current behavior comes from us drawing from the origin outward. This makes sense when going left to right, not so much bottom to top.

I'd rather we have another keyword argument for this, since it will be an API change, something like `bar_order` or `group_order`.

It will be a bit before I can review the code.

I think the behavior can be generalized if plot can accept `sort_columns='reverse'` (like legend does). It may useful for other stacking and pie charts.

pls rebase/update. closing, but reopen if you want to work on.
ENH: allow Panel.shift on items axis
State: closed

I'm not sure why `Panel.shift` currently raises with `axis='items'`, while `axis=0` works.

This PR enables `axis='items'` and also updates the docstring to show the parameter `periods` instead of the deprecated `lags`


Labels:
name: Bug
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode

Comments:
looks fine. prob some leftover code :)

pls add a release note
if you don't see test for all axes, can you add them (to cover the bases).

- added a release note
- there were tests for `major` and `minor`, and I've added a test for `items`  

aweseom. ping on green.

@jreback build is green now

Thanks @mortada !
ENH: Raise error writing excel file with a MultiIndexed DataFrame #9794
State: closed

Raise a NotImplementedError until fixed.

closes #9794


Labels:
name: Error Reporting
description: Incorrect or improved errors from pandas
name: IO Excel
description: read_excel, to_excel

Comments:
can you add a tests that validates this. otherwise looks good.

Actually I just saw there is a some tests that test writing excel with multiindex

https://github.com/pydata/pandas/blob/master/pandas/io/tests/test_excel.py#L895

Referencing:
#5616

ill figure out what the difference is

I added two tests that make sure writing MultiIndex index works and MultiIndex columns raise.
I added the assertRaises to the tests that failed

fixed the backticks in whats new and modified the test for multicolumn/index writing to assert fails only on multicolumn writes

@hsperr thanks!
FIX: Describe NotImplementedErrors or use AbstractMethodError
State: closed

This issue fixes #7872 by either describing the reason why a NotImplementedError is raised,
or by throwing an AbstractMethodError in the case of abstract methods (eg: Mixins) that
should be overwritten by the inheriting classes.

This issue is based on discussion of PR #7899 which was never merged.


Labels:
name: Enhancement
name: Error Reporting
description: Incorrect or improved errors from pandas

Comments:
merged via https://github.com/pydata/pandas/commit/8fe1cf6d1931071c378fcc3170b82a145a037da0

thanks!

+1 great!!
FIX: timeseries asfreq would drop the name of the index, closes #9854
State: closed

it seems that it is open discussion whether reindex should preserve the name of the index.
(Towards the end of https://github.com/pydata/pandas/issues/6552)

My proposal for now is to set the name of the new index created by the asfreq function.


Labels:
name: Bug

Comments:
merged via https://github.com/pydata/pandas/commit/39fa180cf6b861981871b4a61bf0f3a31eaa2b98

thanks!
BUG: Fix for cython version checking closes #9827
State: closed

closes #9827

Added a cython version check at the top of setup.py; minimum version of 0.19.1. If the minimum isn't met, _CYTHON_INSTALLED sets to false, so the installation can proceed if cython is not needed, but will fail if cython is needed (with an appropriate error message).

Two new travis jobs added to test install_conda and install_pydata flows for the old cython revision, and ensure that pandas setup fails with appropriate error messages. See https://travis-ci.org/ajamian/pandas/builds/58315862 for regression.


Labels:
name: Build
description: Library building on various platforms

Comments:
merged via https://github.com/pydata/pandas/commit/a134759c681c5d1d92b782dbc7bbc4c3dacaa081

thanks!

@jreback Is it needed to have that many extra travis envs in the build matrix? Won't that slow down the travis checking of PRs?

@jorisvandenbossche only 2 extra and they are really quick. (and in the allowed fails anyhow)

in the .yml you have to duplicate things if you want them to allowed to fail (e.g. once in the definitions and once in the allowed fails section),

@jreback Ah, OK, that last info was what I didn't know :-) otherwise it looked like a lot extra in the non-allowed to fails
ENH: Issue #2679. DataFrame.to_html() to create hyperlinks for valid URL...
State: closed

Closes #2679 


Labels:
name: Enhancement
name: Output-Formatting
description: __repr__ of pandas objects, to_string
name: IO HTML
description: read_html, to_html, Styler.apply, Styler.applymap

Comments:
how does this handle the automatic HTML pretty-printing of dataframes in the ipython notebook? is the presentation of URLs affected?

Aa far as I know it shouldn't. All it does is check for a valid url string and then put the value in an 
<a> tag.

would you mind doing a quick sanity check of the notebook output under your patch? e.g., this is what I currently see:
![screen shot 2015-04-13 at 4 20 57 pm](https://cloud.githubusercontent.com/assets/1217238/7124697/20557ed6-e1f9-11e4-8109-b5214d2ab7a8.png)

For what it's worth, I don't think it would be a bad thing for the notebook output to include URLs as links, but it would definitely be annoying if they are pretty-printed as a HTML code inside the table :).

this should to be optional at the very least if not off by default for backward compatibility.
`to_html` is not used solely for ipnb display.

@tdas14 this needs to be an option when printing (e.g. passed to `.to_html`).

@tdas14 this needs to be an option directly to `.to_html`, further, you could add a global option in `display.html.render_links`, as a boolean (default should be False for back-compat)

closing, but if you would like to continue working on this pls reopen
Fix right hand side dict assignment for DataFrames
State: closed

closes #9874


Labels:
name: Bug
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves

Comments:
@tjragan that's very odd to do anyhow. Supported for nested data structues is very limited, especially with indexing operations.

## It may be odd, but I have a fairly complex data analysis project that uses this extensively.  In any case, preserving pandas’  ability to store arbitrary python objects seems like a good idea, and this essentially removes the ability to have a key-value store in a cell.

Dr. T.J. Ragan
Research Associate

Department of Biochemistry, University of Leicester
Henry Wellcome Building, Lancaster Road
Leicester LE1 9HN, United Kingdom

On 27 May 2015, at 11:57, jreback <notifications@github.com<mailto:notifications@github.com>> wrote:

@tjraganhttps://github.com/tjragan that's very odd to do anyhow. Supported for nested data structues is very limited, especially with indexing operations.

—
Reply to this email directly or view it on GitHubhttps://github.com/pydata/pandas/pull/9877#issuecomment-105868361.

@tjragan what version of pandas are you using where this actually works? it doesn't work in >=0.14.1

it broke when I installed 0.16.1, but works in 0.16.0

On 27 May 2015, at 20:56, jreback <notifications@github.com<mailto:notifications@github.com>> wrote:

@tjraganhttps://github.com/tjragan what version of pandas are you using where this actually works? it doesn't work in >=0.14.1

—
Reply to this email directly or view it on GitHubhttps://github.com/pydata/pandas/pull/9877#issuecomment-106053838.

ok, see #10219 

pull-requests to fix are welcome
BUG: fix for index name lost #9857 and also added the corresponding test in test_index.py
State: closed

closes issue #9857 


Labels:
name: Bug
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves

Comments:
merged via https://github.com/pydata/pandas/commit/f8ca3b731ca47b2eaccb9f0044f7b60c0c592560

thanks!
Groupby transform preserves output dtype
State: closed

Previously `transform` output was always the same dtype as the groupby
object. This allows the output dtype to differ from the input. Fixes #9807.


Labels:
name: Bug
name: Dtype Conversions
description: Unexpected or buggy dtype conversions

Comments:
looks great! could you add a release note to what's new?

merged via https://github.com/pydata/pandas/commit/30580e7acd6cafd55616d91bedbb8999d65177f5
thanks!
Fixing == __eq__ operator for MultiIndex ... closes #9785
State: closed

closes #9785  


Labels:
name: Bug
name: Error Reporting
description: Incorrect or improved errors from pandas
name: Compat
description: pandas objects compatability with Numpy or Python functions

Comments:
merged via https://github.com/pydata/pandas/commit/07257a0333bfa292b7b76c96422fa3ec617e5089

thanks!
FIX: division of Decimal would crash
State: closed

closes #9787 
Decimal objects don't support dtype, so we exclude all objects from fill_zeros that do not support .dtype or .type and are not scalar.


Labels:
name: Numeric Operations
description: Arithmetic, Comparison, and Logical operations
name: Compat
description: pandas objects compatability with Numpy or Python functions

Comments:
changed your suggestions.

merged via https://github.com/pydata/pandas/commit/bed38f250860b9f64069cc302657c74ab3252db0

thanks!
Period accepts datetime64 value
State: closed

Added support for `datetime64` value for Period. Fixes #9054.


Labels:
name: Bug
name: Period
description: Period data type

Comments:
pls add a release note as wel, looks good otherwise.

+1, will be awhile for travis, lots of PRs today :)

can you squash into a single commit. pls ping when done.

@jreback : squashed.

closing in favor of #9896
GH9570 allow timedelta string conversion without leading zero
State: closed

See https://github.com/pydata/pandas/issues/9570

This commit allows for the `Timedelta` class to take a construction like `Timedelta('0:00:00')` or `Timedelta('00:00:00')`.


Labels:
name: Enhancement
name: Timedelta
description: Timedelta data type

Comments:
Test: https://travis-ci.org/chrisgilmerproj/pandas/builds/58278744

Could you add a release note in `doc/source/whatsnew/v0.16.1`?

Yep, will do!

Test: https://travis-ci.org/chrisgilmerproj/pandas/builds/58287006

This now supports the following:

``` python
In [1]: from pandas import Timedelta; Timedelta('-01:00:00')
Out[1]: Timedelta('-1 days +23:00:00')

In [2]: from pandas import Timedelta; Timedelta('-1:00:00')
Out[2]: Timedelta('-1 days +23:00:00')

In [3]: from pandas import Timedelta; Timedelta('00:00:00')
Out[3]: Timedelta('0 days 00:00:00')

In [4]: from pandas import Timedelta; Timedelta('0:00:00')
Out[4]: Timedelta('0 days 00:00:00')
```

All right, tests have passed @TomAugspurger @jreback 

Looks good to me. I'll let @jreback handle the merges today (unless he says otherwise).
DOC/CLN: fixed bloolean indexing example, cleaned up typos
State: closed

The boolean indexing example http://pandas.pydata.org/pandas-docs/version/0.16.0/indexing.html#boolean-indexing seems to be broken for a while. The variable `s` is being set in a much earlier part of the page and is not suitable for this example.

Also cleaned up a few minor typos. 


Labels:
name: Docs

Comments:
good catch, thanks!
Fix for comparisons of categorical and an scalar not in categories
State: closed

Up to now, a comparison of categorical data and a scalar, which
is not in the categories would return `False` for all elements when
it should raise a `TypeError`, which it now does.

Also fix that `!=` comparisons would return `False` for all elements
when the more logical choice would be `True`.

Fixes the raised issue in https://github.com/pydata/pandas/issues/9836#issuecomment-92123057


Labels:
name: Bug
name: Categorical
description: Categorical Data Type

Comments:
Still asking why equality doesn't raise when comparing with a non-existing category.

@kay1793 This is consistent with what Python does for non-comparable types:

```
# python 3
In [1]: 'foo' == 123
Out[1]: False

In [2]: 'foo' > 123
TypeError: unorderable types: str() > int()
```

thanks.

merged via https://github.com/pydata/pandas/commit/35b20d8aaee40f1b33a7e71c15f3fd88ece2e7ae

thank you!
BUG: secondary ax has incorrect right_ax property
State: closed

When `secondary_y` is enabled, twin axes are created as below:
- Assume current axes is `ax` (left ax)
- create `new_ax` (right ax) via `ax.twinx`
- Let `ax.right_ax` to specify `new_ax` (right ax)
- Let `new_ax.left_ax` to specify `ax` (left ax)
- Let `new_ax.right_ax` to specify `new_ax` (incorrect)

The last one is incorrect and confuses other logics such as `_get_all_lines`. I think it should be removed.


Labels:
name: Visualization
description: plotting

Comments:
@sinhrks can you rebase

Rebased, and green.

merged via https://github.com/pydata/pandas/commit/17132ac5777e2351411e66c6293582444aa6335b

thanks!
DOC: add more examples to StringMethods on Index
State: closed

as discussed in https://github.com/pydata/pandas/pull/9667

@jorisvandenbossche please take a look, thanks 


Labels:

Comments:
@shoyer good idea, it's updated 

This looks great to me! I'll just hold off on merging until Joris can take a look.

Looks good, thanks a lot!
BUG/CLN: Repeated time-series plot may raise TypeError
State: closed

This repeated time-series plotting works:

```
import pandas.util.testing as tm
s1 = tm.makeTimeSeries()
s2 = s1[[0, 5, 10, 11, 12, 13, 14, 15]]
ax = s1.plot()
ax2 = s2.plot(style='g')
```

![line_incorrectsecondary](https://cloud.githubusercontent.com/assets/1696302/7101339/f74b566a-e08f-11e4-8b7f-5ed58327cc5c.png)

But if converted to `DateFrame`, it doesn't:

```
s1 = s1.to_frame()
s2 = s1.iloc[[0, 5, 10, 11, 12, 13, 14, 15]]
print(s2.index.freq)
ax = s1.plot()
ax2 = s2.plot(style='g', ax=ax)
# TypeError: expected string or buffer
```

Fixed the problem, and cleaned up the code to merge `Series` and `DataFrame` flows.
#### After the Fix:

```
import pandas.util.testing as tm
fig, axes = plt.subplots(2, 1)
s1 = tm.makeTimeSeries()
s2 = s1[[0, 5, 10, 11, 12, 13, 14, 15]]
ax = s1.plot(ax=axes[0])
ax2 = s2.plot(style='g', ax=axes[0])

s1 = s1.to_frame(name='x')
s2 = s1.iloc[[0, 5, 10, 11, 12, 13, 14, 15]]
ax = s1.plot(ax=axes[1])
ax2 = s2.plot(style='g', ax=axes[1])
```

![line_incorrectsecondary](https://cloud.githubusercontent.com/assets/1696302/7103495/55f95316-e0e4-11e4-8086-6aedfae82006.png)


Labels:
name: Bug
name: Visualization
description: plotting

Comments:
awesome, this has bitten me before!

@sinhrks thank you sir!
BUG: memory access bug in read_csv causing segfault
State: closed

closes https://github.com/pydata/pandas/issues/5664

the added test covers the original issue, though I cannot reproduce that on master; [the one mentioned in the comments](https://github.com/pydata/pandas/issues/5664#issuecomment-49332533) still segfaults on master (if repeated few times) and is fixed by this pr.


Labels:
name: Bug
name: IO CSV
description: read_csv, to_csv

Comments:
can you add a release note, otherwise lgtm

@jreback added the release note

thank you sir!
DOC/CLN: Revise StringMethods docs
State: closed

Derived from #9773, #9667. Fix docstrings to meet what current `.str` accessors does.


Labels:
name: Docs
name: Strings
description: String extension data type and string data

Comments:
@jorisvandenbossche Thank you for your comments. 

Thanks to #9667, `Index` now support `.str` accessor. I've tried to describe the `Series`/`Index` return values but may not be clear because it shares the same docstring... 

CC: @mortada Can you check if you have a chance?

@sinhrks spotted a few minor things (please see comments inline) but otherwise looks good to me, thanks! 

@sinhrks One more general comment: you now used ```Series``/``Index``` almost everywhere, but I think in general we don't quote Series or DataFrame in our docstrings. 
Also in the docstrings here you used both forms (eg unquoted in the parameter explanations or returns section).

I don't think we have a strict rule about this (and in the tutorial docs it is a bit mixed as well), but maybe we should keep it unquoted in the docstring? Opinion?

@jorisvandenbossche , @mortada Thanks for the comments. I've fixed the docs based on the points.

About quotes:

I also didn't have a fixed policy, only an impression that no need to quote return values because these are rendered as italic. I agree removing quote is more consistent. How should `array` be (remove or quote)? 

@sinhrks is this good to go?

Yes, pls check.

Thanks! Always good to have more work on the docs

Thanks for review! Lmk if needs any follow-ups.
BUG: DataFrame.where does not respect axis parameter when shape is symmetric
State: closed

Fixes GH #9736.

The problem was that at the `Block` level, `where` and `putmask` did a lot of guessing about how the block and the other parameters needed to be transposed in order to align correctly. It guessed wrongly when the DataFrame was symmetric because the shapes match up in both directions. This change tries to make everything explicit and remove the guessing.


Labels:
name: Bug
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode

Comments:
Fixed handling of multiple dtypes / blocks (and added some tests), and rebased

@evanpw you mentioned an issue above. pls carify.

The original behavior was to align `cond` and `other` with each Block along the 'columns' axis only when no axis parameter was passed to `where` (which can only happen in the case that `other` is also a `DataFrame`), but that doesn't work in some cases. The correct behavior seems to be: always align `cond` (because each Block only contains a subset of the columns), and align `other` whenever it has the same `ndim` as `self`, or if the alignment axis is 'columns': basically, every case except `DataFrame.where(cond, Series, axis='index')`

This is all fixed in the most recent commit.

@evanpw pls rebase for 0.17.0

@evanpw can you update when you have a chance. you mentioned some issues above.

The original commit had some problems if the DataFrame had multiple blocks, but that has all been fixed. See my previous comment.

can you rebase (after updating where the release not goes). just want to take a quick look again.

rebased

merged via https://github.com/pydata/pandas/commit/931e0e5596e5714ecab5665d10735c155a2313f7

thanks!
BUG: read_csv skips lines with initial whitespace + one non-space character
State: closed

Fixes GH #9710


Labels:
name: Bug
name: IO CSV
description: read_csv, to_csv

Comments:
can you rebase (prob just a whatsnew conflict)

@evanpw can you rebase; we just merged another csv fix and need this retested. thxs.

Rebased, and tests are still green

merged via  https://github.com/pydata/pandas/commit/2997e70202bac0ca6ecba0d87f936e208af5ac3b

thanks!
ERR: raise when index_col=True is passed
State: closed

closes #9798 

Add a check to see whether the `index_col` is `True`.


Labels:
name: Error Reporting
description: Incorrect or improved errors from pandas
name: IO CSV
description: read_csv, to_csv

Comments:
I moved it to TextFileReader in the `_clean_options`

ok, pls squash, then looks good to go. ping me when green.

hi @jreback , I've squashed the commits, and it's green now. could u take a look on it?

@bottleimp thanks!
BUG: complex is cast to float in sum with level arg
State: closed

Preserve complex dtypes when a stat_function on DataFrame is called with the optional level argument.

Minimal example:

```
import pandas as pd
frame = pd.DataFrame({'z': [1+2j]})
frame.sum(level=0)
```


Labels:
name: Dtype Conversions
description: Unexpected or buggy dtype conversions
name: Complex
description: Complex Numbers

Comments:
needs some tests

@joe1gi can you update

closing, if/when updated pls reopen
Allow tz-aware inputs in Holiday.dates
State: closed

closes #9825

Previously, passing tz-aware inputs to Holiday.dates would always result in an error because the the input start_date was converted in a way that destroyed timezone information.  This PR makes that conversion correctly preserve tz info, and converts several of the existing tests to run with both tz-aware and tz-naive inputs.

Noticed while working on a new trading calendar implementation here: https://github.com/quantopian/zipline/pull/556.


Labels:
name: Enhancement
name: Timezones
description: Timezone data dtype

Comments:
your tests don't check for a holiday with a timezone. wasn't this the use case?

@jreback the specific issue solved here is that calling `holiday.dates(start, end)` with tz-aware `start` and `end` raises an error because `dates` attempts to construct a `DatetimeIndex` with a tz-naive start and the supplied end.  The fix here just propagates the timezone of the supplied start so that the call succeeds if both inputs are tz-aware and in the same timezone.  That's tested at https://github.com/pydata/pandas/pull/9824/files#diff-96b913a0de65ff4f70fc5bde0543e9a8R62 by running the same checks that were performed previously, but with dates that are localized to UTC.  The substantive content of the testing changes are in https://github.com/ssanderson/pandas/commit/8ae03df7bb06f536a669348d23fcf6d986fcf77d.  The rest of the diff is just refactoring to make it easier to run the same check twice, once with tz-naive inputs, and once with tz-aware inputs.

@ssanderson ok, I see, then ok!

pls squash and good to go

@jreback squashed into one commit and rebased with master.  I assume that's what you meant?

@ssanderson yep

thanks for the PR!

@jreback great!  https://github.com/pydata/pandas/issues/9825 can be closed (I mistyped in my issue description).

fixed thanks!