answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vikentia [17]
1 year ago
11

For this lab, imagine you are an IT Specialist at a medium-sized company. The Human Resources Department at your company wants y

ou to find out how many people are in each department. You need to write a Python script that reads a CSV file containing a list of the employees in the organization, counts how many people are in each department, and then generates a report using this information. The output of this script will be a plain text file.
Computers and Technology
1 answer:
natta225 [31]1 year ago
3 0

Answer:

import csv

import sys

file_csv = argv

with open( "file_csv", "rb" ) as file:

      rowlist= csv.DictReader( file )

      dict_count={ }

      for row in rowlist:

           dict_count[ row[ 'department' ] ] = dict_count.get( row[ 'department' ], 0 ) + 1

      print( " The count of employees per department are", dict_count )

Explanation:

The python script in the solution above is able to accept user input csv files via command prompt and get an output of the number of employees for each department.

You might be interested in
Carrie works on a help desk and is assigned a ticket that was automatically generated by a server because of an error. The error
OverLord2011 [107]

I would honestly say that there are a few available tools that Carrie can use, but the best tool is the inbuilt Windows Powershell. As Powershell continues to extend its purpose and usefulness, Microsoft, on the other hand, continues to use Powershell's capability to develop more cmdlets for products like Windows Servers. Everything that can be done in a GUI environment can be done in Powershell. Carrie should be able to use Powershell to run things more efficiently from the command line without stepping a foot on the physical server. She will only need to access the server from her desk remotely, run a few commands, and that is it. Powershell command line is so powerful; it carries with it every troubleshooting pack that you can think about.

5 0
1 year ago
How to code 2.9.5: Four colored triangles {Code HS}
Nitella [24]

Answer: penup()

backward(100)

for i in range(4):

pensize(5)

pendown()

left(60)

color("green")

forward(50)

right(120)

color("blue")

forward(50)

color("red")

right(120)

forward(50)

penup()

left(180)

forward(50)

Explanation:

L

6 0
2 years ago
Assume that machines A and B are on the same network 10.3.2.0/24. Machine A sends out spoofed packets, and Machine B tries to sn
Zanzabum

Answer:

Explanation:

Assuming the spoofed 1.2.3.4, it will be sent out ARP to a router that is alive and get it MAC. Then the spoofed packet will be able to be sent out. If A spoofed 10.0.2.30, because it is a local address, it will send an ARP to the machine for been able to get the MAC. But, the IP address 10.0.2.30 is not original making it to be fake, so it will not replay to A, for this reason the spoofed packet cannot be sent out.

7 0
2 years ago
Light travels at 3 × 108 meters per second. A light-year is the distance a light beam travels in one year.Write a PYTHON program
Art [367]

Answer: This is a python code

def lightyear():

   rate=3*100000000   //speed of light

   seconds=365*24*60*60   //number of seconds in 1 year

   return str((rate*seconds)/1000)+" km"    //distance=speed x time

print(lightyear()) //will print value of light hear in kilometers

OUTPUT :

9460800000000.0 km

Explanation:

In the above code, there is a variable rate, which stores the speed of light, i.e. distance traveled by light in 1 second which is in meters. Another variable is seconds, which store the number of seconds in 1 year, which is no of days in 1 year multiplied by the number of hours in a day multiplied by the number of minutes in an hour multiplied by the number of seconds in a minute. Finally, distance is speed multiplied by time, so distance is printed in kilometers and to convert distance in kilometers it is divided by 1000.

4 0
1 year ago
You would use the _______ conditional formatting options when analyzing a worksheet in which you want to highlight the highest o
nirvana33 [79]

Answer:

Top/bottom conditional formatting

Explanation:

The top/bottom conditional formatting automatically carries out the task of finding the highest, lowest and even average values.

Conditional formatting formatting gives one the opportunity to enhance reports and dashboards as they work on excel.

You use the too/bottom formatting to highlight cells whose values of highest in a dataset and lowest in a dataset

4 0
1 year ago
Other questions:
  • PLEASE HELP!! WILL GIVE BRAINLIEST!!
    15·2 answers
  • Edward has started up a new company with his friend, Matthew. Currently, he has only two people working with him. Which type of
    8·1 answer
  • You have installed a point-to-point connection using wireless bridges and Omni directional antennas between two buildings. The t
    9·1 answer
  • In a real-world environment, changing granularity requirements might dictate changes in primary key selection, and those changes
    15·1 answer
  • Return 1 if ptr points to an element within the specified intArray, 0 otherwise.
    7·1 answer
  • Describe a strategy for avoiding nested conditionals. Give your own example of a nested conditional that can be modified to beco
    15·1 answer
  • Write a method named removeDuplicates that accepts a string parameter and returns a new string with all consecutive occurrences
    7·1 answer
  • Computers represent color by combining the sub-colors red, green, and blue (rgb). Each sub-color's value can range from 0 to 255
    5·1 answer
  • If Maya wants to access a view that would control multiple slides within a presentation, which view should she utilize? Master v
    9·1 answer
  • Write a method called printRangeOfNumbers that accepts a minimum, maximum numbers as parameters and prints each number from mini
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!