Closed zykezero closed 1 year ago
Hello,
I'll be honest I'm new to python + plotnine so I'm not sure if this is a real issue or not.
example_pd = pd.DataFrame( { "col": [1,2,3], "group": ['a', 'b', 'c'], "date": ['2020-01-01', '2020-02-01', '2020-03-01'] } ) example_pd['date'] = pd.to_datetime(example_pd['date'])
facet_grid returns a 0 index error IndexError: index 0 is out of bounds for axis 0 with size 0
facet_grid
IndexError: index 0 is out of bounds for axis 0 with size 0
( ggplot(x, aes( y = 'col', x = 'group' )) + facet_grid('group ~ date') + geom_col() )
facet_wrap seems to put everything in one facet
facet_wrap
( ggplot(x, aes( y = 'col', x = 'group' )) + facet_wrap('date') + geom_col() )
But if you are to go and do this all without converting the date column to date format and not just a character everything works as expected.
Yes this is a bug. A workaround is to convert the date column to a pd.Categorical.
pd.Categorical
great! new to it all and thought I was doing something wrong. Great work I appreciate it greatly coming from R to python.
Hello,
I'll be honest I'm new to python + plotnine so I'm not sure if this is a real issue or not.
facet_grid
returns a 0 index errorIndexError: index 0 is out of bounds for axis 0 with size 0
facet_wrap
seems to put everything in one facetBut if you are to go and do this all without converting the date column to date format and not just a character everything works as expected.