Export individual cell in IPython/Jupyter notebook - export

I am able to export the entire notebook as HTML, but I would like to export just a single cell, together with its output.
Is there some way of doing this?

One way to do this is to use a custom preprocessor.
I explain how to do this briefly in response to Simple way to choose which cells to run in ipython notebook during run all.
To summarize: you can extend nbconvert.preprocessors.ExecutePreprocessor to create a preprocessor that checks cell metadata to determine whether that cell should be executed and/or output.
I use Jupyter Notebooks for report generation all the time, so I wrote a collection of custom processors to extend nbconvert behavior:
meta-language to determine what cells get executed and included in the final report (if/else logic on entire notebook sections)
executing code in markdown cells
removing code cells from output.
taking input arguments from the command line
I haven't had time to wrap these in an distributable extension, but you can see the code here: https://gist.github.com/brazilbean/3ebb31324f6dad212817b3663c7a0219.
Please feel free to use/modify/do-great-things with these examples. :)

Related

z.show limit problem in python interpreter

I am using python interpreter in zeppelin and I want to display pandas DataFrame through z.show() without limit in 1000 rows.
But when I increase zeppelin.python.maxResult then nothing changes and z.show() still display 1000 rows.
Can anyone know what is the problem?
There is an additional workaround needed.
You did correctly with the modification of zeppelin.python.maxResult in the interpreter GUI. What you should try is the modification of the property zeppelin.interpreter.output.limit in zeppelin-site.xml in Zeppelin's conf file.
To modify zeppelin-site.xml you have to make a copy of zeppelin-site.xml.template and paste it as zeppelin-site.xml, then modify it.

How to make drill down tables in Zeppelin?

I am trying to make each value in one of the column of table as clickable so that I can develop drill down functionality using Zeppelin Table. But following sample code is not working at all.
print(s"""%table
a\tb\n%html <button>x</button>1\t2\n%html <button>y</button>3\t4
""")
It will take quite some effort to make this work.
The basic idea is converting a data source (e.g. Spark DataFrame) to a complete and self contained HTML section and which is interpreted by Zeppelin. Hide and show need to be handled by javascript library.
Zeppelin using Bootstrap, so we shall use bootstrap library directly. This SO might help Bootstrap cllapse. Perhaps need more styling.
If you are just wanna drilldown function while not strictly with table. And if you are using Spark, it might be a bit easy with spark-highcharts to implement the feature like Highcharts column drill down
Finally my code worked. The issue seems to be if you have html tag in the first column, it will not work. However, it works in all the other columns. Just add one more cols in the front and it worked.
print(s"""%table
dummy\ta\tb\np1\t%html <button>x</button>1\t2\np1\t%html <button>y</button>3\t4
""")

Excel: apply conditional formatting if cell contains one of x strings

What I'm trying to do should be quite simple but I am getting error messages saying that conditional formatting doesn't accept this method.
So I am looking for a fix or an alternative.
What I have is a list of search texts for phone faults
screen broken
wifi not working
bluetooth dead
the dooflip isnt working
etc.
I have also set up a number of common keywords
screen
wifi
bluetooth
By comparing these two we can see that the last one doesn't adhere to any of my common keywords, and so I want it highlighted/ copied somewhere etc. so I can view and take any action.
So far I have attempted to set up conditional formatting to search the terms for the keywords and if it doesn't contain any then highlight it.
=ISERROR(SEARCH({"wifi", "bluetooth", "screen"},$H$117))
When using this I get informed that conditional formatting does not support arrays (it works fine if I only specify one search term).
If i create a table with all the keywords in and use the following it works, however it will only find direct mataches, and wont search for the word in the cell string
=ISERROR(MATCH(<cell_to_change_colour_of>, <keyword_table>,0))
So is there another way of doing this?
my answer requires MOREFUNC addon*
=REGEX.COMP(A1,"wifi|bluetooth|screen",FALSE)
this will return true if any of the words appear anywhere in cell A1. FALSE in the formula stipulates that it is not case sensitive.
Unfortunately due to Excell's stupid rules it will not work directly in Conditional Formatting box. You will need to place it in a helper column, and point the conditional formatting rule to that column.
MOREFUNC ADDON
Morefunc Addon is a free library of 66 new worksheet functions.
HERE is some information (by original author)
here is the last working download link I found
here is a good installation walk-through video

Export Stata misstable summarize

I want to report missing values in a nice table (latex).
So is there a way to export the results from misstable summarize in the same/similar format as displayed?
Example code:
webuse studentsurvey, clear
misstable summarize
Thank you!
There is a package by Stata that creates LaTeX code in the Stata Journal style. It´s called -sjlatex-. This allows you to transfer Stata output to a Tex document just as it appears in your output window. There is some documentation here: http://www.ats.ucla.edu/stat/stata/latex/verbatim.htm. To install I typed search sjlatex and followed the links.
Then you can run something like:
webuse studentsurvey, clear
sjlog using my_missings_file
misstable summarize
sjlog close
sjlog type my_missings_file.log.tex
The Latex code will appear in the output window and will be saved in the respective file. I have no Latex available at the moment, so I couldn't test the Latex output.

Diff tool which generates documentation?

I have tried Beyond Compare, and it seems to be a good tool.
But I haven't found a way to export an overview of the differences.
The format of it should be one that most people can read. Doc, Rtf, Pdf, Html...
What I need is to display the differences of two folder. And it would be enough to display which files has been changed. But it would also be nice if it would be possible to, in the documentation, go deeper and actually see which rows in a file has been changed.
Are there any tools that can do this?
Beyond Compare has some functions to do that.
For example, in the folder diff view, select the files you want to report and then select Actions->File Compare Report. HTML is one of the output formats supported there.
Araxis Merge covered all of my needs.
Simple to use
Generated a nice overview of files in folder structure
Could click on changed files to see the changes in the content
The colors could be better, but that can be solved by inserting a custom CSS-file. :)
This script to colorize diff output to HTML might be useful. There are many other tools, one more is difftool.
On a relatively different note, I had used a code coverage tool that also generated HTML code views from gcov coverage information. Its called lcov.

Resources