Giter Club home page Giter Club logo

Comments (8)

kojix2 avatar kojix2 commented on August 24, 2024

Hello. Welcome to Daru.
I am a Daru user. Yes, It's hard to use Daru on the terminal.

  1. You should use Jupyter Notebook/Lab if possible. Does IRuby not work well? Since iruby gem is old, it is better to install from github's master using specific_install.
  1. The width of the column shown on the terminal is specified here. All columns are the same width, not best fit. We need a contribution.

DEFAULT_SPACING = 10
DEFAULT_THRESHOLD = 15

  1. Daru has no option settings. We need improvement.
    #502

from daru.

reedjosh avatar reedjosh commented on August 24, 2024
  1. It sounds like you are suggesting IRuby as a way to get notebook like output on the terminal. Is that the case?

  2. I did find the Spacing and Threshold variables. Unfortunately, my values do vary widely in width. : )

I would be interested in contributing to this, I have briefly looked into the code for inspect. How would you envision I add a best fit printing function? It seems pretty_print is a missing method atm?

  1. Ah, so no way to set max_colwidth and forget?

from daru.

kojix2 avatar kojix2 commented on August 24, 2024

@reedjosh

  1. No, Column widths do not change with IRuby console/qtconsole. Sorry for my lack of explanation. I'm not a web developer. If you are working on rails, the following tools may be useful, (as you might have found).

  2. I'm glad to hear that. Ping @Shekharrajak

  3. I just forget column width on a terminal and use Jupyter Lab. But, it is clear that Daru should have option settings.

from daru.

Shekharrajak avatar Shekharrajak commented on August 24, 2024

Thanks for reporting the issue. You can see the examples in IRuby notebook here.

@reedjosh , do you want to see all the colums (or all the rows)?

I see that Pandas in Python shell and daru in Ruby cell displays similar table structure.

[1] pry(main)> df = Daru::DataFrame.new([[1,2,3,4], [1,2,3,4]],order: [:a, :b], index: [:one, :two, :three, :four])
=> #<Daru::DataFrame(4x2)>
           a     b
   one     1     1
   two     2     2
 three     3     3
  four     4     4

>>> pd.DataFrame([[1,1], [2,2], [3,3], [4,4]], index=['one', 'two', 'three', 'four'], columns=['a','b'])
       a  b
one    1  1
two    2  2
three  3  3
four   4  4

from daru.

kojix2 avatar kojix2 commented on August 24, 2024

Pandas

  • Column width is adjusted automatically.
  • sepal_length is wide. species is narrow.

image

Daru

  • Column name only partially displayed. Sepal.Leng should be Sepal.Length.
    • All columns are the same width.
  • #<Daru::DataFrame(150x5)> is informative, but looks busy (for me).

image

The data I usually see does not fits in column widths. For example

image

from daru.

Shekharrajak avatar Shekharrajak commented on August 24, 2024

Thanks @kojix2 for letting me know this point. Yes! It should be adjusted and have option for setting the max width of the all the columns.

from daru.

reedjosh avatar reedjosh commented on August 24, 2024

Yes, Pandas auto-adjusts width, and Pandas prints without first printing the object.

I use pandas to display data on the command line quite often.

For now, I've setup to use tj/terminal-table for my final output. It works well enough.

Should I get around to it, I will work on this, but I won't be able to do so anytime soon. Thanks all for the consideration and work you've done to build DARU. It's much nicer than manually manipulating data!! : )

from daru.

Shekharrajak avatar Shekharrajak commented on August 24, 2024

Thanks @reedjosh for letting us know. Surely table structure will be improved in near future.

from daru.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.