Closed Shekharrajak closed 7 years ago
Also the output of to_html
is not understandable in iruby notebook. It comes something like this
"<table>\n <tr>\n <th colspan='4'>Daru::DataFrame(5x3)</th>\n </tr>\n\n \n <tr>\n <th></th>\n \n <th>a</th>\n \n <th>b</th>\n \n <th>c</th>\n \n </tr>\n \n\n \n <tr>\n <td>one</td>\n \n <td>1</td>\n \n <td>11</td>\n \n <td>11</td>\n \n </tr>\n \n\n \n <tr>\n \n <td>...</td>\n \n <td>...</td>\n \n <td>...</td>\n \n <td>...</td>\n \n </tr>\n\n \n\n <tr>\n <td>five</td>\n \n <td>5</td>\n \n <td>15</td>\n \n <td>55</td>\n \n </tr>\n \n</table>"
User must be able to pass "path of html file" to store converted df.
What is the (frequent) use case? How this is better than File.write 'something.html', df.to_html
?
Also the output of to_html is not understandable in iruby notebook. It comes something like this
What do you mean by "not understandable"? What have you expected and how actual output is different from your expectactions?
I agree with @zverok, there's no need to have this functionality in Daru, as any user can easily write it to a file themselves.
@Shekharrajak - I think I know what you're talking about with it not being understandable in iRuby. If you want to use to_html
in an iRuby notebook, use IRuby.display
and specify the mime type. I often do this when I want to see more than the default number of records:
IRuby.display df.to_html(100), mime: 'text/html'
What is the (frequent) use case? How this is better than File.write 'something.html', df.to_html?
@zverok Yes , we can do this. There is not much use case right now.
What do you mean by "not understandable"? What have you expected and how actual output is different from your expectactions?
In IRuby or using terminal, we get output with html tags, which is not readable.
If we see this in Pandas then output is more readable :
If you want to use to_html in an iRuby notebook, use IRuby.display and specify the mime type. I often do this when I want to see more than the default number of records:
@gnilrets , Thanks for sharing it
In IRuby or using terminal, we get output with html tags, which is not readable.
For default output (like in pandas), just don't do to_html
, it returns exactly "raw HTML string" output, as you can see.
If you'll just do
> dataframe
-- you'll see pretty HTML output. And if you'll do
> dataframe.method(:to_html)
...you'll see
=> #<Method: Daru::DataFrame#to_html>
(That is what df.to_html
does in pandas, returning method object instead of calling it)
Thanks @zverok .
User must be able to pass "path of html file" to store converted
df
.E.g.
the output of
df.to_html
will be saved inhtml_file_path.html
.