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
Engineers need to be open-ended when dealing with their designs. Why?
melomori [17]
I think the answer would be A if its wrong I’m sorry
7 0
3 years ago
If im 14 and your 14 what does that equal
Karo-lina-s [1.5K]

Answer:

hmmmmmmmmmmmmmmmmmmmmmmm

Explanation:

4 0
3 years ago
Read 2 more answers
Which option identifies the tool best to use in the following scenario?
Lena [83]

Answer:

an Allen wrench

Explanation:

it is hexagonal

3 0
3 years ago
The compressed-air tank has an inner radius r and uniform wall thickness t. The gage pressure inside the tank is p and the centr
Sedaia [141]

Answer:

Explanation:

Given that:

The Inside pressure (p) = 1402 kPa

= 1.402 × 10³ Pa

Force (F) = 13 kN

= 13 × 10³ N

Thickness (t) = 18 mm

= 18 × 10⁻³ m

Radius (r) = 306 mm

= 306 × 10⁻³ m

Suppose we choose the tensile stress to be (+ve) and the compressive stress to be (-ve)

Then;

the state of the plane stress can be expressed as follows:

(\sigma_ x)  = \dfrac{Pd}{4t}+ \dfrac{F}{2 \pi rt}

Since d = 2r

Then:

(\sigma_ x)  = \dfrac{Pr}{2t}+ \dfrac{F}{2 \pi rt}

(\sigma_ x)  = \dfrac{1402 \times 306 \times 10^3}{2(18)}+ \dfrac{13 \times 10^3}{2 \pi \times 306\times 18 \times 10^{-3} \times 10^{-3}}

(\sigma_ x)  = \dfrac{429012000}{36}+ \dfrac{13000}{34607.78467}

(\sigma_ x)  = 11917000.38

(\sigma_ x)  = 11.917 \times 10^6 \ Pa

(\sigma_ x)  = 11.917 \ MPa

\sigma_y = \dfrac{pd}{2t} \\ \\ \sigma_y = \dfrac{pr}{t} \\ \\  \sigma _y = \dfrac{1402\times 10^3 \times 306}{18} \ N/m^2 \\ \\ \sigma _y = 23.834 \times 10^6 \ Pa \\ \\ \sigma_y = 23.834 \ MPa

When we take a look at the surface of the circular cylinder parabolic variation, the shear stress is zero.

Thus;

\tau _{xy} =0

3 0
3 years ago
In___cutting, the torch is held and moved by a mechanical device and manually adjusted by the welder.
natita [175]
It is a metal because is saying that is a manually device
6 0
2 years ago
Other questions:
  • A piston cylinder assembly fitted with a slowly rotating paddle wheel contains 0.13 kg of air at 300K. The air undergoes a const
    10·1 answer
  • Draw an ERD for each of the following situations. (If you believe that you need to make additional assumptions, clearly state th
    15·1 answer
  • What is the definition of a tolerance on a dimension typically found on technical drawings?
    7·1 answer
  • The news media often report an earthquake's magnitude on the Richter scale. Which of the following items are characteristics of
    14·1 answer
  • 1. The area of the given triangle is 25 square units. What is the value of x?<br> X+2
    8·1 answer
  • // This program accepts data about 100 books and// determines a price for each.// The price is 10 cents per page for the// first
    12·1 answer
  • An atom that gained an electron is called​
    10·2 answers
  • The Imager for Mars Pathfinder (IMP) is an imaging system. It has two camera channels. Each channel has color capability. This i
    7·1 answer
  • Hello it's my new id<br>I am numu ​
    15·1 answer
  • Why the power factor is Low in no load test in induction motor ?​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!