Closed happytree718 closed 1 year ago
_ = op(Sample(test_dict), elements=10)
?
Yes, or as a global config if the user wants to use the same element setup in the same file.
Yes, or as a global config if the user wants to use the same element setup in the same file.
I meant - try _ = op(Sample(test_dict), elements=10)
Or op.config(elements=10)
Hello,
I hope you're doing well. I would like to propose a feature enhancement that I believe could improve the user experience when dealing with large arrays or dictionaries. Currently, when using
objprint
to print an object with a large array or dictionary, it displays all the elements, making the output lengthy and overwhelming.It would be great to have an optional argument that allows us to limit the number of rows displayed for arrays or dictionaries, similar to how
pandas
handles DataFrame display. By default,pandas
shows 5 rows at the beginning and 5 at the end, with an ellipsis (…) in between to indicate that more rows are not shown. This approach gives users an idea of what's inside the data structure without cluttering the terminal output.For instance, consider the following example:
In this case,
objprint
would print all 100 key-value pairs inself.data
, making the output very long. It would be beneficial to have an option to display only the first and last few lines of the dictionary.If you think this feature would be a valuable addition to the library, I would be more than happy to contribute to its implementation. Please let me know your thoughts on this suggestion.
Thank you for your time and consideration! Looking forward to hearing from you.
Best Regards, Erwin