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
Is there a way to get the answers to a NCCER book test?
sergeinik [125]

Answer:

go on google and type NCEER book answers

3 0
3 years ago
a metal rod 24mm diameter and 2m long is subjected to an axial pull of 40 kN. If the rod is 0.5mm, then find the stress-induced
ozzi

Answer:

i dont know but i will take the points tho hahah

Explanation:

8 0
2 years ago
Those in this career install, maintain, and repair electrical wiring,
Ad libitum [116K]
I’m pretty sure it’s C and G
8 0
3 years ago
Read 2 more answers
A 4-stroke Diesel engine with a displacement of Vd = 2.5x10^-3m^3 produces a mean effective pressure of 6.4 bar at the speed of
yKpoI14uk [10]

Answer:

The power developed by engine is 167.55 KW

Explanation:

Given that

V_d=2.5\times 10^{-3} m^3

Mean effective pressure = 6.4 bar

Speed = 2000 rpm

We know that power is the work done per second.

So

P=6.4\times 100\times 2.5\times 10^{-3}\times \dfrac{2\pi \times2000}{120}

We have to notice one point that we divide by 120 instead of 60, because it is a 4 cylinder engine.

P=167.55 KW

So the power developed by engine is 167.55 KW

4 0
3 years ago
1. An air standard cycle is executed within a closed piston-cylinder system and consists of three processes as follows:1-2 = con
QveST [7]

Answer:

Explanation: Here it is: 67 Hope that helps! :)

5 0
3 years ago
Other questions:
  • Explain the differences between planned and predictive maintenance.
    12·1 answer
  • The title block generally contains ________.
    12·1 answer
  • Design a posttest-only experiment that would test each of the following causal claims. For each one, identify the study’s indepe
    13·1 answer
  • What is the difference between CNC and NC​
    15·1 answer
  • Suppose that the voltage is reduced by 10 percent (to 90 VV). By what percentage is the power reduced? Assume that the resistanc
    10·1 answer
  • In the ______ phase of the organizational life cycle, the organization is usually very small and agile, focusing on new products
    8·1 answer
  • What is the standard deviation of the following data set:
    7·1 answer
  • Three-dimensional measuring references all of these EXCEPT:
    10·1 answer
  • When a company in the United States employs people in India to answer their customer service calls this is an example of
    9·1 answer
  • How to engineering equation solving
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!