0% found this document useful (0 votes)
6 views2 pages

Practical File Data Analysis Tasks

The document outlines practical file questions with a submission deadline of April 28, 2025, and includes a retest on the same date. It contains tasks related to data manipulation and analysis using Pandas and NumPy, including grouping, aggregating, filtering, and visualizing data. Additionally, it involves working with the Iris dataset and creating various plots and time series data.

Uploaded by

brpsriya2908
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Practical File Data Analysis Tasks

The document outlines practical file questions with a submission deadline of April 28, 2025, and includes a retest on the same date. It contains tasks related to data manipulation and analysis using Pandas and NumPy, including grouping, aggregating, filtering, and visualizing data. Additionally, it involves working with the Iris dataset and creating various plots and time series data.

Uploaded by

brpsriya2908
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Practical File Questions

Last date of submission: 28th April,2025 (Not to be extended further)

A retest will be also held on 28th April, 2025

Reference data below first to be made into csv file and then question needed to be done.

Department Gender Experience Salary


H.R. M 1 300006
Finance F 20000
H.R. M 5
Marketing F 6 350000
H.R. M 4 30000
Finance M 2 200000
H.R. F 8
Marketing F 9 350000

Q-1) (A) Group the data by department and find average salary in each department.

(B) Group the data by gender and find the total salary for each gender.

(C) Group by both department and gender and find the maximum salary in each group.

Q-2) Use .agg() method to calculate following for each department:-

(A) Mean salary


(B) Maximum salary
(C) Minimum Experience

Q-3) Filter and display only those departments where average salary is greater than 60000.

Q-4) Use the .tranform() to create a new column that shows each employee’s salary as a
percentage of their department’s average salary.

Q-5) Use .apply() function to find standard deviation of experience within each department.

Q-6)Dataset: Iris (from sklearn or UCI)

Task:

(A) Load the dataset into a Pandas DataFrame.


(B) Compute mean, median, mode, standard deviation, and variance.

Q-7) Create a 2D NumPy array of shape 4x5 with random integers.


(A) Perform slicing, reshaping, and transposing.
(B)Apply functions: [Link], [Link], [Link], [Link] along both axes.
(C) Identify and count missing values.
(D) Drop duplicate rows and fill missing values appropriately.
(E) Apply melt() and pivot() to reshape data.
Q-8)Create
(A) line plots, bar charts, histograms, and scatter plots.
(B)Customize plots with titles, labels, legends, and styles.
Q-9) Write code for below:
(A)Create a time series DataFrame of daily random data (e.g., temperature).
(B)Resample data to monthly average and plot it.

Common questions

Powered by AI

Array manipulation techniques like slicing, reshaping, and transposing offer the ability to customize and reorganize data for more efficient analysis. Slicing allows specific data selection, reshaping changes array layout to fit analytical needs, and transposing flips dimensionality for orientation needs—all of which are essential for matrix operations, preparing data for machine learning models, or ensuring compatibility with certain data schemas .

Handling missing and duplicate data is paramount in maintaining data integrity and reliability. Techniques like filling missing values through imputation or removing duplicates ensure that results from subsequent analyses are reflective of true phenomena and not artifacts of incomplete data. However, care must be taken as improper handling can introduce bias, such as by skewing averages if missing income data are filled disproportionately .

Different plot types serve distinct purposes in data storytelling: line plots show trends over time, bar charts display categorical comparisons, histograms reveal distribution shapes, and scatter plots depict relationships and correlations. Utilizing a variety of these visualization tools allows data to be presented in the most insightful manner matching the audience's cognitive framework, enhancing comprehension and retention of key insights presented .

The apply() function permits custom function application across data frames, like computing the standard deviation of experience within departments. This helps ascertain the variability in employee tenure, which is indicative of workforce stability or turnover. High variability might signal retention challenges or a diverse mix of veteran and newer employees, impacting training expenditure, team coherence, and institutional knowledge retention .

Central tendencies like mean, median, and mode provide the dataset's core location; mean offers the average, median splits the dataset into halves, and mode indicates the most frequently occurring values. Variability metrics like standard deviation and variance offer insights into spread and diversity of the data around these central points. Together, these statistics help construct a meaningful narrative of dataset structure, variation, and predictability, essential for deeper analytical exercises .

Aggregation functions like mean, sum, and max allow a concise summary of how salary is distributed across different segments in the dataset. By grouping data by department (such as calculating average salaries per department or finding maximum salaries per gender within departments), it is possible to uncover trends, such as which department has the highest average salary or how the salaries differ between genders within the same departments. These insights can influence decision-making around budgeting, hiring, or evaluating salary fairness .

Resampling in time series data, especially the transformation from daily to monthly averages, smooths out short-term fluctuations and highlights longer-term trends, facilitating clearer insight into overarching patterns. This can recalibrate focus from daily anomalies to seasonal trends, aiding in making more robust forecasts or resource allocations responsive to time-based patterns .

Filtering departments by average salary, for example, identifying departments where the average salary exceeds 60000, allows firms to pinpoint areas of high compensation which may reflect either a higher level of expertise or competitive hiring among other factors. This insight can support strategic decisions regarding budget allocation or hiring strategies. However, it may overlook other valuable factors such as employee satisfaction, retention rates, or the value derived from roles not reflected by salary alone, thus limiting the context provided by such financial data .

The .agg() method is versatile in applying multiple aggregation functions across data groups. By calculating the mean and maximum salary and minimal experience within each department, management can assess not only financial aspects like cost or salary competitiveness but also operational metrics like average tenure. This blend of financial and experiential data helps in understanding both the economic and employee experience dynamics across departments .

The transform() function enables the application of operations to each element of a group separately, such as computing each employee's salary as a percentage of the department's average salary. This allows for a direct, internally benchmarked evaluation of individual compensation against departmental norms, offering insights into equity and disparities within pay structures that could otherwise go unnoticed in a straightforward listing or group-based aggregation .

You might also like