ResidentMario/missingno

Choose strftime format argument in mnso.matrix (when using freq argument)

Sinnaeve opened this issue · 1 comments

When I use the matrix function with a frequency inferior to a day the y axis labels are all the same because their format is fixed to '%Y-%m-%d'. It would be better to have the format as an option in function argument

ts_ticks = pd.date_range(df.index[0], df.index[-1],
                                     freq=freq).map(lambda t:
                                                    t.strftime('%Y-%m-%d'))

become

ts_ticks = pd.date_range(df.index[0], df.index[-1],
                                     freq=freq).map(lambda t:
                                                    t.strftime(format))

Yeah the freq argument and associated logic was implemented by a random code contributor, so I haven't had much time testing it or thinking about its edge cases. I'll target adding some patches like this one to the next release.