1answer.
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
Allisa [31]
3 years ago
10

Write a function called count_types that returns a dictionary with keys that are Pokemon types and values that are the number of

times that type appears in the dataset. The order of the keys in the returned dictionary does not matter. In terms of efficiency, your solution should NOT iterate over the whole dataset once for each type of Pokemon since that would be overly inefficient. For example, assuming we have parsed pokemon_test.csv and stored it in a variable called data:
Computers and Technology
1 answer:
Gnom [1K]3 years ago
6 0

Answer:

Explanation:

The following code is written in Python. It creates a function called count_types which takes in three parameters. The pokemon in question, the data set, and a dictionary with all the pokemon types and values (Empty to start). Then it simply uses the built-in Python count feature to count the number of times that the Pokemon appears in the data set. Finally it saves that pokemon as a key and count as a value to the dictionary.

def count_types(pokemon, data, my_dict):

   count = data.count(pokemon)

   my_dict += {pokemon: count}

You might be interested in
Which of these is an example of an open source software
AURORKA [14]

Answer:

Thunderbird

Explanation:

When we talk about open source software, we are talking about software that is free to download and its source code repository is made available and public to its users. Open source code can be modified and distributed with the users’ rights if they want to. Thunderbird is an example of open source developed by the Mozilla foundation. All known web browsers like Chromium and Safari are open source apart from Internet Explorer. Internet Explorer has remained closed source for a long time now.

6 0
4 years ago
Assume that sentence is a variable of type String that has been assigned a value. Assume furthermore that this value is a String
disa [49]

Answer:

//get the sentence from the user

          Console.WriteLine("Enter your sentence");

           //read the user information

           string ans = Console.ReadLine();

           //check if sentence ends with period

          if(!ans.EndsWith("."))

           {

               Console.WriteLine("Sentence should end with period");

               Environment.Exit(0);

           }

           //declear empty string firstword

           string firstWord = "";

           //split the requested sentence using single space character

          string[] splitans =  ans.Split(' ');

           //assign firstword

           firstWord = splitans[0];

           //print out firstword

          Console.WriteLine(firstWord);

Explanation:

The program uses c#.

5 0
3 years ago
A(n) ________ is a server-based operating system oriented to computer networking and may include directory services, network man
Ganezh [65]

Answer:

Network Operating System (NOS)

Explanation:

A network operating system (NOS) is an operating system that makes different computer devices connect to a common network in order to communicate and share resources with each other using a server. A network operating system can be used by printers, computers, file sever among others, and they are connected together using a local area network. This local area network which they are connected to works as the server.

The NOS also acts as a network security because it could be used as an access control or even user authentication.

There are two types of NOS

1) Peer to peer network operating system.

2) Client/server network operating system

A network operating system (NOS) is a server-based operating system oriented to computer networking and may include directory services, network management, network monitoring, network policies, user group management, network security, and other network-related functions.

4 0
3 years ago
If you want a relatively broad, unbiased overview of a subject you should consult a/an ?
tekilochka [14]

To find a relatively broad unbiased overview of a subject in a specific field of study, it would be best to consult a: encyclopedia.
8 0
3 years ago
Read 2 more answers
Construct a formula in cell D11 to calculate the sales tax amount for transaction 578. Be sure to appropriately reference the tr
Vlada [557]

Answer:

Explanation:

Formulas!D11: =C11*0.0675

4 / 7  (57.1%)

Feedback:

[-2] The formula in cell D11 does not reference the sales tax rate

[-1] The tax rate reference is not absolute

Copy the formula you used in cell D11 down to calculate the sales tax amount for the remaining transactions.

1 / 1  (100.0%)

Feedback:

Construct a formula in cell E11 to calculate the total amount for transaction 578. Be sure to appropriately reference the transaction amount in cell C11 and the sales tax amount in cell D11 so that you can reuse your formula to calculate the total for the remaining transactions.

Formulas!E11: =SUM(C11:D11)

6 / 6  (100.0%)

Feedback:

Copy the formula you used in cell E11 down to calculate the total for the remaining transactions.

2 / 2  (100.0%)

Feedback:

Use the SUM function to calculate the “Grand Total” in for all transactions in cell E24.

Formulas!E24: =SUM(E11:E23)

4 / 4  (100.0%)

7 0
3 years ago
Other questions:
  • To prevent injury when pulling a nail be sure the material holding the nail is
    14·1 answer
  • Which is not a key factor a programmer uses in selecting the language for a project?
    9·1 answer
  • You store sensitive data on your computer and need to restrict access to this data by others who use your computer. What will yo
    15·1 answer
  • A radiologist’s computer monitor has higher resolution than most computer screens. Resolution refers to the:______
    15·1 answer
  • ASAP ε=ε=ᕕ(°□°)ᕗ<br> Sorry if you can't see it but please help me if you can!
    6·1 answer
  • Completed the given flowchart using the algorithm steps which is given in wrong order. 1.Input time 2.Stop 3.Print "Good morning
    8·1 answer
  • Please help ASAP, will mark brainliest!
    7·1 answer
  • what are the three parts to physical security standards for various types of army equipment and the risk level
    15·1 answer
  • Please answer it’s timed
    14·1 answer
  • which one of the following would not normally be found in an organization's information security policy?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!