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
Semmy [17]
4 years ago
14

Write a function named "read_prices" that takes one parameter that is a list of ticker symbols that your company owns in their p

ortfolio. You are to read a CSV file for each of these tickers which contains the price of each stock throughout the year and return these prices in a single dictionary. The returned dictionary will contain ticker symbols as keys and dictionaries as values where the inner dictionaries will have dates as keys (as strings in the format "YYYY-MM-DD") and prices as values as floats. All said this dictionary will contain the price for any stock on any date over the past year
Engineering
1 answer:
ohaa [14]4 years ago
7 0

Answer:

import pandas pd

def read_prices(tickers):

price_dict = {}

# Read ingthe ticker data for all the tickers

for ticker in tickers:

# Read data for one ticker using pandas.read_csv  

# We assume no column names in csv file

ticker_data = pd.read_csv("./" + ticker + ".csv", names=['date', 'price', 'volume'])

# ticker_data is now a panda data frame

# Creating dictionary

# for the ticker

price_dict[ticker] = {}

for i in range(len(ticker_data)):

# Use pandas.iloc  to access data

date = ticker_data.iloc[i]['date']

price = ticker_data.iloc[i]['price']

price_dict[ticker][date] = price

return price_dict  

You might be interested in
Consider three charged sheets, A, B, and C. The sheets are parallel with A above B above C. On each sheet there is surface charg
babunello [35]

Answer:

0.

Explanation:

To find the electrical force per unit area on each sheet we start defining our variables,

\sigma_A = -4.10^{-5}C/m^2

\sigma_B= -7.10^{-5}C/m^2

\sigma_C = -3.1^{-5}C/m^2

We find the electric field for each one, this formula is given by,

E= \frac{\sigma_i}{2\epsilon_0}

Substituting each value from the three charged sheets, we have

E_A= \frac{-4.10^{-5}C/m^2}{2\epsilon_0}(\hat{j})

E_B= \frac{-7.10^{-5}C/m^2}{2\epsilon_0}(-\hat{j})

E_C= \frac{-3.1^{-5}C/m^2}{2\epsilon_0}(\hat{j})

The electric field is

E_{NET}= E_A+E_B+E_C

E_{NET}=\frac{-4.10^{-5}C/m^2}{2\epsilon_0}(\hat{j})+\frac{-7.10^{-5}C/m^2}{2\epsilon_0}(-\hat{j})+ \frac{-3.1^{-5}C/m^2}{2\epsilon_0}(\hat{j})

E_{NET} = 0

Force on each sheet is,

F=E_{NET}\sigma ds

F=0

The total force is 0

5 0
3 years ago
Water flows in a tube that has a diameter of D= 0.1 m. Determine the Reynolds number if the average velocity is 10 diameters per
Cloud [144]

Answer:

a) Re_{D} = 111896.745, b) Re_{D} = 1.119\times 10^{-7}

Explanation:

a) The Reynolds number for the water flowing in a circular tube is:

Re_{D} = \frac{\rho\cdot v\cdot D}{\mu}

Let assume that density and dynamic viscosity at 25 °C are 997\,\frac{kg}{m^{3}} 0.891\times 10^{-3}\,\frac{kg}{m\cdot s}, respectively. Then:

Re_{D}=\frac{(997\,\frac{kg}{m^{3}} )\cdot (1\,\frac{m}{s} )\cdot (0.1\,m)}{0.891\times 10^{-3}\,\frac{kg}{m\cdot s} }

Re_{D} = 111896.745

b) The result is:

Re_{D}=\frac{(997\,\frac{kg}{m^{3}} )\cdot (10^{-6}\,\frac{m}{s} )\cdot (10^{-7}\,m)}{0.891\times 10^{-3}\,\frac{kg}{m\cdot s} }

Re_{D} = 1.119\times 10^{-7}

6 0
4 years ago
In contouring, it is necessary to measure position and not velocity for feedback.
EastWind [94]

Answer:

(1). False, (2). True, (3). False, (4). False, (5). True.

Explanation:

The term ''contouring'' in this question does not have to do with makeup but it has to deal with the measurement of all surfaces in planes. It is a measurement in which the rough and the contours are being measured. So, let us check each questions again.

(1). In contouring, it is necessary to measure position and not velocity for feedback.

ANSWER : b =>False. IT IS NECESSARY TO MEASURE BOTH FOR FEEDBACK.

(2). In contouring during 2-axis NC machining, the two axes are moved at the same speed to achieve the desired contour.

ANSWER: a=> True.

(3). Job shop is another term for process layout.

ANSWER: b => False

JOB SHOP IS A FLEXIBLE PROCESS THAT IS BEING USED during manufacturing process and are meant for job Production. PROCESS LAYOUT is used in increasing Efficiency.

(4). Airplanes are normally produced using group technology or cellular layout.

ANSWER: b => False.

(5). In manufacturing, value-creating time is greater than takt time.

ANSWER: a => True.

8 0
3 years ago
An electric sign takes 40A from a 240V supply. What current will it take if the voltage is raised to 300V. Help PLEASE!!!​
Sergeeva-Olga [200]

.........................

3 0
3 years ago
HELP ASAP
Illusion [34]

Answer:

You are a historian who is compiling information on the changing materials used in a product in one of the categories listed below. Choose a product that uses a variety of materials that have been discussed in this lesson (for example, a car or a tennis racket). Using online or library resources, research past materials used to create the product. Be sure to discuss the materials currently being used for the design and include information on the sustainability of these resources. Your research must also explain why the materials changes were made (for example, safety, cost, or weight). Keep track of your references so that you can document all of the resources used for your report.

3 0
3 years ago
Other questions:
  • A dielectric material, such as Teflon®, is placed between the plates of a parallel-plate capacitor without altering the structur
    10·1 answer
  • Technician A says that applying too much braking force can cause tires to lose traction. Technician B says that ABS systems have
    7·1 answer
  • Does a thicker core make an electromagnet stronger?
    13·1 answer
  • The popularity of orange juice, especially as a breakfast drink, makes it an important factor in the economy of orange-growing r
    14·1 answer
  • If a worksite includes more than one set of management and workers, who should have access to the information, training, and con
    12·2 answers
  • Water is the working fluid in an ideal Rankine cycle. The condenser pressure is 8 kPa, and saturated vapor enters the turbine at
    10·1 answer
  • On a given day, a barometer at the base of the Washington Monument reads 29.97 in. of mercury. What would the barometer reading
    6·1 answer
  • Finally, identify at least three colleges, universities, or training programs that are suited to that career choice.
    10·1 answer
  • Engineering includes making things that already exist, except making them better. * true or false
    8·1 answer
  • How is the purple stem trait variation similar to the tougue-rolling trait variation
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!