<jupyter_start><jupyter_text>Changing Column Names<jupyter_code>data.columns = data.columns.str.replace(' ', '_').str.title()
data.columns<jupyter_output><empty_output><jupyter_text>Dropping Salary Column<jupyter_code>data.drop(['Salary', 'Income.1'], inplace = True, axis = 1)
data.shape<jupyter_output><empty_output><jupyter_text>Handling Missing Values<jupyter_code>data[data['Country'].isnull() == True]
# Replacing Missing Country values with 'Unknown'
data['Country'].fillna('Unknown', inplace = True)
data[data['Income'].isnull() == True]
import matplotlib.pyplot as plt
plt.boxplot(data['Income'].dropna().astype('int64'))
# Replacing Income with mean
data['Income'].fillna(data['Income'].mean(),  inplace = True)
data.loc[[5, 14, 172, 183, 982]]
data['Income']  = data['Income'].round(2)
data.head()
data['Date_Of_Birth'] = data['Date_Of_Birth'].apply(pd.to_datetime)
data.info()
df1 = data.copy()
df2 = df1['Full_Name'].str.split(' ', expand = True)
df2.head()
df1 = df1.join(df1.Full_Name.str.split(" ",n=1,expand=True))
df1.head()
df1.rename(columns = {0: 'First_Name', 1: 'Last_Name'}, inplace = True)
df1.columns
df1.head()
# Get the values email from @usnews.com
df1[df1.Email.str.contains('@usnews')]
# Check For Multiple Expression
df1[df1.Email.str.contains('@usnews|@spotify', regex=True)]
# df1.to_csv('My_file_1')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18988269794721407, 'fraction_numerical': 0.027126099706744868, 'mean_word_length': 7.863636363636363, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '230833', 'license': 'MIT', 'n_tokens_mistral': 540, 'n_tokens_neox': 520, 'n_words': 85, 'path': 'Pandas_Text_Analysis/1_Clean_Data/1_Data_Cleaning.ipynb', 'repo_name': 'sudevansujit/7_NLP', 'size': '1364'}