Skip to content
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

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

Open
Sinnaeve opened this issue Jan 27, 2022 · 1 comment

Comments

@Sinnaeve
Copy link

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))
@ResidentMario
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants