Python module providing a bridge between Scikit-Learn’s Machine Learning methods and pandas-style DataFrames
Questions tagged [sklearn-pandas]
1336 questions
-1
votes
1 answer
How do we create hyperlinked strings in Python? Is there a way?
I am building a chatbot using nltk.util pairs. I am using regular expressions for the combinations! I want one of the responses to be “ Visit Google” where “Google” should be a hyperlink that should take you to https://www.google.com!
-1
votes
1 answer
How to insert txt file to sklearn using Jupyter notebook
I'm trying load huge dataset into sklearn system via a txt file. Or is there a easy method to upload it
-1
votes
1 answer
Sklearn - Error While Importing using PIP
from sklearn import preprocessing
Getting the Follwing output:
File "", line 1, in
File "C:\Users\arunr\lib\site-packages\sklearn__init__.py", line 75, in
from .utils._show_versions import show_versions
File…

Arun Raina
- 1
- 1
-1
votes
1 answer
How to extract feature from lists?
How to extract feature from dataset by python like :
I find two ways to slove this problem.
1) One is:
But
So it is not a good way.
2) Another is :
Search C and D column to find topK items, and only keep the topK.
But it will lead to the…

Anna
- 261
- 1
- 2
- 12
-1
votes
1 answer
Python NLP - Sklearn - text classifier, unigrams and bigrams the same for both negative and positive labels
I'm trying to create a text classifier to determine whether an abstract indicates an access to care research project. I am importing from a dataset that has two fields: Abstract and Accessclass. Abstract is a 500 word description about the project…

tenebris silentio
- 519
- 5
- 23
-1
votes
1 answer
Read csv like multidimensional data array for further processing with sklearn
I have csv file with data like that:
jake 12 71 31 82 True
jake 44 54 44 80 True
jake 51 30 39 75 True
will 56 12 63 10 False
will 76 74 25 13 False
will 41 98 65 15 False
rich 77 11 93 25 False
rich 18 88 90 11 False
rich 22 12 99 20 False
chez 97…

Quanti Monati
- 769
- 1
- 11
- 35
-1
votes
1 answer
How does sklearn know which columns are One-Hot encoded?
I have a data set where there are columns that are of type object and others of type int or float. I understand that I need to convert the object columns to dummy variables but I also have some int and float columns that represent binary data…

Altamash Rafiq
- 349
- 1
- 2
- 10
-1
votes
1 answer
Why is the following python code related to sklearn preprocessing not working and how can I debug it?
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('Data.csv')
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, 3].values
# Taking care of missing data
from sklearn.impute import…

HARSHIT DANG
- 21
- 1
- 5
-1
votes
1 answer
How to scale the input data for trained model?
I have a trained model that uses regression to predict house prices. It was trained on a standardized dataset (StandatdScaler from sklearn). How do I scale my models input (a single example) now in a different python program? I can't use…

Kojimba
- 83
- 1
- 8
-1
votes
1 answer
I get this type of error : TypeError: '<' not supported between instances of 'int' and 'str'
from sklearn.preprocessing import LabelEncoder
var_mod = ['Gender','Married','Dependents','Education','Self_Employed','Property_Area']
le = LabelEncoder()
for i in var_mod:
data[i] = le.fit_transform(data[i])
I have try this to convert all…

Luis Munoz Vilchez
- 13
- 1
-1
votes
2 answers
KeyError:"['class']" not found in axis
I found a tutorial about decision tree algorithm using pyxll add-in for excel, and tried to execute. I get an error: KeyError:"['class']" not found in axis.
from pyxll import xl_func
from sklearn.tree import DecisionTreeClassifier
from…

minipuncher
- 3
- 2
- 5
-1
votes
1 answer
Why is Multi Class Machine Learning Model Giving Bad Results?
I have the following code so far:
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
from sklearn import preprocessing
from sklearn.naive_bayes import GaussianNB
from sklearn.model_selection import…

MRT
- 793
- 7
- 12
-1
votes
1 answer
Fetching / Extract the row from excel based on matched value
Filter out the specific value from excel(anly columns), fetch the complete row and save in to another tab
Used Pandas
Input
Item Units UnitCost Total
Pencil 95 1.99 189.05
Binder 50 19.99 999.5
Pencil 36 4.99 179.64
Pen 27 …

Mahesh
- 29
- 4
-1
votes
1 answer
pandas datframe replace numerical columns with condition on categorical columns
I have dataframe as :
Final_Status Delivered_cnt RTO_cnt
1 RTO 0 1
2 RTO 4 1
3 Delivered 4 1
4 RTO 5 1
5 RTO 2 …

ajaypr55
- 141
- 2
- 11
-1
votes
1 answer
Expected 2D array, got scalar array instead error in pandas regression
I'm taking an error when i try to calculate regression in pandas. Here is the code:
import pandas as pd
import matplotlib.pyplot as plt
df=pd.DataFrame({"haftalar":[1,2,3,4,5,6,7],
…

Onur Demirci
- 35
- 5