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
Assign max_sum with the greater of num_a and num_b, PLUS the greater of num_y and num_z. Use just one statement. Hint: Call find
Gnoma [55]

Answer:

def find_max(num_1, num_2):

   max_val = 0.0

   if (num_1 > num_2): # if num1 is greater than num2,

       max_val = num_1 # then num1 is the maxVal.

   else: # Otherwise,

       max_val = num_2 # num2 is the maxVal

   return max_val

max_sum = 0.0

num_a = float(input())

num_b = float(input())

num_y = float(input())

num_z = float(input())

max_sum = find_max(num_a, num_b) + find_max(num_y, num_z)

print('max_sum is:', max_sum)

Explanation:

I added the missing part. Also, you forgot the put parentheses. I highlighted all.

To find the max_sum, you need to call the find_max twice and sum the result of these. In the first call, use the parameters num_a and num_b (This will give you greater among them). In the second call, use the parameters num_y and num_z (This will again give you greater among them)

5 0
1 year ago
Write code that uses the input string stream inss to read input data from string userinput, and updates variables usermonth, use
mr Goodwill [35]

Answer:

It will be a java code.

Explanation:

import java.util.Scanner;

public class StringInputStream {

    public static void main (String [] args) {

        Scanner inSS = null;

        String userInput = "Jan 12 1992";

        inSS = new Scanner(userInput);`

        String userMonth = "";

        int userDate = 0;

        int userYear = 0;

        /* Your solution goes here  */

        System.out.println("Month: " + userMonth);

        System.out.println("Date: " + userDate);

        System.out.println("Year: " + userYear);

        return;

   }

}

3 0
2 years ago
Read 2 more answers
You buy a $3,500 car and finance it through the car dealer. the contract says if you are two months delinquent with your payment
photoshop1234 [79]
The car owner acquired his car because the car dealer offers him a financing credit services. It is part of the contract that the car owner should pay in monthly basis. It is a fact and part of the contract also that once the car owner failed to pay 2 months of his contribution, the car dealer will get his car back.
6 0
2 years ago
based on the transcript, what did broadcasting the story through the medium of radio allow welles to do?
tamaranim1 [39]

Answer:

It was Halloween morning, in 1938, Orson Welles opened his eyes just to discover himself as the most trending person in the USA. Just the past night, Welles together with his Mercury Theatre performed the radio adaption of the Wars of the Worlds, written by H.G. Wells. He transformed around 40 years old novel into the false news edition which broadcasted the news of Martian attack on New Jersey.

Explanation:

It was Halloween morning, in 1938, Orson Welles opened his eyes just to discover himself as the most trending person in the USA. Just the past night, Welles together with his Mercury Theater performed the radio adaption of the Wars of the Worlds, written by H.G. Wells. He transformed around 40 years old novel into the false news edition which broadcasted the news of Martian attack on New Jersey. Just previously it was Halloween night, and hence, this was expected. And various listeners of the show were shocked, and they made a lot of crazy calls to the nearby Police Stations, as well as the newspaper publication houses. The radio stations tried to convince various journalists that the radio episode was able to cause hysteria throughout the USA. And by the very next dawn, the front column of each new newspaper from coast to coast together with the headlines related to the huge panic inspired allegedly by the CBS broadcast.

8 0
1 year ago
The class Date has a single constructor that accepts the integer value: a month- (1 for January through 12 for December), a day
vaieri [72.5K]

Answer:

public class Date{

Public Date(int month,int day,int year){

}

}

void main(){

Date datep=new Date(3,12,2006);

}

Explanation:

Here we declared a class "Date" and defined one public constructor which will take month,day and year. In main we created an object to that Date class by invoking this parameterized constructor and assigned that object to "dateap" Date variable

8 0
2 years ago
Other questions:
  • What helps companies and organizations to target masses of people, provide 24/7 services, and deliver better marketing in a chea
    13·2 answers
  • The tuna marketers' task in the "tunathewonderfish.com" website and related campaign was to ________.
    15·1 answer
  • Following are groups of three​ phrases, which group states three ways to improve your​ concentration?
    13·1 answer
  • Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation
    6·1 answer
  • Write a program to determine all pairs of positive integers, (a, b), such that a < b < 1000 and [a2 + b2 + 1)/(ab) is an i
    13·1 answer
  • PYTHON QUESTION
    15·1 answer
  • Are bpos safe for organisations ? State your views on it
    8·1 answer
  • Through which of the devices listed are we able to connect to wireless networks? Check all that apply.
    14·1 answer
  • Amanda a recently moved into a new home. Everyone has their own tablet, and wants to connect to the same network, no matter wher
    12·1 answer
  • Suspicious activity, like IP addresses or ports being scanned sequentially, is a sign of which type of attack?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!