sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh
| import requests | |
| import pandas as pd | |
| import plotly.graph_objects as go | |
| import pandas as pd | |
| from datetime import datetime | |
| api_key = 'your api key from financialmodelingprep' |
| from pandas import read_csv | |
| s = read_csv('data.txt', squeeze=True, header=None) | |
| print( | |
| (s.diff() > 0).sum(), | |
| ) |
| import asyncio | |
| class AsyncConstructorMeta(type): | |
| """Metaclass to support asynchronous constructors in Python. | |
| Basically we're exploiting the fact that __new__ can return anything in Python. | |
| So we're taking the old __init__ code, removing it from the class, and instead, | |
| we create a custom __new__ method that returns a coroutine wrapping the original | |
| constructor. |
| drop table if exists shipments; | |
| create table shipments ( | |
| id serial primary key not null, | |
| sender_address_id integer not null, | |
| sender_contact_id integer not null, | |
| receiver_address_id integer not null, | |
| receiver_contact_id integer not null, | |
| created_at timestamp not null default current_timestamp, | |
| units integer not null, | |
| zar_value numeric not null |
| <? | |
| // | |
| // AUTO KEYWORD-BASED FOLLOWER CURATION BOT (by @levelsio) | |
| // | |
| // File: twitterFollowerCuratorBot.php | |
| // | |
| // Created: May 2021 | |
| // License: MIT | |
| // |
| >> python3 valuation.py -t enph -i | |
| Fetching industries data ... | |
| Processing ENPH | |
| Solar (US): ['ENPH', 'RUN', 'FSLR', 'SPWR', 'SHLS', 'VSLR', 'NOVA', 'BEEM', 'SUNW', 'PECK', 'EVSI'] | |
| Fetching data for ENPH | |
| Starting DCF calculation for ENPH | |
| Equity %: 94% | |
| Cost / equity = riskfree rate + beta * country ERP | |
| Cost / equity = 2% + 1.13349 * 0.09 |