<jupyter_start><jupyter_text>Now check wheather any dtype transformtions are needed<jupyter_code>dtype = []
for col in df.columns.values:
    dtype.append(df[col].dtype)
dtype_df = pd.DataFrame({'Columns':df.columns.values,'Dtype':dtype})
dtype_df<jupyter_output><empty_output><jupyter_text>Missing Values<jupyter_code>missing_values_df = pd.DataFrame({'Column_Name': df.columns,
             'missing_value_pct': (df.isnull().sum()/df.shape[0])*100})
missing_value_remove_columns= missing_values_df[missing_values_df['missing_value_pct']>50]['Column_Name'].values
missing_value_remove_columns
df.drop(columns=missing_value_remove_columns,axis=1,inplace=True) # Droping the cloumns
for col in df.columns.values:
    if df[col].dtype in ['int64','float64']:
        df[col].fillna(df[col].mean(),inplace=True)
    elif df[col].dtype == 'object':
        #df[col] = df[col].astype('category')
        df[col].fillna(df[col].mode()[0],inplace=True)
df.isnull().sum()<jupyter_output><empty_output><jupyter_text>Unique Categorical value and Same Categorical Value Removal<jupyter_code>df['LandContour'].nunique()
df['LandContour'].value_counts()
df['Id'] = df['Id'].astype('object')
for col in df.columns.values:
    if df[col].dtype == 'object':
        if df[col].nunique() == 1 or df[col].nunique() == df.shape[0]:
            df.drop(col,axis=1,inplace=True)
df.columns
f<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1657142857142857, 'fraction_numerical': 0.010714285714285714, 'mean_word_length': 6.335078534031414, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 14, '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': '423003', 'license': 'Apache-2.0', 'n_tokens_mistral': 514, 'n_tokens_neox': 516, 'n_words': 70, 'path': 'HousePrice Data Set/Missing Values and Completely Unique and Same Columns Removal.ipynb', 'repo_name': 'CodeName-Detective/handson-ml2', 'size': '1400'}