eea525b1a76f1166e87582a5312c952c1a093766,category_encoders/ordinal.py,OrdinalEncoder,ordinal_encoding,#,274

Before Change



                if util.is_category(X[col].dtype):
                    categories = X[col].cat.categories.tolist()
                    if X[col].isna().any():
                        categories += [np.nan]
                else:
                    categories = X[col].unique()

After Change



                // Avoid using pandas category dtype meta-data, see /뢃
                categories = X[col].unique().tolist()
                if util.is_category(X[col].dtype) and X[col].isna().any():
                    categories += [np.nan]

                index = pd.Series(categories).fillna(nan_identity).unique()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 6

Non-data size: 3

Instances


Project Name: scikit-learn-contrib/categorical-encoding
Commit Name: eea525b1a76f1166e87582a5312c952c1a093766
Time: 2020-03-08
Author: p.gijsbers@tue.nl
File Name: category_encoders/ordinal.py
Class Name: OrdinalEncoder
Method Name: ordinal_encoding


Project Name: dgasmith/opt_einsum
Commit Name: 5ecd0b73ca9b1ad5b515c36f6be4389e788fe679
Time: 2018-08-04
Author: john.gray.14@ucl.ac.uk
File Name: opt_einsum/contract.py
Class Name:
Method Name: _core_contract


Project Name: Logan1x/Python-Scripts
Commit Name: 2ef5c047b4296a807eea8366f67d7f271f0d47de
Time: 2020-06-28
Author: 59202862+Monsieurvishal@users.noreply.github.com
File Name: bin/password-strength-checker.py
Class Name:
Method Name: pass1


Project Name: sebp/scikit-survival
Commit Name: aeb1c98a2f8a42d034aedd3f0b12a990f075610a
Time: 2019-04-25
Author: sebp@k-d-w.org
File Name: sksurv/util.py
Class Name:
Method Name: check_y_survival


Project Name: biotite-dev/biotite
Commit Name: 655073219ced6ed450ee20c6bfdeb42bea11b1bf
Time: 2020-12-22
Author: anter.jacob@gmail.com
File Name: src/biotite/structure/charges.py
Class Name:
Method Name: _get_parameters


Project Name: nicodv/kmodes
Commit Name: 02566e8d7f883f06221b60df9b87f971db6d9ca7
Time: 2018-03-03
Author: njdevos@gmail.com
File Name: kmodes/kmodes.py
Class Name:
Method Name: init_huang