Giter VIP home page Giter VIP logo

challenge7's Introduction

Challenge7

Analyze a Single Asset in the ETF

By means of the query and the pandas function read_sql_query it is possible to create a dataframe from the relevant table contained in the database, which is PYPL in this case. The dataframe has already a column with the daily returns, from which it is possible to plot the graph, and by taking the cumulative product plotting the cumulative returns.

Optimize Data Access with Advanced SQL Queries

Here we make two different queries:

1- the first one selects time and close value from the PYPL table where the price is greater than 200 dollars. 2- the second one selects the 10 best daily returns, by ordering them in descending order and taking the first 10

Analyze the ETF Portfolio

In this last part we want to access to all the different tables, making a join operation based on the common time column's values. In doing that we don't select all the columns, since the time column would be repeated multiple times. To improve readability of the DataFrame we create a list of tuples, in order to create later the a multindex object. In this way we know for which stock the columns are relevant to. We compute the average daily returns; for the scope we imply that each stock equally makes up 25% of the total portfolio's asset. We can then compute for each year the annualized return. After this, we set the time as index, so the information remains untouched while manipulating the data. We can then compute the cumulative returns and plot them.

Afer all this passages we can create a Voila application by typing in the Bash voila <path_to_notebook>.

First screenshot of voila

Second screenshot of voila

challenge7's People

Contributors

honeybadger919 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.