Open kojix2 opened 5 years ago
Yes! It makes sense. There was a similar discussion happened https://github.com/SciRuby/daru/pull/476 , please have a look.
My first idea is like
Daru.configure do |c|
c.max_rows = 100
c.max_columns = nil
end
But I think this is good too.
Daru::DataFrame.inspect_max_rows = 10
Daru::DataFrame.inspect_max_colms = nil
Daru::Vector.inspect_max_rows = nil
Thanks for letting me this. Yes! We can have configuration as well, where all these default things can be set.
I realized that setting options alone was not enough for me.
I want to display a particular data frame / vector only once. For such use, a method like show_all
may be more appropriate than config.
df.show_all
Thanks for suggestion @kojix2 .
I think we should have global option to set the maximum number of rows to display as well as all_rows
and all_colms
property in dataframe level.
WDYT?
Daru's data frame displays up to 30 rows. I think the default threshold of 30 is reasonable in most cases.
However, when processing messy data, I often want to see 100 lines or more with my own eyes.
The threshold is defined as default values for the arguments here.
https://github.com/SciRuby/daru/blob/d17887e279c27e2b2ec7a252627c04b4b03c0a7a/lib/daru/dataframe.rb#L2094
So, you can change the threshold with the following patch.
This is not a cool way. I want a better way to configure Daru.