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]
4 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]4 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
99 POINTS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
qwelly [4]

Answer:

1. Can you tell me something about yourself?

2. What are you weaknesses?

3. If you would describe yourself in one word?

Explanation: Those questions above 1, 2, and 3 are not harmful to ask your client. Bit the last two 4 and 5 are very harmful, because you don't need to be all up in they business and you don't want to put a lot of pressure on your client.

Hope this helps☝️☝☝

7 0
4 years ago
Read 2 more answers
Situation: Peter is designing a new hybrid car that functions on solar power. He is currently working on sketches of his design
givi [52]

Answer:

whats the question?

Explanation:

8 0
2 years ago
Your program will be a line editor. A line editor is an editor where all operations are performed by entering commands at the co
soldier1979 [14.2K]

Answer:

Java program given below

Explanation:

import java.util.*;

import java.io.*;

public class Lineeditor

{

private static Node head;

 

class Node

{

 int data;

 Node next;

 public Node()

 {data = 0; next = null;}

 public Node(int x, Node n)

 {data = x; next =n;}

}

 

public void Displaylist(Node q)

 {if (q != null)

       {  

        System.out.println(q.data);

         Displaylist(q.next);

       }

 }

 

public void Buildlist()

  {Node q = new Node(0,null);

       head = q;

       String oneLine;

       try{BufferedReader indata = new

                 BufferedReader(new InputStreamReader(System.in)); // read data from terminals

                       System.out.println("Please enter a command or a line of text: ");  

          oneLine = indata.readLine();   // always need the following two lines to read data

         head.data = Integer.parseInt(oneLine);

         for (int i=1; i<=head.data; i++)

         {System.out.println("Please enter another command or a new line of text:");

               oneLine = indata.readLine();

               int num = Integer.parseInt(oneLine);

               Node p = new Node(num,null);

               q.next = p;

               q = p;}

       }catch(Exception e)

       { System.out.println("Error --" + e.toString());}

 }

public static void main(String[] args)

{Lineeditor mylist = new Lineeditor();

 mylist.Buildlist();

 mylist.Displaylist(head);

}

}

7 0
3 years ago
A circular column is fixed at the base and not supported at the top. If the column needs to be 15ft and hold 10kips, what is the
muminat

Answer:

The required size of column is length = 15 ft and diameter = 4.04 inches

Explanation:

Given;

Length of the column, L = 15 ft

Applied load, P = 10 kips = 10 × 10³ Psi

End condition as fixed at the base and free at the top

thus,

Effective length of the column, \L_e = 2L = 30 ft = 360 inches

now, for aluminium

Elastic modulus, E = 1.0 × 10⁷ Psi

Now, from the Euler's critical load, we have

P =\frac{\pi^2EI}{L_e^2}

where, I is the moment of inertia

on substituting the respective values, we get

10\times10^3 =\frac{\pi^2\times1.0\times10^7\times I}{360^2}

or

I = 13.13 in⁴

also for circular cross-section

I = \frac{\pi}{64}\times d^4

thus,

13.13 = \frac{\pi}{64}\times d^4

or

d = 4.04 inches

The required size of column is length = 15 ft and diameter = 4.04 inches

3 0
3 years ago
TWO SENTENCES!!!! What are the benefits of working in an engineering team?
Vlad [161]
1. You get to build cool things for places like nasa.
2. You get paid very well

Hope this helps
7 0
3 years ago
Read 2 more answers
Other questions:
  • What kind of energy transformation happens when a boy uses energy from a sandwich to run a race​
    11·2 answers
  • The y-component of velocity for a certain 2-D flow field is given as u = 3xy + x2 . Determine the x-component of velocity if the
    12·1 answer
  • Considering the two tables below called Orders and OrderLines, how many rows would be returned by this SQL query? SELECT o.Order
    10·1 answer
  • What are the different branches of engineering involved in manufacturing a general-purpose elevator?
    6·1 answer
  • g The parameters of a certain transmission line operating at 휔휔=6 ×108 [rad/s] are 퐿퐿=0.35 [휇휇H/m], 퐶퐶=75 [pF/m], 퐺퐺=75 [휇휇S/m],
    12·1 answer
  • Who is the inventor that created the light bulb
    15·1 answer
  • U Differentiate between rotation and revolution<br>of earth.​
    6·2 answers
  • What does it mean to say that PEER is a data-driven, consumer-centric, and comprehensive system?
    8·2 answers
  • Direction: List down or enumerate the type of outlets you want to install on your dream house. Also indicate the quantity (in pi
    9·1 answer
  • All these are returnless fuel systems EXCEPT ?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!