<jupyter_start><jupyter_text>Data Exploration<jupyter_code># examine first few rows 
df.head() 
# examine last few rows 
df.head() 
# shape of data 
df.shape 
# columns 
df.columns
# dtypes 
df.dtypes
# info 
df.info()<jupyter_output><class 'pandas.core.frame.DataFrame'>
RangeIndex: 432 entries, 0 to 431
Data columns (total 15 columns):
 #   Column       Non-Null Count  Dtype  
---  ------       --------------  -----  
 0   Make         428 non-null    object 
 1   Model        428 non-null    object 
 2   Type         428 non-null    object 
 3   Origin       428 non-null    object 
 4   DriveTrain   428 non-null    object 
 5   MSRP         428 non-null    object 
 6   Invoice      428 non-null    object 
 7   EngineSize   428 non-null    float64
 8   Cylinders    426 non-null    float64
 9   Horsepower   428 non-null    float64
 10  MPG_City     428 non-null    float64
 11  MPG_Highway  428 non-null    float64
 12  Weight       428 non-null    float64
 13  Wheelbase    428 non-null    float64
 14  Length       428 non-null    float64
dtypes: float64(8), object(7)
memory usage: 50.8+ KB<jupyter_text>Data Preparation<jupyter_code># check missing values 
df.isnull().sum() 
# visualizing missing values 
plt.figure(figsize=(10,8))
sns.heatmap(df.isnull(), cbar=False, annot=True)
plt.show() 
# filling missing values with mean 
df['Cylinders'].fillna(df['Cylinders'].mean(), inplace=True)
# check again 
df.isnull().sum() 
# drop all of the missing values in the category columns 
df.dropna(inplace=True) 
df.isnull().sum() 
df['Make'].value_counts().head()  
# Asia or Europe 
df[df['Origin'].isin(['Asia', 'Europe'])]
len(df[df['Origin'].isin(['Asia', 'Europe'])])
# remove unwanted rows: select first
df[df['Weight'] > 4000].drop(inplace=True) 
# remove records 
df[~(df['Weight'] > 4000)]
# check shape 
df.shape 
df['MPG_City'] = df['MPG_City'].apply(lambda x: x + 3)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12916666666666668, 'fraction_numerical': 0.05677083333333333, 'mean_word_length': 2.9284253578732105, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '434761', 'license': 'MIT', 'n_tokens_mistral': 763, 'n_tokens_neox': 661, 'n_words': 182, 'path': 'Cars_Dataset/Cars Data Analysis.ipynb', 'repo_name': 'hossainlab/DataAnalysisProject', 'size': '1920'}