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
What are the Basic requirements of drinking Water ?
iragen [17]

Answer:

1) free of contaminants, 2) alkaline, and 3) micro-clustered

Explanation:

Hope it helps you

4 0
2 years ago
A fatigue test was conducted in which the mean stress was 90 MPa (13050 psi), and the stress amplitude was 190 MPa (27560 psi).
Gwar [14]

Answer:

a) 280MPa

b) -100MPa

c) -0.35

d) 380 MPa

Explanation:

GIVEN DATA:

mean stress \sigma_m = 90MPa

stress amplitude \sigma_a = 190MPa

a) \sigma_m =\frac{\sigma_max+\sigma_min}{2}

    90 =\frac{\sigma_{max}+\sigma_{min}}{2} --------------1

\sigma_a =\frac{\sigma_{max}-\sigma_{min}}{2}

   190 = \frac{\sigma_{max}-\sigma_{min}}{2} -----------2

solving 1 and 2 equation we get

\sigma_{max} = 280MPa

b) \sigma_{min} = - 100MPa

c)

stress ratio=\frac{\sigma_{min}}{\sigma_{max}}

=\frac{-100}{280} = -0.35

d)magnitude of stress range

                      =(\sigma_{max} -\sigma_{min})

                       = 280 -(-100) = 380 MPa

3 0
3 years ago
Why do we study National studies
Gre4nikov [31]

Answer:

It’s so we can then understand other cultures and other ways that people do things or we can also be prepared for what a country that we have not been to yet is going to relatively be like. This can also help with vacation planning.

Explanation:

it can also help us understand different people from different cultures.

3 0
2 years ago
Fill in the blank to correctly complete the statement below.
ZanzabumX [31]
Did not engineer cables factoring wind shear
4 0
3 years ago
A car travells at 67.5 km\h in 120 km.how long will it take to reach the destination
Kruka [31]

mark me the brainiest here

average speed (in km/h) of a car stuck in traffic that drives 12 kilometers in 2 hours.

5 0
3 years ago
Other questions:
  • A high-voltage direct-current (dc) transmission line between Celilo, Oregon and Sylmar, California is 845 mi in length. The line
    15·1 answer
  • Fatigue failure occurs under the condition of (a) High elastic stress (b) High corrosivity (c) High stress fluctuations (d) High
    9·1 answer
  • A roller-coaster car is traveling at a speed of 23 m/s when it passes through point B. At that point, it enters a concave down c
    8·1 answer
  • A socket can be driven using any of the following except for (A) a socket ratchet
    14·1 answer
  • A Water Amusement Park parking lot charges $24.00 minimum fee to park for up to 8 hours. The meter charges an additional $3.25 p
    5·2 answers
  • Someone please help me with this I’m stuck on it ?!i don’t have a lot of time
    12·1 answer
  • 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
  • An aircraft is in a steady level turn at a flight speed of 200 ft/s and a turn rate about the local vertical of 5 deg/s. Thrust
    8·1 answer
  • A river has an average rate of water flow of 59.6 M3/s. This river has three tributaries, tributary A, B and C, which account fo
    10·1 answer
  • Someone please please help me and explain!! I will give brainliest if right!!!
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!