Is One Hot Encoding Vectorized?
You can read the sklearn documentation here. If you click in source you can check the code.
If you want to do one hot encoding you can do
    &gt;&gt;&gt; from sklearn.preprocessing import OneHotEncoder
    &gt;&gt;&gt; enc = OneHotEncoder(handle_unknown='ignore')
    &gt;&gt;&gt; X = [['Male', 1], ['Female', 3], ['Female', 2]]
    &gt;&gt;&gt; enc.fit(X)
    OneHotEncoder(handle_unknown='ignore')
    &gt;&gt;&gt; enc.categories_
    [array(['Female', 'Male'], dtype=object), array([1, 2, 3], dtype=object)]
    &gt;&gt;&gt; enc.transform([['Female', 1], ['Male', 4]]).toarray()

You should only try to implement this if you are an experimented developer. A couple lines of code that implement OHE in a non optimal way is:
for col in columns_encoding:
    variables = df[col].unique()
    for v in variables:
        df[col + str(v)] = [1 if row == v else 0 for row in df[col].values]

where columns_encoding is a list of the columns you want to encode and df your dataframe