Sandeep S commited on
Commit ·
13231d6
1
Parent(s): 1cdc447
Label Encoded dataset
Browse files
main.py
CHANGED
|
@@ -3,4 +3,10 @@ import matplotlib.pyplot as plt
|
|
| 3 |
from sklearn.preprocessing import LabelEncoder
|
| 4 |
from sklearn.model_selection import train_test_split
|
| 5 |
|
| 6 |
-
dataset = pd.read_csv("data.csv")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
from sklearn.preprocessing import LabelEncoder
|
| 4 |
from sklearn.model_selection import train_test_split
|
| 5 |
|
| 6 |
+
dataset = pd.read_csv("data.csv")
|
| 7 |
+
|
| 8 |
+
dataset.drop(columns=['customerID'], inplace=True)
|
| 9 |
+
|
| 10 |
+
encoder = LabelEncoder()
|
| 11 |
+
for column in dataset.select_dtypes(include=['object']).columns:
|
| 12 |
+
dataset[column] = encoder.fit_transform(dataset[column])
|