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
Which of the following identifies the limitations of green engineering?
olga_2 [115]

Answer:

Resources and Cost

Explanation:

  • Cost: Sustainable choices can value a lot of as a result of they price makers more to provide. Thus, there'll always be an oversized initial investment once selecting a green element for your home.
  • Resources: Sustainable materials don't seem to be always as without delay available as their less eco-friendly alternatives.

Hope it helps!<3

4 0
2 years ago
A machine used to shred cardboard boxes for composting has a first cost of $10,000, an AOC of $7000 per year, a 3-year life, and
borishaifa [10]
Annual Payment where F is accumulated sum of amount, n is number of years and i is annual rate of interest. The standard notation equation is in the image since i can’t type it-
6 0
2 years ago
An air standard cycle with constant specific heats is executed in a closed system with 0.003 kg of air and consists of the follo
Vsevolod [243]

Answer:

a) Please see attached copy below

b) 0.39KJ

c)  20.9‰

Explanation:

The three process of an air-standard cycle are described.

Assumptions

1. The air-standard assumptions are applicable.

2. Kinetic and potential energy negligible.

3. Air in an ideal gas with a constant specific heats.

Properties:

The properties of air are gotten from the steam table.

b) T₁=290K ⇒ u₁=206.91 kj/kg, h₁=290.16 kj/kg.

P₂V₂/T₂=P₁V₁/T₁⇒ T₂=P₂T₁/P₁ = 380/95(290K)= 1160K

T₃=T₂(P₃/P₂)⁽k₋1⁾/k =(1160K)(95/380)⁽⁰°⁴/₁.₄⁾ =780.6K

Qin=m(u₂₋u₁)=mCv(T₂-T₁)

=0.003kg×(0.718kj/kg.k)(1160-290)K= 1.87KJ

Qout=m(h₃₋h₁)=mCp(T₃₋T₁)

=0.003KG×(1.005kj/kg.k(780.6-290)K= 1.48KJ

Wnet, out= Qin-Qout = (1.87-1.48)KJ =0.39KJ

c)ηth= Wnet/W₍in₎ =0.39KJ/1.87KJ = 20.9‰

7 0
3 years ago
You find an unnamed fluid in the lab we will call Fluid A. Fluid A has a specific gravity of 1.65 and a dynamic viscosity of 210
Naily [24]

Answer:

1.2727 stokes

Explanation:

specific gravity of fluid A = 1.65

Dynamic viscosity = 210 centipoise

<u>Calculate the kinematic viscosity of Fluid A </u>

First step : determine the density of fluid A

Pa = Pw * Specific gravity =  1000 * 1.65 = 1650 kg/m^3

next : convert dynamic viscosity to kg/m-s

210 centipoise = 0.21 kg/m-s

Kinetic viscosity of Fluid A = dynamic viscosity / density of fluid A

                                            = 0.21 / 1650 = 1.2727 * 10^-4 m^2/sec

Convert to stokes = 1.2727 stokes

4 0
3 years ago
Name some technical skills that are suitable for school leavers .​
Natalka [10]

Answer:

Welding, carpentry, masonry, construction worker, barber

Explanation:

7 0
3 years ago
Other questions:
  • Who knows about welding ??
    7·1 answer
  • The 10 foot wide circle quarter gate AB is articulated at A. Determine the contact force between the gate and the smooth surface
    10·1 answer
  • 2- A 2-m3 insulated tank containing ammonia at -20 C, 80% quality, is connected by a valve to a line flowing ammonia at 2 MPa, 6
    14·1 answer
  • Design a digital integrator using the impulse invariance method. Find and give a rough sketch of the amplitude response, and com
    15·1 answer
  • Describe what viscoelastic behavior means
    7·1 answer
  • The current flow in an NMOS transistor is due to one of the following:
    11·1 answer
  • Your friend has two substances A and B which are compressed liquid and superheated vapor respectively. Both are in rigid vessels
    15·1 answer
  • How can I skip more helppppppppppppppppppppppp
    9·2 answers
  • What is the width of a professional football field?.
    5·1 answer
  • Describe the greatest power in design according to Aravena?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!