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
What are three demonstration drive tips for the vc-turbo engine?.
Oliga [24]

The three (3) demonstration drive tips for a VC-turbo engine are:

  1. Use your gears when overtaking and driving up a long hill.
  2. Warm up your engine before accelerating.
  3. Ensure your oil level is at the optimum gauge or level.

<h3>What is a VC-turbo engine?</h3>

A VC-turbo engine can be defined as a technologically-advanced internal combustion engine that is design and developed to be faster, especially by combining the torque and efficiency of an advanced diesel powertrain with the power of a high-performance gas engine.

<h3>The demonstration drive tips.</h3>

Basically, the three (3) demonstration drive tips for a VC-turbo engine include the following:

  1. Use your gears when overtaking and driving up a long hill.
  2. Warm up your engine before accelerating.
  3. Ensure your oil level is at the optimum gauge or level.

Read more on drive tips here: brainly.com/question/23968178

4 0
3 years ago
provides steady-state operating data for a solar power plant that operates on a Rankine cycle with Refrigerant 134a as its worki
Vaselesa [24]

Answer:

hello some parts of your question is missing attached below is the missing part ( the required fig and table )

answer : The solar collector surface area = 7133 m^2

Explanation:

Given data :

Rate of energy input to the collectors from solar radiation = 0.3 kW/m^2

percentage of solar power absorbed by refrigerant = 60%

Determine the solar collector surface area

The solar collector surface area = 7133 m^2

attached below is a detailed solution of the problem

8 0
3 years ago
Explain the difference, on the basis of the test results, between the ultimate strength and the "true" stress at fracture.
gayaneshka [121]

Answer / Explanation:

On the basis of the test result, Ultimate strength which is mostly known as the ultimate tensile strength is the strength attached to the ability or capacity of a structural element or material used in the test to withstand elongation forces or pull force applied to it.  

WHILE,

True stress at fracture can be classified as stress or load associated to the point where yielding or fracture occurred divided by the cross-sectional area at the yield point.

5 0
3 years ago
A soil is at a void ratio e = 0.90 with a specific gravity of the solid particles Gs = 2.70.
Alexus [3.1K]

Answer:

The correct answers are:

a. % w = 33.3%

b. mass of water = 45g

Explanation:

First, let us define the parameters in the question:

void ratio e  = \frac{V_v}{V_s} =  \frac{\left\begin{array}{ccc}volume&of&void\end{array}\right}{\left\begin{array}{ccc}volume&of&solid\end{array}\right}------ (1)

Specific gravity G_{s} = \frac{P_s}{P_w} =  \frac{\left\begin{array}{ccc}density&of&soil\end{array}\right}{\left\begin{array}{ccc}density&of&water\end{array}\right}------ (2)

% Saturation S = \frac{V_w}{Vv} × \frac{100}{1} =  \frac{\left\begin{array}{ccc}volume&of&water\end{array}\right}{\left\begin{array}{ccc}volume&of&void\end{array}\right} × \frac{100}{1}--------(3)

water content w =  \frac{M_w}{M_s} = \frac{\left\begin{array}{ccc}mass&of&water\end{array}\right}{\left\begin{array}{ccc}mass&of&solid\end{array}\right} ------(4)

a) To calculate the lower and upper limits of water content:

when S = 100%, it means that the soil is fully saturated and this will give the upper limit of water content.

when S < 100%, the soil is partially saturated, and this will give the lower limit of water content.

Note; S = 0% means that the soil is perfectly dry. Hence, when s = 1 will give the lowest limit of water content.

To get the relationship between water content and saturation, we will manipulate the equations above;

w =  \frac{M_w}{Ms}

Recall; mass = Density × volume

w = \frac{V_wP_w}{V_sP_s} ------(5)

From eqn. (2)  G_{s} = \frac{P_s}{P_w}

∴ \frac{1}{G_s} = \frac{P_w}{P_s} ------(6)

putting eqn. (6) into (5)

w = \frac{V_w}{V_sG_s} -----(7)

Again, from eqn (1)

V_s = \frac{V_v}{e}

substituting into eqn. (7)

w = \frac{V_w}{\frac{V_v}{e}{G_s} } = \frac{V_w e}{V_vG_s} \\ but \frac{V_w}{V_v}  = S

∴ w = \frac{Se}{G_s} -----(8)

With eqn. (7), we can calculate

upper limit of water content

when S = 100% = 1

Given, G_{s} = 2.7, e= 0.9

∴w= \frac{0.9*1}{2.7} = 0.333

∴ %w = 33.3%

Lower limit of water content

when S = 1% = 0.01

w= \frac{0.01*0.9 }{2.7} = 0.0033

∴ % w = 0.33%

b) Calculating mass of water in 100 cm³ sample of soil (P_w=\frac{1_g}{cm^{3} } )

Given, V_{s} = 100 cm^{3 }, S = 50% = 0.5

%S = \frac{V_w}{V_v} × \frac{100}{1} = \frac{V_w}{eV_s} × \frac{100}{1}

0.50 = \frac{V_w}{0.9* 100}  = 45cm^{3}

mass of water = P_wV_w= 1 * 45 = 45_{g}

7 0
4 years ago
Aiman is 80 inches tall. How tall is Aiman in centimeters? Show your work.
harkovskaia [24]
203.2 centimeters.
This is because 1 inch = 2.54 centimeters which means multiply 80 inches X 2.54 = 203.2 centimeters.
5 0
3 years ago
Other questions:
  • How does internet work
    6·1 answer
  • (10 points) A single crystal in the titanium cable is oriented so that the [001] direction is parallel to the applied load. If t
    14·1 answer
  • Please add comments to your program to explain it. Thank you!
    14·1 answer
  • A _________ is a PLD featuring a general structure that allows very high logic capacity and offers more narrow logic resources a
    5·1 answer
  • Amy needs to create an architectural design for a charitable foundation. Which design principle element can Amy use to depict ca
    12·1 answer
  • (TCO 1) Name one disadvantage of fixed-configuration switches over modular switches. a. Ease of management b. Port security b. F
    6·1 answer
  • The pressure in an automobile tire depends on the temperature of the air in the tire. When the air temperature is 25°C, the pres
    13·1 answer
  • Obese children develop high blood pressure, heart disease, and Type II diabetes at a younger age than children of a healthy weig
    9·2 answers
  • Also discuss how bandwidth is affected by increasing the number of signal elements.
    5·1 answer
  • Who has the authority to declare a "global emergency"?​
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!