jupyter

Python doesn't know the class attributes, while Jupyter does

Python doesn't know the class attributes, while Jupyter does Question: I have this code from StatQuest channel. This code works in Jupyter, however when I run this in a .py file, it reports the error AttributeError: ‘BasicNNTrain’ object has no attribute ‘w00’ This is the code: import torch import torch.nn as nn import torch.nn.functional as …

Total answers: 1

Error trying to import python modules using jupyter package on pycharm

Error trying to import python modules using jupyter package on pycharm Question: I’m using Pycharm with the jupyter package and sundently I can’t import any module from pythons library (panda,numpy,…). The error that I get is, > ————————————————————————— ModuleNotFoundError Traceback (most recent call last) Cell In[1], line 1 —-> 1 import numpy as np ModuleNotFoundError: …

Total answers: 1

iterator function does not iterate over all elements

iterator function does not iterate over all elements Question: I have two functions: # function to get number of wanted atom def atom_number_grabber(sum_formula, wanted_atom): match = re.match(r"([A-Z][a-z]*)([0-9]*)", sum_formula, re.I) if match: items = match.groups() if items[0] == wanted_atom: atom_number = items[1] if not atom_number: atom_number = "1" return atom_number else: pass and #function to iterate …

Total answers: 1

Seeing the progress of my code in real time in jupyter

Seeing the progress of my code in real time in jupyter Question: I have this code which I am running on jupyter notebook with open(‘tracker.txt’, ‘w+’) as p: for i in range(1,100000000): p.write("nValue is: "+str(i) ) while running this code when I am opening the tracker.txt file it is showing my blank, and only showing …

Total answers: 1

How to set order of x-axis on sns histplot?

How to set order of x-axis on sns histplot? Question: The ‘floorType’ was originally character variable that I changed into integer (1,2,3,4,5) through Excel. But when I loaded that cvs. file into Jupyter and draw sns histogram of this variable, the order of axis is shown as (4 -> 5 -> 3 -> 2 -> …

Total answers: 1

how to use scrapy package with Juypter Notebook

how to use scrapy package with Juypter Notebook Question: i’m trying to learn web scraping/crawling and trying to apply the below code on Juypter Notebook but it didn’t show any outputs, So can anyone help me and guide me to how to use scrapy package on Juypter notbook. The code:- import scrapy from scrapy.linkextractors import …

Total answers: 1

ModuleNotFoundError: No module named 'nbformat'

ModuleNotFoundError: No module named 'nbformat' Question: I would like to run python in a Quarto document. I followed the docs about installing and using python in Quarto, but the error stays. Here is some reproducible code: — title: "matplotlib demo" format: html: code-fold: true jupyter: python3 — For a demonstration of a line plot on …

Total answers: 1

Jupyter notebook kernel issue in vscode : Kernel not selectable in a specific folder

Jupyter notebook kernel issue in vscode : Kernel not selectable in a specific folder Question: I’m a beginner in python, using jupyter notebook in VSCode. In a specific folder, which I use as a workspace, there is no kernel available, shown as below. (‘Select kernel’ shows up at the top right corner) The funny part …

Total answers: 1

WebScraping: Pandas to_excel Not Displaying full DataFrame

WebScraping: Pandas to_excel Not Displaying full DataFrame Question: I am brand new to coding, and was given a web scraping tutorial (found here) to help build my skills as I learn. I’ve already had to make several adjustments to the code in this tutorial, but I digress. I’m scraping off of http://books.toscrape.com/ and, when I …

Total answers: 1