-
-
Notifications
You must be signed in to change notification settings - Fork 18k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: plot with kind=scatter fails when checking if an array is in the DataFrame #8852
Comments
How should this supposed to work in this case? The length of the array is not equal to the number of elements in the dataframe? |
@jorisvandenbossche |
@jorisvandenbossche Yes, this is a regression (and I introduced it in #7780). If nobody else gets to it first I can write a fix (should be pretty easy). |
@jorisvandenbossche sorry about the bad example! I meant to have |
@TomAugspurger right-clicking with the mouse? |
Wow, that is not at all obvious that that puts it on your clipboard :) Thanks. |
Yep, indeed, it also took me a while to know this.. But now rather essential when I am working on Windows |
@jreback What is actually the best way to check if something is allowed to be a column name?
|
I'm having trouble coming up with anything better than checking if it's an iterable. There may be something in |
@TomAugspurger there are some people working here at the sprint on this issue |
Great! I'll be offline for the next hour or so but after that I'll stick around the computer. Have them post if there are any questions. |
problem is that eg tuples are also iterables, but allowed as column names |
Mmm. That's true. So let's be explicit in the documentation and implementation. With In [81]: df = pd.DataFrame({(1, 2): [1, 5], 3: [0, 1], 4: [1, 2]})
In [82]: df
Out[82]:
(1, 2) 3 4
0 1 0 1
1 5 1 2 A |
As far as implementing that, the best may be a try / except? |
if col in self.columns will work but put in a try except |
Ensure that we can pass an np.array as 'c' straight through to matplotlib, this functionality was accidentally removed previously. Add tests. Closes pandas-dev#8852
fails with a TypeError.
we check
elif c in self.data.columns
which tries to hash the array.(I know I can just add the array as a column to the DataFrame)
The text was updated successfully, but these errors were encountered: