#Write a function called clean_data. clean_data takes one #parameter, a dictionary. The dictionary represents the #observed...

#Write a function called clean_data. clean_data takes one
#parameter, a dictionary. The dictionary represents the
#observed rainfall in inches on a particular calendar day
#at a particular location. However, the data has some
#errors.
#
#clean_data should delete any key-value pair where the value
#has any of the following issues:
#
# - the type is not an integer or a float. Even if the value
# is a string that could be converted to an integer (e.g.
# "5") it should be deleted.
# - the value is less than 0: it's impossible to have a
# negative rainfall number, so this must be bad data.
# - the value is greater than 100: the world record for
# rainfall in a day was 71.8 inches
#
#Return the dictionary when you're done making your changes.
#
#Remember, the keyword del deletes items from lists
#and dictionaries. For example, to remove the key "key!" from
#the dictionary my_dict, you would write: del my_dict["key!"]
#Or, if the key was the variable my_key, you would write:
#del my_dict[my_key]
#
#Hint: If you try to delete items from the dictionary while
#looping through the dictionary, you'll run into problems!
#We should never change the number if items in a list or
#dictionary while looping through those items. Think about
#what you could do to keep track of which keys should be
#deleted so you can delete them after the loop is done.
#
#Hint 2: To check if a variable is an integer, use
#type(the_variable) == int. To check if a variable is a float,
#use type(the_variable) == float.


#Write your function here!

#Below are some lines of code that will test your function.
#You can change the value of the variable(s) to test your
#function with different inputs.
#
#If your function works correctly, this will originally
#print (although the order of the keys may vary):
#{"20190101": 5, "20190103": 7.5, "20190104": 0, "20190107": 1}
rainfall = {"20190101": 5, "20190102": "6", "20190103": 7.5,
"20190104": 0, "20190105": -7, "20190106": 102,
"20190107": 1}
print(clean_data(rainfall))

In: Computer Science

A company uses codes to represent its products, for example ABC2475A5R-14. Valid codes must have: At...

A company uses codes to represent its products, for example ABC2475A5R-14. Valid codes must have:

  • At least 10 characters (some codes have more than 10 characters)

  • Positions 4 through 7 must be digits (and represents the country in which the product will be sold)

  • The character in the 10th position must be a capital letter and represents the security level of the product.

Write a Python program that will read 10 product codes from a text file (Codes.txt - attached below). Determine if each conforms to the rules listed above:

If it does conform, print a heading: Valid Code(s) are: and list the codes that are valid. If it does not conform, print a heading: Invalid Code(s) are: and list the codes that area invalid. Be sure to test all possible combinations.

Further, if the code is valid, due to new government security laws, products with a security level of R (restricted) are no longer to be sold in countries with a country code of 2000 or higher. Output a heading: Invalid Restricted Code(s) are: and list the codes that are invalid in case you encounter any products that violate these new laws.

here is the text file data

XYZ2755R-14
RST1234A6A-12
UVW24a6R7R-13
PQR3999F85-11
STI1281J9A-04
FOR2561T4R-54
BID2075U3R-55
AGA1475P1B01
JBT2175E5X-04
KAM1145X2R-05

In: Computer Science

Most proteins in the axon of a neuron are synthesized in the cell body. Use equations...

Most proteins in the axon of a neuron are synthesized in the cell body. Use equations to show the need for active transport mechanisms in a neuron.

In: Biology

Submit a minimum of 200-word answer for each of the following questions : Imagine you are...

Submit a minimum of 200-word answer for each of the following questions :

Imagine you are starting the firm with your Team and you are all college seniors with limited work experience (as probably some of you are!). You may not have impressive credentials to include in the management team section of your business plan.

  1. How can you construct this section of your plan, and the company itself, in a way that reassures the readers of the plan that you know what you’re doing and will get the advice you need to launch a successful company.
  2. Please discuss with your Team your answer and agree on what to do for your final plan.
    • Please summarize your discussion and final recommendation.

In: Accounting

Bond has following charaateristics: par value €1000, 5,5%coupon rate, paid annually and 15 years to maturity....

Bond has following charaateristics: par value €1000, 5,5%coupon rate, paid annually and 15 years to maturity. YTM is 6.5%

A) Find Macaulay duration of that bond (Dmac)

B) Find modified duration of that bond (Dmod)

In: Finance

CRM (Customer Relationship management) What is Sentiment Analysis? What are expert systems? Tree terms Fuzzy Logic,...

CRM (Customer Relationship management)

What is Sentiment Analysis?
What are expert systems?
Tree terms Fuzzy Logic, genetic algorithms and neural networks?

In: Computer Science

Assume you wanted to end up with 38.0 g of copper from the reaction below. What...

Assume you wanted to end up with 38.0 g of copper from the reaction below. What mass of copper (II) sulfate would be required?

Fe + CuSO4-------> Cu + FeSO4

In: Chemistry

What were the similarities and differences between the economies of the British and French colonies in...

What were the similarities and differences between the economies of the British and French colonies in the Caribbean and North America? What role did the various colonies play in the transatlantic economy? Must be a minimum of 150 words.

In: Economics

Data Table 1. Butane. Question Answer Are the models isomers? Bond angles and molecular geometry Describe...

Data Table 1. Butane.

Question

Answer

Are the models isomers?

Bond angles and molecular geometry

Describe the experience trying to rotate a double bond

Bond angles and molecular geometry of the 2 center carbon atoms of cis-2-butene

Is it possible to convert between cis-2-butene and trans-2-butene without breaking bonds?

Why are cis-2-butene and trans-2-butene referred to as geometric isomers?

Define the term structural isomer and explain how it differs from a geometric isomer.

In: Chemistry

You are working for a major U.S. corporation that wants to expand its reach globally and...

You are working for a major U.S. corporation that wants to expand its reach globally and has narrowed the search down to either Mexico or Japan. Your supervisor has asked you to prepare a memo that analyzes potential compliance issues with respect to aspects of law and ethics that are specific to one of the two countries. You will choose to prepare your memo for either Mexico or Japan and address the critical elements below. This will help inform the final executive decision.

I. What pertinent aspects of U.S. law should the company be aware of in its goal to do business internationally?

II. Assess the legal implications of moving business abroad specific to your chosen country. What are the advantages and disadvantages?

III. What are the ethical implications involved in this business decision?

IV. Explain how other domestic companies have managed to comply with the U.S. laws related to this business decision in the past. How did these companies address potential compliance issues?

This would be for Japan, I find lots of answers for Mexico. Thank You

In: Accounting

Directions: Write the value and uncertainty in the proper “presentation format”. (1) Round off uncertainty to...

Directions: Write the value and uncertainty in the proper “presentation format”. (1) Round off uncertainty to two (2) significant figures (2) Round off value to same decimal place as last significant digit in uncertainty (3) When using scientific notation, make sure value and uncertainty are expressed to same power of ten, with decimal point placed after first digit in the value. Example: (5.423 ± 0.034) x 10-5 (4) Hint: If your value is greater than 10,000 or less than 0.01 you must use scientific notation. Note on Grading: This sheet must be done perfectly to receive an 8/10. If this second version is not done perfectly, then you will be given a new version, and if that one is completed perfectly then you will receive a 7/10. You will continue to lose points until this sheet is completed perfectly. See lab manual for details on presentation format.

# Value Uncertainty    Presentation Format (Value ± Uncertainty)

1 7.286277704 0.035965099

2 1.681735783 0.005686618

3 61.3568665 0.981143685

4 2690973.876 48907.07815

5 1.75447E-06 1.87125E-07

6 6.165959668 0.320999526

7 0.000861333 1.32518E-05

8 1.05259E-05 1.66169E-07

9 0.002142297 5.56807E-05

10 1.41859E-06 3.87179E-08

In: Physics

A 35.00 mL solution of 0.25M HF is titrated with a standardized 0.1316M solution of NaOH...

A 35.00 mL solution of 0.25M HF is titrated with a standardized 0.1316M solution of NaOH at 25C.

a.What is the PH of the HF solution before titrant is added?

b.How many milliliters of titrant are required to reach the equivalence point?

c.What is the PH at 0.5ml before the equivalence point?

d.What is the PH at the equivalence point?

e.What is the PH at 0.5 ml after the equivalence point?

In: Chemistry

1.The following is a chart of 25 baseball players' salaries and statistics from 2016. Player Name...

1.The following is a chart of 25 baseball players' salaries and statistics from 2016.

Player Name RBI's HR's AVG Salary (in millions)
Rajai Davis 48 12 0.249 5.950
Chris Iannetta 24 7 0.210 4.550
Yoenis Cespedes 86 31 0.284 27.500
Ben Zobrist 76 18 0.272 10.500
Ryan Braun 91 31 0.305 20.000
Mark Teixeira 44 15 0.204 23.125
Joe Mauer 49 11 0.261 23.000
Miquel Cabrera 108 38 0.316 28.050
Brian McCann 58 20 0.242 17.000
Matt Kemp 108 35 0.268 21.500
Evan Gattis 72 32 0.251 3.300
Albert Pujols 119 31 0.268 25.000
Curtis Granderson 59 30 0.237 16.000
Logan Forsythe 52 20 0.264 2.750
Shin-Soo Choo 17 7 0.242 20.000
J.D. Martinez 68 22 0.307 6.750
Denard Span 53 11 0.266 5.000
Justin Upton 87 31 0.246 22.125
Hunter Pence 57 13 0.289 18.500
Hanley Ramirez 111 30 0.286 22.750
Adam Jones 83 29 0.265 16.000
David Ortiz 127 38 0.315 16.000
Prince Fielder 44 8 0.212 18.000
Joey Votto 97 29 0.326 20.000
Robinson Cano 103 39 0.298 24.050



In order to have correlation with 95% confidence (5% significance), what is the critical r-value that we would like to have?  

(Round to three decimal places for all answers on this assignment.)

RBI vs. Salary

Complete a correlation analysis, using RBI's as the x-value and salary as the y-value.

Correlation coefficient:

Regression Equation: y=

Do you have significant correlation? Select an answer Yes No

HR vs. Salary

Complete a correlation analysis, using HR's as the x-value and salary as the y-value.

Correlation coefficient:

Regression Equation: y=

Do you have significant correlation? Select an answer Yes No   

AVG vs. Salary

Complete a correlation analysis, using AVG as the x-value and salary as the y-value.

Correlation coefficient:   

Regression Equation: y=   

Do you have significant correlation? Select an answer Yes No

Prediction

Based on your analysis, if you had to predict a player's salary, which method would be the best? Select an answer Regression equation with RBI's Regression equation with HR's Regression equation with AVG The average of the 25 salaries

Using that method, predict the salary for Matt Wieters. His stats were:

RBI: 66

HR: 17

AVG: 0.243

Based on your analysis, his predicted salary would be: $ million  

His actual salary was $15.800 million.

2.

The following is data for the first and second Quiz scores for 8 students in a class.

First Quiz Second Quiz
10 10
17 13
18 19
30 24
33 31
35 35
38 38
43 38

Predict the value of the second quiz score if a student had a score of 14 on the first test. _

In: Math

C++ •Write a program that evaluates a postfix expression (assume it’s valid) such as 6 2...

C++

•Write a program that evaluates a postfix expression (assume it’s valid) such as

6 2 + 5 * 8 4 / -

•The program should read a postfix expression consisting of digits and operators into a string.

•The algorithm is as follows:

1.While you have not reached the end of the string, read the expression from left to right.

–If the current character is a digit, Push its integer value onto the stack (the integer value of a digit character is its value in the computer’s character set minus the value of '0' in the computer’s character set).

–Otherwise, if the current character is an operator, Pop the two top elements of the stack into variables x and y.

–Calculate y operator x.

Push the result of the calculation onto the stack.

2.When you reach the end of the string, pop the top value of the stack. This is the result of the postfix expression.

[Example: In Step 2 above, if the operator is '/', the top of the stack is 2 and the next element in the stack is 8, then pop 2 into x, pop 8 into y, evaluate 8 / 2 and push the result, 4, back onto the stack. This note also applies to operator '–'.]

–The arithmetic operations allowed in an expression are

+ addition

– subtraction

* multiplication

/ division

^ exponentiation

% modulus

•[Note: We assume left-to-right associativity for all operators for the purpose of this exercise.] The stack should be maintained with stack nodes that contain an int data member and a pointer to the next stack node. You may want to provide the following functional capabilities:

a.function evaluatePostfixExpression that evaluates the postfix expression

b.function calculate that evaluates the expression (op1 operator op2)

c.function push that pushes a value onto the stack

d.function pop that pops a value off the stack

e.function isEmpty that determines if the stack is empty

f.function printStack that prints the stack

SAMPLE OUTPUT:

INPUT POSTFIX NOTATION: 23+2*

INFIX NOTATION: (2+3)*2

RESULT: 10

In: Computer Science

Given the time series sales data for years 2018 (quarter 1 to 4), 2019 (quarters 5...

Given the time series sales data for years 2018 (quarter 1 to 4), 2019 (quarters 5 to 8) as reported in the table below, forecast sales in quarters 9 to 12 of 2020. (20)

Quarters

Sales

Trend

Seasonal Factor

Average seasonal factor

Forecasted Sales

1

750

703.33

?

?

2

680

737.02

?

?

3

720

770.71

?

?

4

900

804.4

?

?

5

890

838.09

?

6

800

871.78

?

7

780

905.47

?

8

1050

939.16

?

9

?

?

10

?

?

11

?

?

12

?

?

The interpolation of historical data is

In: Operations Management