Questions tagged [python-interactive]

158 questions
0
votes
2 answers

JupyterLab vs. JupyterNotebook and how to edit code quickly

Which one of the above should one use if they are just getting started? Also, if there a way to quickly edit the code files while debugging to check specific portions of the code? For example when you have a large file like this (publicly found). If…
lbragile
  • 7,549
  • 3
  • 27
  • 64
0
votes
1 answer

psycopg2 OperationalError in python interactive/jupyter notebook

I'm trying to pull data into a pandas dataframe from a pgadmin database using psycopg2. My .py file runs normally in terminal, but when I run it in python interactive (vs code) or jupyter notebooks I get the following error. Code: with…
0
votes
1 answer

Changing animation parameters interactively in matplotlib

I need to animate something rather simple but I do need as well a slider to let the user interactively changes the parameters of the animation. I'd like it to happen online; i.e. if the user changes a parameter while the animation is playing, the…
arash
  • 161
  • 13
0
votes
1 answer

create an interactive IntSlider widget

I am trying to create an interactive IntSlider widget, which calls another function when it updates. The function is callback(parameter) - the parameter inside is a rating. The callback(rating) function's purpose is that it updates the visible…
Renaldo Moon
  • 165
  • 3
  • 14
0
votes
0 answers

How to include interactive plotting in scatter plot?

I have a scatter plot looking like this: Each point in this image describes average hardness value taken over 5 points of data, in each batch. So for each point a hardness plot can be generated with the data. I want to know how to code in…
0
votes
1 answer

What does the python interactive console output?

When I import the datetime module for example, and create a datetime.datetime object, thus that this datetime.datetime object is the value of the expression, it returns datetime.datetime(*values inserted*) But this is not the _str__() return value…
user10385242
  • 407
  • 1
  • 3
  • 10
0
votes
1 answer

How to turn off line numbering in interactive prompt (Visual Studio 2017)

How do I stop this "In [2]:" line numbering? I was trying to follow some shortcuts in the interactive prompt from stack overflow and now my interactive prompt is freezing after this started to appear. Visual Studio 2017 'Interactive' It's frozen…
user8851623
  • 722
  • 8
  • 11
0
votes
1 answer

Previous plots overlaps with new plots using matplotlib interactive

Escenario I want to update the values of a heatmap with a time delay of 1 seconds. The objective is represent the evolution of the Q-Table in a reinforcement learning problem. Error The problem is that the heatmap figure is being updated but the…
Pablo Ruiz Ruiz
  • 605
  • 1
  • 6
  • 23
0
votes
0 answers

Using Multiprocessing Pool from an Interactively loaded module

I have a Python module `mymodule' # mymodule.py import multiprocessing as mp def do_work(x): # do some stuff return 42+x def work(): pool = mp.Pool() work_list= [1,2,3,4,5] returned_values = pool.map(do_work, work_list) …
san
  • 4,144
  • 6
  • 32
  • 50
0
votes
0 answers

how can i make my figure made by matplotlib response to a mouse click event?

I read the document of matplotlib and write the following code, it supposed to capture my mouse event and move the grey line position when i clicked. I read this code in jupiter notebook online, it stop to show the coordinate of my cursor as it…
qiqi li
  • 41
  • 2
0
votes
1 answer

Create subplots from interactive python plot

I have some LVIS Lidar data in hdf5 format. The data has Lat and Long co-ordinates, so I have been able to visualise them on a map using Basemap: f = h5py.File('ILVIS1B_GA2016_0304_R1701_043591.h5','r') LONG = f['/LON0/'] LAT = f['/LAT0/'] X =…
GeoMonkey
  • 1,615
  • 7
  • 28
  • 56
0
votes
1 answer

Python interactive visualization able to write selected data to dataframe?

I am looking for an interactive visualization python tool that would allow me to select a number of data points and then write only those data points into a new data frame, numpy array, etc. For example, I'd like to visualize all of the equity…
CT00
  • 77
  • 1
  • 2
  • 9
0
votes
0 answers

interactive slider to turn on LED using pyfirmata

Trying to turn on an LED using an interactive slider using pyfirmata library. I simply want to turn it off or on using the slider. Here is my code (I do not know what I'm doing wrong): import pyfirmata import time from ipywidgets import widgets,…
Spencer Trinh
  • 743
  • 12
  • 31
0
votes
1 answer

Tree insertions

Aren't the Tree insert functions on interactivepython incorrect? Insert Left: def insertLeft(root,newBranch): t = root.pop(1) if len(t) > 1: root.insert(1,[newBranch,t,[]]) else: root.insert(1,[newBranch, [], []]) …
sam
  • 777
  • 2
  • 6
  • 19
0
votes
0 answers

"python -i print_content.py < file.txt" exits interactive mode

python -i is theoretically meant to run script.py and proceed into interactive mode, however: shell$ python -i print_content.py < file.txt hello world >>> shell$ The script runs successfully and is followed by printing >>>, implying…
Gylmar
  • 1