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]
3 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]3 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
When block C is in position xC = 0.8 m, its speed is 1.5 m/s to the right. Find the velocity of block A at this instant. Note th
Amanda [17]

Answer:

The answer is "2 m/s".

Explanation:

The triangle from of the right angle:

\to (x_c-0.8)+(1.5+y_4) +\sqrt{x_c^2 + 1.5^2}= constant

Differentiating the above equation:

\to V_c +V_A+ \frac{X_cV_c}{\sqrt{x_c^2 +1}}=0\\\\\to 1-V_A+ \frac{0.8 \times 1.5}{\sqrt{ 0.8^2+1.5}}=0\\\\

\to V_A=  \frac{1.2}{\sqrt{ 0.64+1.5}}+1\\\\

        = \frac{1.2}{ 1.46}+1\\\\= \frac{1.2+ 1.46}{ 1.46}\\\\ = \frac{2.66}{1.46}\\\\= 1.82 \ \frac{m}{s}\\\\= 2 \ \frac{m}{s}

3 0
2 years ago
The maximum stress that a bar will withstand before failing is called • Rapture Strength • Yield Strength • Tensile Strength • B
konstantin123 [22]

Answer: Rupture strength

Explanation: Rupture strength is the strength of a material that is bearable till the point before the breakage by the tensile strength applied on it. This term is mentioned when there is a sort of deformation in the material due to tension.So, rupture will occur before whenever there are chances of failing and the material is still able to bear stresses before failing.  

7 0
3 years ago
Describe carbonation as it applies to the four-stroke engine.
valentinak56 [21]
Carbonation is more of a healer to the engine
5 0
2 years ago
Read 2 more answers
The voltage and current at the terminals of the circuit element in Fig. 1.5 are zero fort < 0. Fort 2 0 they areV =75 ~75e-10
masya89 [10]

Answer:

maximum value of the power delivered to the circuit =3.75W

energy delivered to the element = 3750e^{ -IOOOt} - 7000e ^{-2OOOt} -3750

Explanation:

V =75 - 75e-1000t V

l = 50e -IOOOt mA

power = IV = 50 * 10^-3 e -IOOOt * (75 - 75e-1000t)

=50 * 10^-3 e -IOOOt *75 (1 - e-1000t)

=

maximum value of the power delivered to the circuit =3.75W

the total energy delivered to the element = \int\limits^t_0  {3.75(e^{ -IOOOt} - e ^{-2OOOt} )} , dx \\\\

3750e^{ -IOOOt} - 7000e ^{-2OOOt} -3750

5 0
3 years ago
The lattice constant of a simple cubic lattice is a0.
Oksi-84 [34.3K]

Answer:

A)The sketches for the required planes were drawn in the first attachment.

B)The sketches for the required directions were drawn in the second attachment.

To draw a plane in a simple cubic lattice, you have to follow these instructions:

1- the cube has 3 main directions called "a", "b" and "c" (as shown in the first attachment)

2- The coordinates of that plane are written as: π:(1/a₀ 1/b₀ 1/c₀) (if one of the coordinates is 0, for example (1 1 0), c₀ is ∞, therefore that plane never cross the direction c).

3- Identify the points a₀, b₀, and c₀ at the plane that crosses this main directions and point them in the cubic cell.

4- Join the points.

To draw a direction in a simple cubic lattice, you have to follow these instructions:

1- Identify the points a₀, b₀, and c₀ in the cubic cell.

2- Draw the direction as a vector-like (a₀ b₀ c₀).

7 0
2 years ago
Other questions:
  • computer language C++ (Connect 4 game)( this is all the info that was givin no input or solution) I used the most recent version
    6·1 answer
  • What is the purpose of a heater core
    5·2 answers
  • A proposed piping and pumping system has 20-psig static pressure, and the piping discharges to atmosphere 160 ft above the pump.
    8·1 answer
  • Argon is compressed in a polytropic process with n = 1.2 from 100 kPa and 30°C to 1200 kPa in a piston–cylinder device. Determin
    14·1 answer
  • Why is it important to always be wearing a personal flotation device (PFD) when in or around the water?
    9·2 answers
  • Nitrogen gas is compressed at steady state from a pressure of 14.2 psi and a temperature 60o F to a pressure of 120 psi and a te
    7·1 answer
  • A Pelton wheel is supplied with water from a lake at an elevation H above the turbine. The penstock that supplies the water to t
    6·1 answer
  • The boost converter of Fig. 6-8 has parameter Vs 20 V, D 0.6, R 12.5 , L 10 H, C 40 F, and the switching frequency is 200 kHz. (
    12·1 answer
  • A series of end-milling cuts is currently used to produce an aluminum part that is an aircraft component. The purpose of the mac
    14·1 answer
  • The following is a series of questions pertaining to the NSPE Code of Ethics. Please indicate whether the statement are true or
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!