jupyter

How to update and change the current domain array list

How to update and change the current domain array list Question: For example i have a list of website name examples exist = [‘http://sushiblast.com’, ‘http://funnyvideos-funny.info’, ‘https://youtube.com’,’https://api.forms.app/user/infobyname/minecraft’] Here is the code example that i used input_str = exist # Printing original string print ("Original string: " + input_str) result_str = "" for i in range(5, len(input_str)): …

Total answers: 1

DecisionTreeClassifier TypeError: fit() missing 1 required positional argument: 'y'

DecisionTreeClassifier TypeError: fit() missing 1 required positional argument: 'y' Question: While using Jupyter notebook I never had this problem with the fit() function. But with this code I do: import pandas as pd from sklearn.tree import DecisionTreeClassifier data = pd.read_csv(‘train.csv’) test_data = pd.read_csv(‘test.csv’) X = data.drop(columns=[‘Survived’]) y = data[‘Survived’] model = DecisionTreeClassifier model.fit(X, y) prediction …

Total answers: 2

python can't multiply sequence by non-int of type 'numpy.float64'

python can't multiply sequence by non-int of type 'numpy.float64' Question: X = [5, 15, 25, 35, 45, 55] Y = [5, 20, 14, 32, 22, 38] plt.scatter(X, Y) xm=np.mean(X) #valeur moyenne de x ym=np.mean(Y) #valeur moyenne de y num=0 #numerator den=0 #denominator for i in range(len(X)): num +=(X[i]-xm)*(Y[i]-ym) den +=(X[i]-xm)**2 a=num/den b=ym-a*xm print(a,b) yp=a*X+b #y …

Total answers: 1

Is it better to create a Dockerfile based on tensorflow:latest-gpu-py3-jupyter or refactor for load_image() attribute?

Is it better to create a Dockerfile based on tensorflow:latest-gpu-py3-jupyter or refactor for load_image() attribute? Question: I am developing image classification models in the Jupyter notebook environment. After getting my model to work with the CPU, I am trying to use the latest TensorFlow Docker image supported for Jupyter & GPU (tensorflow/tensorflow:latest-gpu-py3-jupyter) so I can …

Total answers: 2

ModuleNotFoundError: No module named 'torch' in ubuntu

ModuleNotFoundError: No module named 'torch' in ubuntu Question: When I want use torch in jupyter, I got this error ModuleNotFoundError: No module named ‘torch’ but I check that torch is installed already. following: >>> python -c "import torch; print(torch.__version__)" 1.10.2+cu102 It is confirmed in Ubuntu CLI, but there is an error in jupyter only. How …

Total answers: 2

JupyterLab launches from base installation even when in conda environment

JupyterLab launches from base installation even when in conda environment Question: How can I have jupyter lab launch JupyterLab from the current conda environment. Is such a thing possible? Details I wanted to start experimenting with customizing Jupyter(Lab), and so decided to create a new conda environment for it to contain my experiments. However, launching …

Total answers: 1

Visual Studio Code Jupyter not recognising conda kernel

Visual Studio Code Jupyter not recognising conda kernel Question: I created a new conda environment named ‘ct’ and installed Python 3.10.6, Jupyter Lab, matplotlib and numpy. Also the ipykernel is installed. VS Code lets me select Python 3.10.6 from ‘ct’ as interpreter without issues. VS Code select interpreter But I cannot choose ‘ct’ as kernel …

Total answers: 6