You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
implement LArray.from_dict or from_dict top-level function #581
stack(d) could work for this use case, but it currently does not.
It assumes that if we pass a dict, we need a real Axis object (to get labels order). On Python 3.7, this is no longer a necessary precaution. And even on Python < 3.7, this is annoying when you do not care about the order. Maybe changing the assert into a warning for python < 3.7 would be the right move, or even no warning in the code but a warning in the doc? After all when you iterate on a dict it does not output a warning.
@alixdamman the functionality is now in stack, but LArray.from_dict might be more readable/more discoverable, so we might want to add it as a simple alias anyway. Thoughts?
changed the title [-]implement LArray.from_dict or add support for simple dict in stack[/-][+]implement LArray.from_dict or from_dict top-level function[/+]on Jun 26, 2019
Activity
gdementen commentedon Feb 15, 2018
and/or modify behavior of LArray(dict) which currently creates a "scalar" LArray with the dict, which is a bit weird.
gdementen commentedon Jul 4, 2018
stack(d) could work for this use case, but it currently does not.
It assumes that if we pass a dict, we need a real Axis object (to get labels order). On Python 3.7, this is no longer a necessary precaution. And even on Python < 3.7, this is annoying when you do not care about the order. Maybe changing the assert into a warning for python < 3.7 would be the right move, or even no warning in the code but a warning in the doc? After all when you iterate on a dict it does not output a warning.
[-]implement LArray.from_dict[/-][+]implement LArray.from_dict or add support for simple dict in stack[/+]alixdamman commentedon Jul 4, 2018
As long as we add one or several examples, no warnings at all seems fine to me.
improved stack
improved stack
gdementen commentedon Jun 26, 2019
@alixdamman the functionality is now in stack, but LArray.from_dict might be more readable/more discoverable, so we might want to add it as a simple alias anyway. Thoughts?
alixdamman commentedon Jun 26, 2019
stackis really generic and so yes, it would be nice to have an explicit alias.[-]implement LArray.from_dict or add support for simple dict in stack[/-][+]implement LArray.from_dict or from_dict top-level function[/+]