b5034279b48ae96ffdd4714f96e0f62b0f4807fc,category_encoders/ordinal.py,OrdinalEncoder,ordinal_encoding,#,239
Before Change
if mapping is not None:
mapping_out = mapping
for switch in mapping:
categories_dict = dict(switch.get("mapping"))
column = switch.get("col")
transformed_column = X[column].map(lambda x: categories_dict.get(x, np.nan))
try:
After Change
index = []
values = []
for i in range(len(categories)):
index.append(categories[i])
values.append(i + 1)
mapping = pd.Series(data=values, index=index)
mapping_out.append({"col": col, "mapping": mapping, "data_type": X[col].dtype}, )
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: scikit-learn-contrib/categorical-encoding
Commit Name: b5034279b48ae96ffdd4714f96e0f62b0f4807fc
Time: 2018-10-26
Author: jcastaldo08@gmail.com
File Name: category_encoders/ordinal.py
Class Name: OrdinalEncoder
Method Name: ordinal_encoding
Project Name: nilmtk/nilmtk
Commit Name: 2983b5717324697391c61c5da01a65bc85908168
Time: 2014-05-14
Author: jack-list@xlk.org.uk
File Name: nilmtk/electricitymeter.py
Class Name: ElectricityMeter
Method Name: load
Project Name: theislab/scanpy
Commit Name: 37ef2c69f22a6e2d1232782dd3e192a003731a75
Time: 2020-11-25
Author: michal.klein@protonmail.com
File Name: scanpy/readwrite.py
Class Name:
Method Name: _download