jupyter

Run multiple .py files in a jupyter notebook

Run multiple .py files in a jupyter notebook Question: Basically, I get some python files in a same directory of my main jupyter program, and inside this main program, I need a cell that will run all the other python files. *obs.: the py files are generated dynamically I’ve tried to use something like %run …

Total answers: 1

Astroscrappy not working on multiprocessing Jupyter

Astroscrappy not working on multiprocessing Jupyter Question: I have some multiprocessing code here that tries to run multiple astroscrappy processes at once. However, everything stops when it actually has to call astroscrappy. I am running this in a jupyter notebook. def a_test(i, q): import astroscrappy print(1) path = i s = fits.getdata(path) print(2) print(2.5) a …

Total answers: 3

Clearing decorator ipywidgets

Clearing decorator ipywidgets Question: I have a function which plots a graph with a couple ipywidgets as inputs: from IPython.display import clear_output def on_clicker(button): clear_output() @widgets.interact(dropdown=widgets.Dropdown(…), datepicker=widgets.DatePicker(…) def grapher(dropdown, datepicker): global recalculate … some graphing stuff display(recalculate) recalculate.on_click(on_clicker) The idea is that clicking recalculate calls the graph again and clears the past output. However, when …

Total answers: 1

"import tensorflow" results in error: No module named 'tensorflow.python.eager.polymorphic_function' (Python in Jupyter Lab)

"import tensorflow" results in error: No module named 'tensorflow.python.eager.polymorphic_function' (Python in Jupyter Lab) Question: Python 3.9.12. Windows 10. jupyterlab 3.3.2. Import tensorflow When I try to import Tensorflow, I get the following ‘tensorflow.python.eager.polymorphic_function’ error. ————————————————————————— ModuleNotFoundError Traceback (most recent call last) Cell In [44], line 1 —-> 1 import tensorflow File ~OD13TFODCoursetfod13libsite-packagestensorflow__init__.py:45 42 from tensorflow.python …

Total answers: 1

Trying to find Total Sales & Total Cost of 3 different Countries cars

Trying to find Total Sales & Total Cost of 3 different Countries cars Question: Update: Below is the excel file link. I am brand new to Python and was doing this graph but I am stuck, I am trying to show a horizontal bar graph with 3 different countries, spain, germany, switzerland and trying to …

Total answers: 1

Create a date column and assign value from a condition based on an existing date column in pandas

Create a date column and assign value from a condition based on an existing date column in pandas Question: I have the following: import pandas as pd file = pd.DataFrame() file[‘CASH RECIEVED DATE’] = [‘2018-07-23’, ‘2019-09-26’, ‘2017-05-02’] and I need to create a column called Cash Received Date file[‘Cash Received Date’] such as if [CASH_RECIEVED_DATE] …

Total answers: 2

Pandas: Passing a list through describe()

Pandas: Passing a list through describe() Question: I am trying to describe() a column from df but for every unique value in another column.I have the df: id revenue country 1 128 at 2 130 de 3 132 de 4 134 hu 5 136 at 6 138 at 7 140 hu I want to pass …

Total answers: 1