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
Design a stepped-impedance low-pass filter having a cutoff frequency of 3 GHz and a fifth-order 0.5 dB equal-ripple response. As
tatiyna

Answer:

A certain vehicle loses 3.5% of its value each year. If the vehicle has an initial value of $11,168, construct a model that represents the value of the vehicle after a certain number of years. Use your model to compute the value of the vehicle at the end of 6 years.

Explanation:

8 0
3 years ago
In fully developed laminar flow in a circular pipe the velocity at R/2 (mid-way between the wall surface and the centerline) is
Butoxors [25]

Answer:

u_{max} = 17.334\,\frac{m}{s}

Explanation:

Let consider that velocity profile inside the circular pipe is:

u(r) = 2\cdot U_{avg} \cdot \left(1 - \frac{r^{2}}{R^{2}}  \right)

The average speed at r = \frac{1}{2} \cdot R is:

U_{avg} = \frac{13\,\frac{m}{s} }{2\cdot \left(1-\frac{1}{4}  \right)}

U_{avg} = 8.667\,\frac{m}{s}

The velocity at the center of the pipe is:

u_{max} = 2\cdot U_{avg}

u_{max} = 17.334\,\frac{m}{s}

6 0
2 years ago
Read 2 more answers
Their game off badminton is always on Tuesday
igomit [66]

Ok? is this a question or what?

5 0
2 years ago
4.68 Steam enters a turbine in a vapor power plant operating at steady state at 560°C, 80 bar, and exits as a saturated vapor at
garik1379 [7]

Answer:

please mark me as a brainleast

Explanation:

hahahahhahaahhahahahahahahahahahahahahahahahaahhhahhhahaahahhaahhhahahaah

3 0
2 years ago
Help now please evaluate using the commutative property: 40 (32) (10) (25)
Ilia_Sergeevich [38]

Answer:

#See solution for details.

Explanation:

#The commutative property of multiplication tells us that it doesn't matter in what order you multiply numbers. The formula for this property is a * b = b * a:

40\times32\times10\times 25=320,000\\\\25\times10\times32\times 40=320,000\\\\10\times32\times25\times 40=320,000\\\\32\times25\times40\times 10=320,000

Hence, the product of the four numbers remains 320,000 irrespective of their order.

4 0
2 years ago
Other questions:
  • Some signs of aggressive drivers include
    5·1 answer
  • The following liquids are stored in a storage vessel at 1 atm and 25°C. The vessels are vented with air. Determine whether the e
    5·1 answer
  • A water agency stated that waterlines cannot have water flowing faster than 8 ft/s. What is the minimum standard pipe diameter t
    12·1 answer
  • Who is using welding symbols to to communicate the detailed information necessary for welders to complete the weld?
    6·1 answer
  • The toughness of a material does what, when it's been heated?​
    7·1 answer
  • What can you add to a seatbelt ??<br> HELP ASAP
    15·1 answer
  • What was the most important thing you learned this school year in your engineering class and why did you choose this thing
    15·1 answer
  • Respond with TRUE if the symbol of the valve shown below is
    10·1 answer
  • A golfer and her caddy see lightning nearby. the golfer is about to take his shot with a metal club, while her caddy is holding
    12·1 answer
  • Drivers education :Anything that draws your mind off driving is
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!