Employee Data Analysis System
Employee Data Analysis System
The user interface interactions primarily include a menu-driven system where users select from options to perform operations such as reading a CSV file, displaying records, filtering by gender, searching, adding, deleting, modifying records, visualizing data through graphs, and saving the dataset. The 'input' function gathers necessary information from the user, illustrating a basic yet essential interactive element for data manipulation .
To maintain data integrity, the system automatically updates and rearranges the index values of the dataframe whenever records are added or deleted. This ensures that each record has a consistent index value and that the overall dataset remains ordered and free of gaps in index numbering .
The system allows modification of employee records by prompting the user to enter the employee number of the record they wish to modify. It then retrieves the index value of this record. If the record is found, the system enables the user to input new values for the employee's name, department, salary, and gender, updating the record accordingly at the identified index .
The system saves modified data by using the pandas 'to_csv' function. It writes the current data of the dataframe to an 'emp.csv' file and sets the 'index' parameter to False to exclude index values from the output file, ensuring that only the data content is saved .
The system filters and displays gender-specific data by selecting records where the gender column matches 'F' for female employees. It then outputs the names of those female employees, allowing for focused analysis of gender-specific data within the dataset .
To add a new employee record, the system requires inputs for employee number, name, department, salary, and gender from the user. It appends this new record as a dictionary to the existing dataframe, using the 'ignore_index' parameter set to True to ensure a unique index for the new record .
The system offers basic visualization options limited to line and bar graphs, which may not adequately convey complex data insights such as employee demographics or performance metrics over time. The absence of other visualization types, like pie charts or histograms, might limit deeper analysis of categorical variables or distribution patterns in salary data .
The system checks the presence of a record by its employee number before deletion. If the record is not found, it outputs 'record not found'; otherwise, it deletes the record. After successful deletion, it rearranges the indices of the remaining records to ensure data integrity .
The system prompts the user to input an employee number to search for an associated record. It then uses the employee number to find the index of this record within the dataset. If no matching index is found, the system outputs 'record not found'; otherwise, it displays the employee's record details .
The system offers two methods for visual representing salary data: a line graph, which plots salary against employee number, and a bar graph, which displays salary against employee names. In both cases, the graphs display salary as a function of another variable, helping to visualize trends and comparisons in the employee dataset .