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
Explain why veracity, value, and visualization can also be said to apply to relational databases as well as Big Data.
Hatshy [7]

Answer:

Veracity, Value and Visualization are not only the characteristics of Big Data but are also the characteristics of relational databases. Veracity of data is issue with smallest data stores this is the reason that it is important in relation...

5 0
2 years ago
(HVAC) PLEASE HELP neeed helpp
meriva
Answer

Sump heater

Explanation
3 0
3 years ago
Technician A says that the definition of torque is how far the crankshaft twists in degrees.Technician B says that torque can re
leonid [27]
Technician B is correct because torque is a force of an object.
6 0
11 months ago
500 flights land each day at San Jose’s airport. Assume that each flight has a 5% chance of being late, independently of whether
BARSIC [14]

Answer:

a.0.0199

b.0.1765

c.0.0785

d.0.1268

e.Yes

Explanation:

It is given that   X follows a  Binomial distribution with (n= 500, p = 0.05)

The  probabilities  are computed using the EXCEL .

a) The required probability here is:

P(X less of equal to  15)

= binom.dist(15,500,0.05,TRUE)

=0.0199

Therefore the probability is 0.0199 .

b) The required probability here is:

P(X greater or equal to 30) = 1 - P(X less or equal to  29)  

=1 - binom.dist(29,500,0.05,TRUE)

=0.1765

Therefore the probability is 0.1765

c) P(X = 26 )

= binom.dist(26,500,0.05,FALSE)  

=0.0785

Therefore the probability is 0.0785

d) The required probability here is computed as:

P(10 less or equal to X less or equal to 20 ) = P(X less or equal to 19) - P(X less or equal to 10)

= binom.dist(19,500,0.05,TRUE) - binom.dist(10,500,0.05,TRUE)

=0.1268

Therefore the probability 0.1268

e) Yes . Therefore the probability because that is the assumption used to apply binomial distribution .

6 0
3 years ago
______ are an idication that your vehicle may be developing a cooling system problem.
iris [78.8K]

Answer:

The temperature gauge showing that the vehicle has been running warmer or has recently began to have issues from overheating is  an idication that your vehicle may be developing a cooling system problem.

Explanation:

8 0
3 years ago
Other questions:
  • There is a proposal in Brooklyn to construct a new mid-rise apartment building on a vacant lot at the intersection of Avenue A a
    8·1 answer
  • Which type of design does not need special care for the placement of dimensions?
    5·1 answer
  • Consider the cascade of the three LTI systems having impulse responses: h-1(t) = e^-tu(t + 3) h_2(t) = rect((1 -1)/2) h_3(t) = d
    8·1 answer
  • 5) Initially, the pressure and temperature of steam inside a solid capsule is at 100-pound force per square inch absolute (psia)
    6·1 answer
  • SEICUL UC CULTELL allsvel.
    9·2 answers
  • Please answwr the above question screenshot.​
    15·1 answer
  • Two aerial photographs were taken 30 seconds apart over one east-bound lane of l-80 near Grand Island, NE. The following results
    12·1 answer
  • Calculate the percentage of recyclables in high socioeconomic localities.
    13·1 answer
  • Identify renewable energy sources you will propose. Explain the key elements to your solution and the basic technical principles
    5·1 answer
  • What is the minimum clamp time for gluing a panel?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!