All Questions
Tagged with sklearn-pandas jupyter-notebook
27 questions
0
votes
3
answers
533
views
Splitting strings of tuples of different lengths to columns in Pandas DF
I have a dataframe that looks like this
id
human_id
1
('apples', '2022-12-04', 'a5ted')
2
('bananas', '2012-2-14')
3
('2012-2-14', 'reda21', 'ss')
..
..
I would like a "pythonic" way to have ...
2
votes
0
answers
1k
views
Why does my Jupyter Notebook work on one computer and fail on another?
I have recently downloaded Jupyter Notebook into my mac but the file that I was able to open in my school windows gives me an error.
These are my libraries:
# Basic Libraries
import numpy as np
import ...
-1
votes
1
answer
334
views
Modifying a dataFrame in jupyter [closed]
i want to delete what after the : in this data (the password) and let just the emails
[emails] https://i.sstatic.net/dX9RB.png
0
votes
1
answer
75
views
I'm brand new to Jupyter and have no idea what is wrong with what I am doing
I trying to use sklearn and ran into an error, but I have no idea what is wrong.
This is my code:
import pandas as pdd
from sklearn.tree import DecisionTreeClassifier
df = pd.read_csv('vgsales.csv')
X ...
1
vote
0
answers
2k
views
AttributeError: module 'scipy' has no attribute '__version__'
I was trying to import sklearn on my Jupyter Notebook but it gave me an error AttributeError: module 'scipy' has no attribute '__version__'.
The whole description for the error is below:
--------------...
0
votes
2
answers
425
views
Input contains NaN, infinity or a value too large for dtype('float64'). What is the solution
from time import time
from sklearn.metrics import f1_score
def train_classifier(clf, X_train, y_train):
''' Fits a classifier to the training data. '''
# Start the clock, train the classifier, then ...
0
votes
1
answer
81
views
linear regression train/shape output not correct
I'm trying to use linear regression to predict the amount of releases of show there will be in the upcoming years. I have a data frame where ever row is a release with column having info like release ...
0
votes
1
answer
69
views
Plotting a simple linear regression model goes wrong
I'd like to create a linear regression model that shows a positive correlation between BMI and Disease risk (a quantitative measure of disease one year after baseline).
The dataset is the same one ...
1
vote
1
answer
2k
views
ImportError: cannot import name 'makedirs'
I tried to import data (as shown below) in Google Colab
from imblearn.datasets import make_imbalance
But the output I got is:
/usr/local/lib/python3.6/dist-packages/sklearn/externals/six.py:31: ...
0
votes
1
answer
1k
views
x has to be a floating point tensor since it's going to be scaled. Got a <dtype: 'string'> tensor instead
I am getting this error when trying to train the model using sklearn train_split method. I have add some data points in to an array and then have created an array of array. Then that array is ...
1
vote
1
answer
11k
views
ImportError: DLL load failed: The specified procedure could not be found
I am using Jupyter to execute the below code but getting the error
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
music_data = pd.read_csv('music.csv')
X = music_data.drop(...
0
votes
0
answers
312
views
Terminal Anaconda not Syncing to Jupyter
I've looked everywhere but can't find my situation.
I deleted my previous installation and did a clean install of Anaconda3.
I think my environment may be out of sync.
In the terminal, I can do '...
4
votes
1
answer
6k
views
How can I set the font of the caption of a Pandas Datafrane?
I trying to display two tables side-by-side in a Jupyter notebook.
I have some code that does this:
header = ["Metric", "Test dataset"]
table1 = [["accuracy", accuracy_test],
...
-2
votes
1
answer
9k
views
AttributeError: module 'sklearn.linear_model' has no attribute 'linearRegression'?
import pandas as pd
import numpy as np
from sklearn.linear_model import LinearRegression
import math
rd=pd.read_csv('homeprices.csv')
a=rd.iloc[:-1]
median_bedrooms=math.floor(a.bedrooms.median())
...
0
votes
1
answer
27
views
Is input order affecting regression model result?
I have X and y to train a model.
X has input x1,x2,x3,x4.
And I use this model to predict new data new_X.
but input in new_X are x3,x2,x1,x4.
X and X_new are dataframes witm many features.
Will ...