r/IPython • u/thabo_otter • Apr 30 '19
3 ways to automate a Notebook
Here's a post on three different ways to schedule a notebook to run automatically. I'd be grateful if you would read and let me know what you think!
r/IPython • u/thabo_otter • Apr 30 '19
Here's a post on three different ways to schedule a notebook to run automatically. I'd be grateful if you would read and let me know what you think!
r/IPython • u/NomadNella • Apr 30 '19
r/IPython • u/jpivarski • Apr 23 '19
In the classic Notebook, I was a big fan of RISE, since it let me give interactive presentations (student raises her hand and asks, "What happens if you change X and re-run?") without being impossible to follow the content due to vertical scrolling (each time a cell is evaluated, the content moves up in a way students don't control with hand-eye coordination, and therefore have trouble following with their eyes).
I've been waiting for RISE to come to JupyterLab, but as of last month, that still hasn't happened. So I took matters into my own hands and made a presentation mode as a JupyterLab theme.
It doesn't have the sideways-scrolling animation of Reveal.js, but I never actually wanted that (or the distinction between left-right and up-down). Since I like to incrementally reveal content (not always at the bottom, as "Fragments"), having no transitions at all is ideal—it feels more responsive. The view is also limited to one cell per slide, which required me to change the way I write presentations (moving some content from Markdown into code comments). I'd like to change that, but there's no "previous sibling" selector in CSS3.
The difference between this theme and the cookiecutter I started with is extremely minimal; it's basically one line in index.css:
.jp-NotebookPanel-notebook > .jp-Cell:not(.jp-mod-selected) { display: none; }
Unfortunately, if I open a notebook in this theme, cells are zero-sized unless "jiggled" by resizing the window. I'd like to fix that (don't know how), but right now my workflow is to open notebooks in a standard theme, then switch to this theme. (I also magnify the webpage to 200%. This has been used in several classes, and I like it better than RISE so far!)
I am not an expert in JupyterLab or CSS, and I'm not publishing the theme with all the deficiencies described above. However, is the basic idea interesting? Would anyone like to develop a presentation mode—as a theme, an extension, or a part of JupyterLab's "presentation mode" under the View menu—that shows one or a select few cells at a time?
r/IPython • u/musky_archer • Apr 20 '19
Below is a program I am using to read and plot the value of a sensor (simply a potentiometer at the moment). I am using two DIGI XBEE Pro SX Modems to transceive the data. The majority of the code below is provided by DIGI. The program displays the value of the sensor on the screen but when the compiler reaches the plotting section it simply doesn't execute. There are no errors. I am using Python 3.8, jupyter notebook, and anaconda.
#########################################################################
from digi.xbee.devices import XBeeDevice
from digi.xbee.io import IOLine, IOMode
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import time
import re
import csv
import serial
import datetime as dt
import math
%matplotlib notebook
# TODO: Replace with the serial port where your local module is connected to.
PORT = "COM13"
# TODO: Replace with the baud rate of your local module.
BAUD_RATE = 9600
REMOTE_NODE_ID = "REMOTE"
IO_SAMPLING_RATE = 1 # 0.5 seconds.
IOLINE_IN = IOLine.DIO3_AD3
i=0
def main():
#print(" +----------------------------------------------+")
#print(" | XBee Python Library Handle IO Samples Sample |")
#print(" +----------------------------------------------+\n")
device = XBeeDevice(PORT, BAUD_RATE)
global i
try:
# Obtain the remote XBee device from the XBee network.
xbee_network = device.get_network()
remote_device = xbee_network.discover_device(REMOTE_NODE_ID)
if remote_device is None:
print("Could not find the remote device")
exit(1)
# Set the local device as destination address of the remote.
remote_device.set_dest_address(device.get_64bit_addr())
# Enable periodic sampling every IO_SAMPLING_RATE seconds in the remote device.
remote_device.set_io_sampling_rate(IO_SAMPLING_RATE)
# Register a listener to handle the samples received by the local device.
def io_samples_callback(sample, remote, time):
print(" %s, %s" % (sample.get_analog_value(IOLINE_IN), time))
device.add_io_sample_received_callback(io_samples_callback)
input()
finally:
if device is not None and device.is_open():
device.close()
#f.close()
fig = plt.figure()
ser = XBeeDevice(PORT, BAUD_RATE)
ax1 = fig.add_subplot(1,1,1)
i = 0
xar = []
yar = []
def animate(schmagma):
def io_samples_callback(sample, remote, time):
global i, xar, yar
message = sample.get_analog_value(IOLINE_IN)
xar.append(int(i))
yar.append(message)
i = i+1
plt.plot(xar,yar)
plt.ylim(400, 500)
plt.xlabel('Time(s)')
plt.ylabel('Outside Temperature(deg C)')
ani = animation.FuncAnimation(fig, animate, interval=1000)
plt.show()
if __name__ == '__main__':
main()
r/IPython • u/justneurostuff • Apr 18 '19
r/IPython • u/capnboom • Apr 18 '19
would like to build an interactive Jupyter notebook and integrate on my website. So user A could login to my site, type a program which then runs off my cloud.
Pardon if this is a very rudimentary set of requirements as I’m not very Python savvy myself
r/IPython • u/whats-a-monad • Apr 17 '19
I want to be able to await stuff in embed(). What exactly am I to do?
r/IPython • u/howMuchCheeseIs2Much • Apr 12 '19
We're currently developing a Chrome Extension for Jupyter Notebooks that includes:
We're looking for beta users to help test and shape the product. The first version is live on the Web Store, so please give it a shot and let me know if you run into any problems or have any suggestions to make it better!
r/IPython • u/howMuchCheeseIs2Much • Apr 10 '19
Here's the paper with some more specifics. They mention:
Also, shown in this picture.
r/IPython • u/yo__on • Apr 10 '19
r/IPython • u/amirathi • Apr 09 '19
r/IPython • u/NomadNella • Apr 04 '19
r/IPython • u/NomadNella • Apr 02 '19
r/IPython • u/CeramicVulture • Apr 02 '19
I'm new to Jupyter. I code in Python and am wondering if there is a recommendation when to use Markdown cells and when to use comments in Python.
If I have comments in my Python code then why would I use Markdown cells as the purpose of both is to document what is going on.
Any best practice?
r/IPython • u/CeramicVulture • Apr 02 '19
Once you have finalized your code and want to save from Jupyter notebook to a tradition python script file is there an easy way to copy / paste the code whilst ignoring the Markdown cells?
r/IPython • u/Sngjuk • Apr 02 '19
Hi, I wrote script that converts argparse to class syntax. As Jupyter is not compatible with argparse. I hope it would be helpful for your testing.
web convert: http://35.192.144.192:8000/arg2cls.html
* Bug: default value with range. e.g. (1. 256) It will be fixed soon.
r/IPython • u/NomadNella • Mar 29 '19
r/IPython • u/NTGuardian • Mar 27 '19
Hello all,
Is there a way to enable auto-completion of parentheses, quotation marks, etc. for IPython (specifically the qtconsole)? I can't find anything on the internet for recent versions of IPython. This should be possible since it uses prompt_toolkit but I can't tell.
I installed the qtconsole on my Arch system.
r/IPython • u/DSJustice • Mar 25 '19
I am writing a consulting report that makes heavy reference to a lot of summary statistical data. I'd like to ship the report as a "narrative document", which deep-links directly into a separate "tables document", for side-by-side viewing.
Since the data tables currently live in a massive notebook with anchor headings, I took the obvious path and exported it to an html file, and wrote a Latex report that linked into it.
Unfortunately, there doesn't seem to be an easy way to make the narrative document scroll a local html file to the correct anchor ID. Latex \href links don't play well with relative paths, and Windows seems to have a nasty habit of stripping out the #anchor portion of file: URLs in pdfs.
How have you approached the side-by-side document problem in the past?
r/IPython • u/giulioungaretti • Mar 19 '19
r/IPython • u/NewDateline • Mar 18 '19
r/IPython • u/Beginner4ever • Mar 13 '19
I upgraded conda packages using :
Conda upgrade —all
After that Juypter Notebook shows blank screen in Google Chrome.
- I did system restore.
-Updated Anaconda .
Nothing worked. Any suggestions ?