<<<<<<< HEAD
A comprehensive collection of hands-on laboratory experiments exploring data analysis,
manipulation, and visualization using Python's scientific computing ecosystem.
DAV_LAB/
β
βββ π exp1/
β βββ π exp1.ipynb β Jupyter Notebook
β βββ π exp1.py β Python Script
β
βββ π exp2/
β βββ π exp2.ipynb β Jupyter Notebook (with outputs)
β βββ π exp2.py β Python Script
β
βββ π exp3/
β βββ π data.csv β Sample Dataset
β βββ π exp3.ipynb β Jupyter Notebook (with outputs)
β βββ π exp3.py β Python Script
β
βββ π exp4/
β βββ π Google_data (2b.c1).csv β Text/CSV Dataset
β βββ π data (2c2).xlsx β Excel Spreadsheet Dataset
β βββ π exp4.ipynb β Jupyter Notebook (with outputs)
β βββ π exp4.py β Python Script
β βββ π processed_text.csv β Exported Processed CSV
β βββ π processed_excel.xlsx β Exported Processed Excel
β
βββ π exp5/
β βββ π iris_dataset(2d).csv β Iris CSV Dataset
β βββ π exp5.ipynb β Jupyter Notebook (with outputs)
β βββ π exp5.py β Python Script
β βββ πΌοΈ histograms.png β Feature Distributions Plot
β βββ πΌοΈ sepal_length_boxplot.png β Sepal Length Boxplot
β βββ πΌοΈ pairplot.png β Feature Pairwise Scatter/KDE Plot
β
βββ π exp6/
β βββ π uci_diabetes.csv β UCI Diabetes Dataset
β βββ π pima_diabetes.csv β Pima Indians Diabetes Dataset
β βββ π exp6.ipynb β Jupyter Notebook (with outputs)
β βββ π exp6.py β Python Script
β
βββ π exp7/
β βββ π uci_diabetes.csv β UCI Diabetes Dataset
β βββ π pima_diabetes.csv β Pima Indians Diabetes Dataset
β βββ π exp7.ipynb β Jupyter Notebook (with outputs)
β βββ π exp7.py β Python Script
β βββ πΌοΈ uci_linear_regression.png β UCI Linear Regression Scatter & Line Plot
β βββ πΌοΈ pima_linear_regression.png β Pima Linear Regression Scatter & Line Plot
β
βββ π README.md
| # | Experiment | Description | Key Libraries |
|---|---|---|---|
| 1 | Environment Setup | Verify installation & versions of essential data science packages | numpy pandas matplotlib jupyter |
| 2 | NumPy Fundamentals | Core array operations β creation, indexing, slicing, math, reshaping | numpy |
| 3 | Pandas Data Analysis | DataFrame manipulation β loading, cleaning, filtering, grouping, exporting | pandas |
| 4 | Data Input/Output Operations | Reading data from CSV, Excel, and Web; missing value treatment; exporting | pandas openpyxl |
| 5 | Descriptive Analytics (Iris) | Exploring statistics, distributions, boxplots, and pairplots on Iris dataset | pandas seaborn matplotlib |
| 6 | Univariate Statistical Analysis | Calculating Mean, Median, Mode, Variance, Std, Skewness, Kurtosis on Diabetes datasets | pandas numpy scipy |
| 7 | Bivariate Analysis (Linear & Logistic Regression) | Linear Regression (Glucose vs BMI) & Logistic Regression (Predicting Diabetes) | pandas numpy scikit-learn matplotlib |
π¬ Experiment 1 β Environment Setup & Package Verification
Verify the installation and versions of all essential data science libraries required for the lab.
| Package | Status | Version |
|---|---|---|
| NumPy | β Installed | 2.2.6 |
| Pandas | β Installed | 2.3.3 |
| Matplotlib | β Installed | 3.10.3 |
| JupyterLab | β Installed | 4.5.1 |
| Seaborn | β Not Installed | β |
| SciPy | β Not Installed | β |
| Plotly | β Not Installed | β |
| Bokeh | β Not Installed | β |
| Statsmodels | β Not Installed | β |
exp1/exp1.ipynbβ Jupyter Notebookexp1/exp1.pyβ Python Script
π¬ Experiment 2 β Fundamentals of NumPy
Learn and demonstrate core NumPy operations for numerical computing.
| Section | Topic | Key Functions |
|---|---|---|
| 1 | Version Verification | np.__version__ |
| 2 | Array Creation | np.array(), np.ones() |
| 3 | Indexing & Slicing | arr[i], arr[start:end], arr[row, col] |
| 4 | Element-wise Operations | +, -, *, /, scalar math |
| 5 | Statistical Aggregations | np.sum(), np.mean(), np.std() |
| 6 | Comparison & Masking | >, boolean indexing, fancy indexing |
| 7 | Reshaping & Structured Arrays | .reshape(), structured dtype |
>>> arr_a = np.array([10, 20, 30])
>>> arr_b = np.array([1, 2, 3])
>>> print("Addition:", arr_a + arr_b)
Addition: [11 22 33]exp2/exp2.ipynbβ Jupyter Notebook (with cell outputs)exp2/exp2.pyβ Python Script
π¬ Experiment 3 β Data Analysis & Manipulation using Pandas
Perform real-world data analysis workflows using Pandas DataFrames.
| Section | Topic | Key Functions |
|---|---|---|
| 1 | Load & Preview | pd.read_csv(), .head(), .tail() |
| 2 | Inspection | .info(), .describe() |
| 3 | Missing Values & Column Ops | .fillna(), column arithmetic |
| 4 | Filtering & Groupby | Boolean conditions, .groupby().mean() |
| 5 | Sorting & Boolean Masking | .sort_values(), .median() masking |
| 6 | Export & Aggregations | .to_csv(), .sum(), .mean(), .std() |
>>> grouped = df.groupby('category_column')['numeric_column'].mean()
>>> print(grouped)
category_column
A 180.0
B 237.5
Name: numeric_column, dtype: float64exp3/exp3.ipynbβ Jupyter Notebook (with cell outputs)exp3/exp3.pyβ Python Scriptexp3/data.csvβ Sample Dataset
π¬ Experiment 4 β Reading Data from Text Files, Excel, and the Web
Read and process data from various sources, including CSV text files, Excel spreadsheets, and web-based URLs using Pandas.
| Section | Topic | Key Functions |
|---|---|---|
| 1 | Read CSV / Text Data | pd.read_csv('Google_data (2b.c1).csv') |
| 2 | Read Excel Data | pd.read_excel('data (2c2).xlsx', sheet_name='Sheet1') |
| 3 | Read Web-Based Data | pd.read_csv('https://raw.githubusercontent.com/...') |
| 4 | Preview Datasets | df.head() |
| 5 | Handle Missing Values | .ffill(), .bfill(), .dropna() |
| 6 | Export Processed Data | .to_csv('processed_text.csv'), .to_excel('processed_excel.xlsx') |
import pandas as pd
text_df = pd.read_csv('Google_data (2b.c1).csv')
excel_df = pd.read_excel('data (2c2).xlsx', sheet_name='Sheet1')
web_df = pd.read_csv('https://raw.githubusercontent.com/cs109/2014_data/master/countries.csv')
print(text_df.head(), "\n", excel_df.head(), "\n", web_df.head())exp4/exp4.ipynbβ Jupyter Notebook (with cell outputs)exp4/exp4.pyβ Python Scriptexp4/Google_data (2b.c1).csvβ CSV Datasetexp4/data (2c2).xlsxβ Excel Datasetexp4/processed_text.csvβ Exported CSV Dataexp4/processed_excel.xlsxβ Exported Excel Data
π¬ Experiment 5 β Exploring Descriptive Analytics Using the Iris Dataset
Perform descriptive analytics, summary statistics, univariate, and bivariate visualizations on the Iris dataset using Pandas, Seaborn, and Matplotlib.
| Section | Topic | Key Functions |
|---|---|---|
| 1 | Dataset Load & Preview | pd.read_csv('iris_dataset(2d).csv') |
| 2 | Basic Info & Statistics | df.info(), df.describe() |
| 3 | Univariate Analysis | df['species'].value_counts() |
| 4 | Distribution Plots | df.hist(figsize=(8, 6), edgecolor='black') |
| 5 | Boxplot Analysis | sns.boxplot(data=df, x='species', y='sepal length (cm)') |
| 6 | Pair Plot Visualizations | sns.pairplot(df, hue='species') |
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
df = pd.read_csv('iris_dataset(2d).csv')
print(df.info())
print(df.describe())
sns.boxplot(data=df, x='species', y='sepal length (cm)')
sns.pairplot(df, hue='species')exp5/exp5.ipynbβ Jupyter Notebook (with cell outputs)exp5/exp5.pyβ Python Scriptexp5/iris_dataset(2d).csvβ Iris Datasetexp5/histograms.pngβ Feature Distribution Plotexp5/sepal_length_boxplot.pngβ Boxplotexp5/pairplot.pngβ Pairwise Plot
π¬ Experiment 6 β Statistical Analysis Using Diabetes Datasets (Univariate Analysis)
Perform univariate statistical analysis on the UCI Diabetes and Pima Indians Diabetes datasets to compute central tendency, dispersion, skewness, and kurtosis.
| Section | Topic | Key Functions / Metrics |
|---|---|---|
| 1 | Import Datasets | pd.read_csv('uci_diabetes.csv'), pd.read_csv('pima_diabetes.csv') |
| 2 | Central Tendency | np.mean(), np.median(), df[col].mode()[0] |
| 3 | Dispersion | np.var(ddof=1), np.std(ddof=1) |
| 4 | Shape & Tail Metrics | scipy.stats.skew(), scipy.stats.kurtosis() |
| 5 | Automated Analysis Pipeline | Custom function univariate_analysis(df, columns) |
import pandas as pd
import numpy as np
from scipy.stats import skew, kurtosis
def univariate_analysis(df, columns):
stats = {}
for col in columns:
stats[col] = {
"Mean": np.mean(df[col]),
"Median": np.median(df[col]),
"Mode": df[col].mode()[0],
"Variance": np.var(df[col], ddof=1),
"Standard Deviation": np.std(df[col], ddof=1),
"Skewness": skew(df[col]),
"Kurtosis": kurtosis(df[col])
}
return pd.DataFrame(stats).Texp6/exp6.ipynbβ Jupyter Notebook (with cell outputs)exp6/exp6.pyβ Python Scriptexp6/uci_diabetes.csvβ UCI Diabetes Datasetexp6/pima_diabetes.csvβ Pima Indians Diabetes Dataset
π¬ Experiment 7 β Bivariate Analysis: Linear and Logistic Regression Modeling
Perform bivariate analysis on the UCI Diabetes Dataset and Pima Indians Diabetes Dataset using Linear Regression (continuous vs. continuous) and Logistic Regression (binary classification of diabetes presence).
| Section | Topic | Key Functions / Metrics |
|---|---|---|
| 1 | Load Datasets | pd.read_csv('uci_diabetes.csv'), pd.read_csv('pima_diabetes.csv') |
| 2 | Linear Regression | LinearRegression(), .fit(), .predict(), r2_score() |
| 3 | Regression Visualizations | plt.scatter(), plt.plot(), regression line plotting |
| 4 | Logistic Regression | train_test_split(), LogisticRegression(), accuracy_score() |
| 5 | Performance Comparison | Evaluating model performance across dataset variations |
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression, LogisticRegression
from sklearn.metrics import r2_score, accuracy_score
# 1. Linear Regression (Glucose vs. BMI)
model_lin = LinearRegression().fit(df[['Glucose']], df['BMI'])
y_pred = model_lin.predict(df[['Glucose']])
print("R2 Score:", r2_score(df['BMI'], y_pred))
# 2. Logistic Regression (Outcome prediction)
X_train, X_test, y_train, y_test = train_test_split(df[['Glucose', 'BloodPressure', 'BMI', 'Age']], df['Outcome'], test_size=0.2, random_state=42)
model_log = LogisticRegression().fit(X_train, y_train)
print("Accuracy Score:", accuracy_score(y_test, model_log.predict(X_test)))exp7/exp7.ipynbβ Jupyter Notebook (with cell outputs & plots)exp7/exp7.pyβ Python Scriptexp7/uci_diabetes.csvβ UCI Diabetes Datasetexp7/pima_diabetes.csvβ Pima Indians Diabetes Datasetexp7/uci_linear_regression.pngβ UCI Scatter Plot & Linear Fitexp7/pima_linear_regression.pngβ Pima Scatter Plot & Linear Fit
# Ensure Python 3.x is installed
python --version
# Install required packages
pip install numpy pandas matplotlib seaborn scipy scikit-learn jupyterlab# Clone the repository
git clone https://github.com/NareeshKannaS/DAV-LAB-EXP.git
cd DAV-LAB-EXP
# Launch Jupyter Lab
jupyter lab# Example: Run Experiment 2
cd exp2
python exp3.py| Technology | Purpose |
|---|---|
| π Python 3.x | Core programming language |
| π’ NumPy | Numerical computing & array operations |
| πΌ Pandas | Data manipulation & analysis |
| π Matplotlib | Data visualization & plotting |
| π Jupyter Lab | Interactive notebook environment |
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β Exp 1 β β Exp 2 β β Exp 3 β
β Environment ββββββΆβ NumPy ββββββΆβ Pandas ββββΆ ...
β Setup β β Fundamentals β β Analysis β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
Note
Each experiment builds upon concepts from the previous one. It is recommended to follow the experiments in order.
Tip
All notebooks include pre-rendered cell outputs so you can review results without running the code.
======= # DAV-LAB-EXP >>>>>>> f4a60fb126ce4a50d61afe94c5995a90c36c8569