"No" in pandas python legend

I am using WinPython Notebook with Python 2.7. So I am reading multiple DataFrames like this:

run[y2][y3][x] = pd.read_excel(xls_file, x)

      

When I use:

run[y2][y3][x].plot()

      

I am getting a nice plot with 3 lines and a legend describing those lines as it is in the excel file at the top of the column.

However, when I draw it like this:

run[case]['fluent'][var].plot(x = 'r', y = 'inlet')

      

What I get in the legend is "No." Even when I use label = 'inlet'

in the .plot () part.

http://postimg.org/image/l4akauycz/

+3


source to share


2 answers


df = pd.read_excel('filename.xlsm')
df.set_index(keys= ['index_col'], inplace=True)
df['col_to_plot'].plot(legend = True)

      



+1


source


This was a bug in pandas and will be fixed in the upcoming 0.16.1 release (see https://github.com/pydata/pandas/pull/9574 ).

A possible workaround for now is to provide the column y

as a list:



df.plot(x='r', y=['inlet'])

      

+3


source







All Articles