jupyter-notebook

How to get full traceback in Python Notebook by using "%tb"?

How to get full traceback in Python Notebook by using "%tb"? Question: I ran some python code block on a Jupyter Notebook and got An exception has occurred, use %tb to see the full traceback. error/warning followed by a single line of traceback. I want to see the full traceback as suggested. But I didn’t …

Total answers: 1

How to read a csv with a broken header in pandas?

How to read a csv with a broken header in pandas? Question: I have a problem with opening CSV file using Pandas in Jupyter and then I tried to open it in Visual studio and it’s also not working. What am I missing? Code in Jupyter: path = ‘data/DATA_vozila_RAW.csv’ df = pd.read_csv(path) I also tried …

Total answers: 1

Why nyquist plots are not working in my jupyter notebook? (python)

Why nyquist plots are not working in my jupyter notebook? (python) Question: I am trying to do the Nyquist plot of a function in python, in jupiter notebook. When i try to use the function control.nyquist_plot, used to generate the plot, pyton gives me an error in one of the libraries files. It draws only …

Total answers: 1

Remove subfolders with the same name if empty

Remove subfolders with the same name if empty Question: Assuming I have a folder called trial that contains the following: Folder1, Folder2, Folder3,…Folder5 And each of these folders has a subfolder called FF-15 Thus, the path is: ‘/Users/brianadams/school/trial/Folder1/FF-15’, or ‘/Users/brianadams/school/trial/Folder2/FF-15’, and so on. I want to delete folder FF-15 if it is empty from all …

Total answers: 2

How to install diff version of a package (transformers) without internet in kaggle notebook w/o killing the kernel while keeping variables in memory?

How to install diff version of a package (transformers) without internet in kaggle notebook w/o killing the kernel while keeping variables in memory? Question: I have prepared an inference pipeline for a Kaggle competition and it has to be executed without internet connection. I’m trying to use different versions of transformers but I had some …

Total answers: 2

Jupyter Notebook – ipywidgets – Automatic feedback from selected

Jupyter Notebook – ipywidgets – Automatic feedback from selected Question: I am trying to create a function in a Jupyter notebook to: Display with an ipywidget a series of radio buttons from a list of options. Automatically display the selected value. Save the selected value in a variable. So far, I managed step 1 (widget …

Total answers: 2

Sort a vector in PyTorch

Sort a vector in PyTorch Question: I am performing a prediction using an input image and a pre-trained classifier on ImageNet using PyTorch. What I would like to do is to calculate the value for each for the class and returned the highest 10 values. My code looks like: img = imread_img(‘image.png’) input = pre_processing(img) …

Total answers: 2

How to access Python variables notebook from python script

How to access Python variables notebook from python script Question: How to access Python variables (for example a Pandas dataframe in a Jupyterlab notebook) from a python script ? I need to access a Dataframe (while I’m working in a notebook) from a python script, locally. I need to access it without having to type …

Total answers: 1

How to cure Google Colab with miniconda installed and get on import ModuleNotFoundError?

How to cure Google Colab with miniconda installed and get on import ModuleNotFoundError? Question: I have used Google Colab for more than half a year successfully for a special application. In the beginning of my Colab-notebook script I install conda and use conda-forge for installing a key Python package. At the beginning of this year …

Total answers: 1