-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNumpyFunction2.py
More file actions
40 lines (31 loc) · 1.49 KB
/
NumpyFunction2.py
File metadata and controls
40 lines (31 loc) · 1.49 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
""".Suppose you have two sets of employee data—one containing information
about full-time employees and another containing information about part-time
employees. You want to combine this data to create a
comprehensive employee dataset for HR analysis. """
import numpy as np
# Employee data for full-time employees
full_time_employees = np.array([
[101, 'John Doe', 'Full-Time', 55000],
[102, 'Jane Smith', 'Full-Time', 60000],
[103, 'Mike Johnson', 'Full-Time', 52000]
])
# Employee data for part-time employees
part_time_employees = np.array([
[201, 'Alice Brown', 'Part-Time', 25000],
[202, 'Bob Wilson', 'Part-Time', 28000],
[203, 'Emily Davis', 'Part-Time', 22000]
])
# Combine the two datasets
combined_employees = np.concatenate((full_time_employees, part_time_employees), axis=0)
# Display the combined dataset
print("Combined Employee Dataset:")
for employee in combined_employees:
print(f"Employee ID: {employee[0]}, Name: {employee[1]}, Type: {employee[2]}, Salary: {employee[3]}")
"""Output:-
Combined Employee Dataset:
Employee ID: 101, Name: John Doe, Type: Full-Time, Salary: 55000
Employee ID: 102, Name: Jane Smith, Type: Full-Time, Salary: 60000
Employee ID: 103, Name: Mike Johnson, Type: Full-Time, Salary: 52000
Employee ID: 201, Name: Alice Brown, Type: Part-Time, Salary: 25000
Employee ID: 202, Name: Bob Wilson, Type: Part-Time, Salary: 28000
Employee ID: 203, Name: Emily Davis, Type: Part-Time, Salary: 22000 """