duplicates = multiple editions
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
| import pandas as pd | |
| import pandas_datareader.data as web | |
| import numpy as np | |
| import datetime | |
| from scipy.optimize import minimize | |
| TOLERANCE = 1e-10 | |
| def _allocation_risk(weights, covariances): |
| { | |
| "福建省": { | |
| "南平市": { | |
| "松溪县": { | |
| "code": "350724", | |
| "level": 3, | |
| "parentCode": "350000", | |
| "name": "松溪县", | |
| "lon": 118.765689, | |
| "lat": 27.610704 |
| This Shiny application is designed to help analysing trading strategies. It is an ongoing project that I improve when time allows. Feel free to get in touch should you have any suggestion. | |
| *How to use the App as it is? | |
| The App uses as input several csv files (one for each strategy). Each file has two columns: date and daily return. There is an example of such a file in the Github repository. The code is essentially made of 3 files. | |
| -ui.R: controls the layout and appearance of the app | |
| -server.R: contains the instructions needed to build the app. You can load as much strategies as you want as long as the corresponding csv file has the right format (see below). | |
| -shinyStrategyGeneral.R: loads the required packages and launches the app | |
| put ui.R and server.R file in a separate directory | |
| In the server.R file change the inputPath, inputFile and keepColumns parameters to match your setting. The first two are self explanatory the third one is a list of column names within the csv file. Keep only date and daily return |
| """ | |
| File name: gp_alter.py | |
| Author: Thomas Macrina | |
| Date created: 03/21/2014 | |
| Python Version: 2.7 | |
| Overwriting the generate() method within DEAP's gp.py | |
| to remove the need for "dummy" nodes within strongly-typed | |
| individuals. |
| from bs4 import BeautifulSoup | |
| from urllib2 import urlopen | |
| from datetime import datetime, timedelta | |
| from time import sleep | |
| import sys | |
| import csv | |
| # CONSTANTS | |
| ESPN_URL = "http://scores.espn.go.com" | |
| from bs4 import BeautifulSoup | |
| from urllib2 import urlopen | |
| from datetime import datetime, timedelta | |
| from time import sleep | |
| import sys | |
| import csv | |
| # CONSTANTS | |
| ESPN_URL = "http://scores.espn.go.com" |
| #! /usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import subprocess | |
| import re | |
| ntfs_pattern = re.compile(r'File System Personality: NTFS') | |
| ntfs_device_node = re.compile(r'.*Device Node:.*') | |
| device_dict = {} |
The range sliders at the top change the values for the force-directed algorithm and the buttons load new graphs and apply various techniques. This will hopefully serve as a tool for teaching network analysis and visualization principles during my Gephi courses and general Networks in the Humanities presentations.
Notice this includes a pretty straightforward way to load CSV node and edge lists as exported from Gephi.
It also includes a pathfinding algorithm built for the standard data structure of force-directed networks in D3. This requires the addition of .id attributes for the nodes, however.
Now with Clustering Coefficients!
Also, it loads images for nodes but the images are not in the gist. The code also refers to different network types but the data files on Gist only refer to the transportation network.
| from struct import * | |
| ofile=open('sz000680.day','rb') | |
| buf=ofile.read() | |
| ofile.close() | |
| ifile=open('sz000680.txt','w') | |
| num=len(buf) | |
| no=num/32 | |
| b=0 | |
| e=32 |