f70e71d5c7fdc8e25391e54e74c3402fb323ad5c,examples/plot_employee_salaries.py,,,#,45

Before Change




columns_to_encode = {
    "one-hot": ["Gender", "Department Name", "Assignment Category"],
    "num": ["Year First Hired"]}

After Change


import pandas as pd
from dirty_cat.datasets import fetch_employee_salaries

description = fetch_employee_salaries()
df = pd.read_csv(description["path"]).astype(str)

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// and carry out some basic preprocessing:
df["Current Annual Salary"] = df["Current Annual Salary"].str.strip("$").astype(
    float)
df["Date First Hired"] = pd.to_datetime(df["Date First Hired"])
df["Year First Hired"] = df["Date First Hired"].apply(lambda x: x.year)

target_column = "Current Annual Salary"
y = df[target_column].values.ravel()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: dirty-cat/dirty_cat
Commit Name: f70e71d5c7fdc8e25391e54e74c3402fb323ad5c
Time: 2018-06-06
Author: pierreglaser@msn.com
File Name: examples/plot_employee_salaries.py
Class Name:
Method Name:


Project Name: nilmtk/nilmtk
Commit Name: 0568d97009745b14910432b46a29f0c2f4a788b4
Time: 2013-12-17
Author: jack-list@xlk.org.uk
File Name: nilmtk/dataset/redd.py
Class Name:
Method Name: load_chan


Project Name: nilmtk/nilmtk
Commit Name: 88392e816488749ffa872b8d64174b013a0b941a
Time: 2014-12-23
Author: nipunb@iiitd.ac.in
File Name: nilmtk/dataset_converters/combed/convert_combed.py
Class Name:
Method Name: convert_combed