The package manager of python packages is called pip.
sudo apt-get install python-pip
If you need a pip package as a debian you can use Victor's debian from pip.
The package manager of python packages is called pip.
sudo apt-get install python-pip
If you need a pip package as a debian you can use Victor's debian from pip.
| import networkx as nx | |
| # SAMPLE DATA FORMAT | |
| #nodes = [('tensorflow', {'count': 13}), | |
| # ('pytorch', {'count': 6}), | |
| # ('keras', {'count': 6}), | |
| # ('scikit', {'count': 2}), | |
| # ('opencv', {'count': 5}), | |
| # ('spark', {'count': 13}), ...] |
| # An example to get the remaining rate limit using the Github GraphQL API. | |
| import requests | |
| headers = {"Authorization": "Bearer YOUR API KEY"} | |
| def run_query(query): # A simple function to use requests.post to make the API call. Note the json= section. | |
| request = requests.post('https://api.github.com/graphql', json={'query': query}, headers=headers) | |
| if request.status_code == 200: |
This document attempts to refine Python's PEP 440 to include the principles of Semantic Versioning.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
| import urllib2, csv | |
| import matplotlib.pyplot as plt | |
| import datetime | |
| import seaborn | |
| import numpy, scipy.stats, math | |
| f = urllib2.urlopen('https://raw.githubusercontent.com/datasets/s-and-p-500/master/data/data.csv') | |
| csv = csv.reader(f) | |
| csv.next() # headers |
The attached code file provides an easy basic interface to the Wolfram Alpha API. Inspired by the wolframalpha module available for Python.
source("wa_lib.R")I think the two most important messages that people can get from a short course are:
a) the material is important and worthwhile to learn (even if it's challenging), and b) it's possible to learn it!
For those reasons, I usually start by diving as quickly as possible into visualisation. I think it's a bad idea to start by explicitly teaching programming concepts (like data structures), because the pay off isn't obvious. If you start with visualisation, the pay off is really obvious and people are more motivated to push past any initial teething problems. In stat405, I used to start with some very basic templates that got people up and running with scatterplots and histograms - they wouldn't necessary understand the code, but they'd know which bits could be varied for different effects.
Apart from visualisation, I think the two most important topics to cover are tidy data (i.e. http://www.jstatsoft.org/v59/i10/ + tidyr) and data manipulation (dplyr). These are both important for when people go off and apply
| #' Simplified loading and installing of packages | |
| #' | |
| #' This is a wrapper to \code{\link{require}} and \code{\link{install.packages}}. | |
| #' Specifically, this will first try to load the package(s) and if not found | |
| #' it will install then load the packages. Additionally, if the | |
| #' \code{update=TRUE} parameter is specified it will check the currently | |
| #' installed package version with what is available on CRAN (or mirror) and | |
| #' install the newer version. | |
| #' | |
| #' @param pkgs a character vector with the names of the packages to load. |