From 64fad7f28d00111fb7230080346c65e8dccacb90 Mon Sep 17 00:00:00 2001 From: Srihari Thyagarajan Date: Fri, 23 Aug 2024 18:48:14 +0530 Subject: [PATCH] init commit --- .../One_Hot_Encoding_of_Nominal_Values.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/easy/One_Hot_Encoding_of_Nominal_Values/One_Hot_Encoding_of_Nominal_Values.py b/easy/One_Hot_Encoding_of_Nominal_Values/One_Hot_Encoding_of_Nominal_Values.py index 1aa2fd8..d65c09a 100644 --- a/easy/One_Hot_Encoding_of_Nominal_Values/One_Hot_Encoding_of_Nominal_Values.py +++ b/easy/One_Hot_Encoding_of_Nominal_Values/One_Hot_Encoding_of_Nominal_Values.py @@ -1,5 +1,11 @@ import numpy as np + def to_categorical(x, n_col=None): - # Your code here - pass \ No newline at end of file + # Your code here + pass + + +x = np.array([0, 1, 2, 1, 0]) +output = to_categorical(x) +print(output)