-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Warning when plotting a DataFrame with a single row #28905
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
Comments
Can you give the pandas version you use? I can reproduce this on 0.25x, but it seems to be fixed on master. This is the output of
INSTALLED VERSIONS
------------------
commit : 39602e7
python : 3.7.4.final.0
python-bits : 64
OS : Linux
OS-release : 5.3.1-arch1-1-ARCH
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : fr_FR.UTF-8
LOCALE : fr_FR.UTF-8
pandas : unknown |
@nrebena My home machine:
However, I was also able to reproduce on a Windows machine at work with pandas version 0.25.1, same as what the poster of the stack overflow question is using. |
I can reproduce on OSX with 0.25.3 as well. pandas/pandas/plotting/_matplotlib/core.py Line 1085 in 62a87bf
I believe this is fixed on master. In my local copy of pandas 0.25.3, if I replicate the change in the master, i.e. pandas/pandas/plotting/_matplotlib/core.py Lines 1090 to 1096 in 9fb3040
Then the UserWarning is gone. |
Can confirm - closing for now then |
Closely related to #18306, item 9 in the listing, but probably not an exact duplicate. Based on StackOverflow question https://stackoverflow.com/q/58322744/2988730.
Simple code to reproduce:
This generates
Expected behavior is that the default xlims of
[None, None]
will let matplotlib compute its own limits. Instead, it appears that pandas is computing the limits based on the min and max of the data. This seems redundant at best, and incorrect in this particular case.The text was updated successfully, but these errors were encountered: