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
Who was part of dempwolf his firm when he first started
Zinaida [17]

Explanation:

Dempwolf created by John Augustus, Among the most prominent innovative solutions in Southern California Pennsylvania was established by Dempwolf with  brother Reinhardt or uncle's son Frederick entered the company of J.A. Dozens of structures in 10 states were engineered by Dempwolf.

5 0
3 years ago
2 Blocks 1 and 2 rest on rough surfaces with coefficient of frictions ¢1 and ¢2 respectively. The blocks
Amiraneli [1.4K]

Answer:

  • 100N
  • 25N

Explanation:

a) On the verge of tipping over, reaction acts at the corner A

When slippage occurs,

Block moves w/ const. velocity  equilibrium

Three-force member: reaction at A must pass through B

tan b/2h, h b/ 2 θ µ = = ∴= k k ( µ )

b) When slippage occurs,

Block moves w/ const. velocity  equilibrium

Three-force member: reaction at C must pass through G

k tanθ µ =

tan x/ H/2 , x H/2

4 0
3 years ago
"Using your favorite search engine and the resources of your library, develop a set of recommendations regarding the possible us
alina1380 [7]

Answer:

Cloud computing services are going to be very important to supporting Ashville's mobile app since it has different uses. These applications uses include; data storage, as well as helping to provide network to any business data related work. This will improve the city of Ashville's mobile app operations considerably.

The benefits of using cloud computing are; it allows a business managers to be more concerned with running the business themselves rather than maintaining the data center. The use of cloud computing allows a company's IT administrators to focus on managing the company's operations, thereby allowing performance to be enhanced of the business enterprise.

A commercial company is able to create new technologies more rapidly with the use of cloud computing. Furthermore, the enterprise will be able to automate its activities using cloud computing. Cloud computing is also very important as it is more affordable and thus promotes the company's growth in the market. Cloud computing is also enhancing the global presence of the Ashville mobile app. The drawbacks of using cloud computing include the following; due to using the cloud infrastructure, the company's performance may be unreliable. People believe that cloud computing is not reliable and that cloud computing may not be secure at last and can't always be right for all workloads.

Explanation:

5 0
3 years ago
Determine the mass density of an oil if 0.3 tonnes of the oil occupies a volume of 4m.
Yuki888 [10]

Answer:

Do you mean 4m^3 and 3.0 tones?

Explanation:

solution:

Mass = m = 3.0 tones

- 1 ton = 1,000 kg

= 3.0 × 1,000

= 3,000 kg

volume = v = 4m^3

Required:

Mass density of oil = p = ?

We know that;

p =  \frac{mass}{volume} =  \frac{m}{v} =  \frac{3000}{4} = 750kg |m^{3} ans

The answer is:

750kg / m^3

8 0
3 years ago
Describe the cartesain coordinate system.
olga nikolaevna [1]

Answer:

Cartesian coordinate system is used to specify any point on a plane.

In two dimensional plane,the two types of axes or coordinates are x and y axis.

Explanation:

Cartesian coordinate system specifies each point and every point on axes.

A Cartesian Coordinate system in two dimension also named as rectangular coordinate system.

The two types of axes or coordinates are x and y axis.

The horizontal axis is x-axis and vertical axis is named as y-axis.

The coordinate system specifies each point as a set of numerical coordinates in a plane which are signed from negative to positive. that is from  (-\infty,\infty).

In three dimensional plane, x, y and z coordinates are used and in two dimensional plane, x and ycoordinates are used to address any point in the interval (-\infty,\infty).

For defining both the coordinates, the two perpendicular directed lines x- axis and x-axis are drawn.

Now, for example (3,4) is a point in which indicates that the value of x is 3 and y is 4.

It is drawn by moving 3 units right from the origin to positive x axis and 4 units upwards from the origin (0,0) to positive y-axis.

5 0
3 years ago
Other questions:
  • 4.116 The lid of a roof scuttle weighs 75 lb. It is hinged at corners A and B and maintained in the desired position by a rod CD
    9·1 answer
  • Give a reason why fighter aircraft use mid-wing design.
    11·1 answer
  • What is ONE DIFFERENCE between civil structural engineering
    13·1 answer
  • What does an aeronautical engineer design
    15·1 answer
  • Thin film deposition is a process where: a)-elemental, alloy, or compound thin films are deposited onto a bulk substrate! b)-Pho
    12·1 answer
  • I’m doing a project on renewable energy. There are 6 energy sources. Solar, wind, geothermal, hydroelectric, tidal, and biomass.
    14·2 answers
  • Which of the following activities could be considered unethical?
    7·1 answer
  • Factors such as brake shoe orientation, pin location, and direction of rotation determine whether a particular brake shoe is con
    12·1 answer
  • An ideal gas is contained in a closed assembly with an initial pressure and temperature of
    14·1 answer
  • What could I do to make this bridge hold more weight without making it heavier? Lateral bracing and a design on the top will be
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!