forked from GhadgeGauri/HactoberFest23
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalysis.py
More file actions
26 lines (21 loc) · 656 Bytes
/
Copy pathanalysis.py
File metadata and controls
26 lines (21 loc) · 656 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Import necessary libraries
import pandas as pd
import matplotlib.pyplot as plt
# Load the data from CSV file
data = pd.read_csv("data.csv")
# Display the first few rows of the dataset
print("First few rows of the dataset:\n", data.head())
# Basic statistics
print("\nSummary statistics:\n", data.describe())
# Plotting a histogram for Age
data['Age'].plot(kind='hist', bins=20, edgecolor='black')
plt.title('Distribution of Age')
plt.xlabel('Age')
plt.ylabel('Frequency')
plt.show()
# Scatter plot of Age vs Salary
plt.scatter(data['Age'], data['Salary'])
plt.title('Scatter plot of Age vs Salary')
plt.xlabel('Age')
plt.ylabel('Salary')
plt.show()