<jupyter_start><jupyter_text>__Employee Performance Analysis__ __INX Future Inc.__ __Data Processing__<jupyter_code># general purpose libraries
import os
from dotenv import load_dotenv

# data loading and wrangling libraries for EDA
import pandas as pd
import numpy as np

# load the dot env file that contains the path to data file for data privacy
dotenv_path = os.getcwd()+'\\local.env'
load_dotenv(dotenv_path=dotenv_path)

import warnings
warnings.filterwarnings('ignore')
df = pd.read_excel(os.getenv('data'))
df.head()<jupyter_output><empty_output><jupyter_text>Data distribution of Numerical features<jupyter_code>df.describe()
df.info()<jupyter_output><class 'pandas.core.frame.DataFrame'>
RangeIndex: 1200 entries, 0 to 1199
Data columns (total 28 columns):
 #   Column                        Non-Null Count  Dtype 
---  ------                        --------------  ----- 
 0   EmpNumber                     1200 non-null   object
 1   Age                           1200 non-null   int64 
 2   Gender                        1200 non-null   object
 3   EducationBackground           1200 non-null   object
 4   MaritalStatus                 1200 non-null   object
 5   EmpDepartment                 1200 non-null   object
 6   EmpJobRole                    1200 non-null   object
 7   BusinessTravelFrequency       1200 non-null   object
 8   DistanceFromHome              1200 non-null   int64 
 9   EmpEducationLevel             1200 non-null   int64 
 10  EmpEnvironmentSatisfaction    1200 non-null   int64 
 11  EmpHourlyRate                 1200 non-null   int64 
 12  EmpJobInvolvement             1200 non-null   int64 
 13  EmpJobLevel       [...]<jupyter_text>Data Cleaning<jupyter_code>df.isna().sum()
df.isnull().sum()
for i in df:
    if df[i].dtype in ['object', 'bool']:
        print(f"________{i}_______")
        print(df[i].value_counts(), end="\n\n")<jupyter_output>________EmpNumber_______
E100338     1
E1001201    1
E100708     1
E100279     1
E1002015    1
           ..
E1001758    1
E1001869    1
E1001840    1
E1001679    1
E1001484    1
Name: EmpNumber, Length: 1200, dtype: int64

________Gender_______
Male      725
Female    475
Name: Gender, dtype: int64

________EducationBackground_______
Life Sciences       492
Medical             384
Marketing           137
Technical Degree    100
Other                66
Human Resources      21
Name: EducationBackground, dtype: int64

________MaritalStatus_______
Married     548
Single      384
Divorced    268
Name: MaritalStatus, dtype: int64

________EmpDepartment_______
Sales                     373
Development               361
Research & Development    343
Human Resources            54
Finance                    49
Data Science               20
Name: EmpDepartment, dtype: int64

________EmpJobRole_______
Sales Executive              270
Developer                    236
Manager R&D                   [...]<jupyter_text>Data preparation conclusion1. Detect unknown, empty or null values    - result : There are no null, empty or unknown values in the dataset2. Unique features    - result : The EmpNumber is a unique feature as it contains each employees Id and thus it bears no predictive value<jupyter_code>df.drop('EmpNumber', axis=1, inplace=True)
df.to_excel('INX_future_inc_employee_cleaned_dataset.xls')<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup