Skip to content

Instantly share code, notes, and snippets.

View fomightez's full-sized avatar

Wayne's Bioinformatics Code Portal fomightez

View GitHub Profile
@fomightez
fomightez / Answer_text.md
Last active February 22, 2024 18:15
How to use nbformat to see a cell has been run - answer to SO https://stackoverflow.com/q/78038479/8508004

The code below scans an .ipynb file where the first two and fifth cells were run (named example_nb_saved_first_two_cells_run_plus_last.ipynb) and then makes a new notebook out of the executed cells:

import nbformat as nbf
ntbk = nbf.read("example_nb_saved_first_two_cells_run_plus_last.ipynb", nbf.NO_CONVERT)
cells_executed_previously = []
for cell in ntbk.cells:
    if cell.execution_count != None:
        cells_executed_previously.append(cell)
new_ntbk = ntbk
@fomightez
fomightez / RECENT_RUNtest_millefy.ipynb
Created February 11, 2024 22:26
two other notebooks to test for SO https://stackoverflow.com/q/77969756/8508004 saying not rendering R kernel well
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fomightez
fomightez / text_for_style_tips_in_Python_plots.md
Last active February 6, 2024 15:48
Style tips for plotting with Python for SO question https://stackoverflow.com/q/77944909/8508004

Style tips for plotting with Python for SO question https://stackoverflow.com/q/77944909/8508004

In general, I opt for Seaborn when plotting with Python. It is built on top of Matplotlib and handles a lot of the style stuff better than default Matplotlib.

A good initial starting point to getting it close to Excel is to use Seaborn's 'whitegrid' that you set with Seaborn's set_style() method.
So to kick things off, it is common to do:

import seaborn as sns
import matplotlib.pyplot as plt
@fomightez
fomightez / reload_imports_example.ipynb
Last active December 26, 2023 18:34
`.ipynb` file illustrating Use of reload to by pass default import handling for SO https://stackoverflow.com/a/77718555/8508004
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fomightez
fomightez / test_raises-exception.ipynb
Last active November 11, 2023 16:56
est raises-exception tag Jupyter Notebook ipynb file CELL #2 HAS THE TAG ALREADY
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fomightez
fomightez / Image%20ProcessingFIXED.ipynb
Created October 3, 2023 15:49
Working IPywidgets Image Processing notebook - 'Fixed' version of notebook presently in ipywidgets repo at docs/source/examples/Image%2520Processing.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fomightez
fomightez / README.md
Last active March 14, 2025 15:42 — forked from jtpio/README.md
JupyterLab 4, Notebook 7 and NBClassic on Binder

JupyterLab 4 + Notebook 7 + NBClassic on Binder

Jupyter Notebook Logo

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fomightez
fomightez / Atoti_Tutorial_Working_via_sessions_on_MyBinder.ipynb
Created July 14, 2023 17:58
Step-by-step guide to using Atoti in sessions served via MyBInder.org
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.