In [3]:
# -------1---------2---------3---------4---------5---------6---------7

In [1]:
%%bash

curl -XPUT 'http://search-01.ec2.internal:9200/gsod/_mapping' -d '
{
    "observation": {
        "properties": {
            "Dew Point": { "type": "double" }
        }
    }
}'


{"error":"ActionRequestValidationException[Validation Failed: 1: mapping type is missing;]","status":400}
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   216  100   105  100   111  15346  16223 --:--:-- --:--:-- --:--:-- 22200

In [3]:
%pylab inline


Populating the interactive namespace from numpy and matplotlib

In [2]:
%load_ext rmagic


/usr/local/anaconda/lib/python2.7/site-packages/IPython/extensions/rmagic.py:693: UserWarning: The rmagic extension in IPython is deprecated in favour of rpy2.ipython. If available, that will be loaded instead.
http://rpy.sourceforge.net/
  warnings.warn("The rmagic extension in IPython is deprecated in favour of "

In [4]:
import numpy as np
A = np.arange(20)
print(np.mean(A))


9.5

In [5]:
N = 15
x1 = [49., 50, 45, 53, 69, 73, 35, 40, 36, 30, 49, 36, 73, 61, 74]
Y = [ 132.03, 98.64, 146.24, 97.9, 145.12, 191.78, 155.34, 123.08, 140.87,
      122.51, 146.08, 89.3, 134.52, 89.16, 136.08]

In [7]:
%%R -i x1,Y -o X
XYfit = lm(Y~x1)
X = model.matrix(XYfit)

In [8]:
X


Out[8]:
<Matrix - Python:0x7fdc4fe42e18 / R:0x3e07fc0>
[1.000000, 1.000000, 1.000000, ..., 73.000000, 61.000000, 74.000000]