In [1]:
a = 5
b = 2a ^2 + 30a + 9


Out[1]:
209

In [5]:
using PyPlot
x = linspace(0,5)
y = cos(2x + 5)
plot(x,y, linewidth=2, linestyle = "--")
title("a nice cosinus")
xlabel("x axis")
ylabel("y axis")


Out[5]:
PyObject <matplotlib.text.Text object at 0x101c83690>

In [6]:
x = 1
y = 2
z = x + y


Out[6]:
3

In [7]:
code_llvm(f, (Int64,))


f not defined
while loading In[7], in expression starting on line 1

In [8]:
typeof(3.14)


Out[8]:
Float64

In [9]:
typeof("x")


Out[9]:
ASCIIString (constructor with 2 methods)

In [10]:
x = "this is a test"
typeof(x)


Out[10]:
ASCIIString (constructor with 2 methods)

In [11]:
y = 7
x + y


`+` has no method matching +(::ASCIIString, ::Int64)
while loading In[11], in expression starting on line 2

In [12]:
x = 3.5
x + y


Out[12]:
10.5

In [13]:
print_with_color(:red, "This is printed in red")


This is printed in red

In [14]:
print_with_colour(:green, "This is green")


print_with_colour not defined
while loading In[14], in expression starting on line 1

In [15]:
print_with_color(:green, "This is green")


This is green

In [1]:
x = 10
x = "hello"


Out[1]:
"hello"

In [2]:
typemax(Int)


Out[2]:
9223372036854775807

In [3]:
s = "Hello, Julia"


Out[3]:
"Hello, Julia"

In [4]:
[1,2,3]


Out[4]:
3-element Array{Int64,1}:
 1
 2
 3

In [7]:
#import Winston
import Gadfly
#Winston.plot(rand(4))
Gadfly.plot(x = [1:10], y = rand(10))


Out[7]:
x -12.5 -10.0 -7.5 -5.0 -2.5 0.0 2.5 5.0 7.5 10.0 12.5 15.0 17.5 20.0 22.5 -10.0 -9.5 -9.0 -8.5 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 12.5 13.0 13.5 14.0 14.5 15.0 15.5 16.0 16.5 17.0 17.5 18.0 18.5 19.0 19.5 20.0 -10 0 10 20 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 -0.20 -0.18 -0.16 -0.14 -0.12 -0.10 -0.08 -0.06 -0.04 -0.02 0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20 0.22 0.24 0.26 0.28 0.30 0.32 0.34 0.36 0.38 0.40 0.42 0.44 0.46 0.48 0.50 0.52 0.54 0.56 0.58 0.60 0.62 0.64 0.66 0.68 0.70 0.72 0.74 0.76 0.78 0.80 0.82 0.84 0.86 0.88 0.90 0.92 0.94 0.96 0.98 1.00 1.02 1.04 1.06 1.08 1.10 1.12 1.14 1.16 1.18 1.20 1.22 1.24 1.26 1.28 1.30 1.32 1.34 1.36 1.38 1.40 1.42 1.44 1.46 1.48 1.50 1.52 1.54 1.56 1.58 1.60 1.62 -1 0 1 2 -0.25 -0.20 -0.15 -0.10 -0.05 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 y

In [8]:
using PyCall
pyeval("10*10")


Out[8]:
100

In [9]:
@pyimport math
math.sin(math.pi / 2)


Out[9]:
1.0

In [10]:
a = 42
clipboard(a)
workspace()
a


a not defined
while loading In[10], in expression starting on line 4

In [11]:
a = clipboard()


Out[11]:
"42"

In [12]:
fname="cofreewy.txt"


Out[12]:
"cofreewy.txt"

In [13]:
data = readdlm(fname, '\t')


Out[13]:
25x4 Array{Any,2}:
   "Hour"   "CO"     "Traffic"    "Wind"
  1.0      2.4     50.0         -0.2    
  2.0      1.7     26.0          0.0    
  3.0      1.4     16.0          0.0    
  4.0      1.2     10.0          0.0    
  5.0      1.2     12.0          0.1    
  6.0      2.0     41.0         -0.1    
  7.0      3.4    157.0         -0.1    
  8.0      5.8    276.0         -0.2    
  9.0      6.8    282.0          0.2    
 10.0      6.6    242.0          1.0    
 11.0      6.6    200.0          2.3    
 12.0      6.3    186.0          3.8    
 13.0      5.8    179.0          4.6    
 14.0      5.5    178.0          5.4    
 15.0      5.9    203.0          5.9    
 16.0      6.8    264.0          5.9    
 17.0      7.0    289.0          5.6    
 18.0      7.4    308.0          4.9    
 19.0      6.4    267.0          3.8    
 20.0      5.0    190.0          2.5    
 21.0      3.8    125.0          1.4    
 22.0      3.5    120.0          0.6    
 23.0      3.3    116.0          0.4    
 24.0      3.1     87.0          0.1    

In [15]:
using DataFrames
data2 = readdlm(fname, separator = '\t')
typeof(data2); size(data2)


unknown option separator
while loading In[15], in expression starting on line 2

 in error at error.jl:21
 in val_opts at datafmt.jl:288
 in readdlm_auto at datafmt.jl:53
 in readdlm at datafmt.jl:49
 in readdlm at datafmt.jl:46

In [16]:
typeof(data)


Out[16]:
Array{Any,2}

In [17]:
using DataFrames

In [18]:
fname = "cofreey.txt"


Out[18]:
"cofreey.txt"

In [19]:
data = readtable(fname)


opening file cofreey.txt: No such file or directory
while loading In[19], in expression starting on line 1

 in systemerror at /Applications/Julia-0.3.11.app/Contents/Resources/julia/lib/julia/sys.dylib
 in open at /Applications/Julia-0.3.11.app/Contents/Resources/julia/lib/julia/sys.dylib (repeats 2 times)
 in readtable at /Users/arindambose/.julia/v0.3/DataFrames/src/dataframe/io.jl:889

In [20]:
fname = "cofreewy.txt"


Out[20]:
"cofreewy.txt"

In [21]:
data = readtable(fname)


Out[21]:
Hour_CO_Traffic_Wind
11 2.4 50 -0.2
22 1.7 26 0.0
33 1.4 16 0.0
44 1.2 10 0.0
55 1.2 12 0.1
66 2.0 41 -0.1
77 3.4 157 -0.1
88 5.8 276 -0.2
99 6.8 282 0.2
1010 6.6 242 1.0
1111 6.6 200 2.3
1212 6.3 186 3.8
1313 5.8 179 4.6
1414 5.5 178 5.4
1515 5.9 203 5.9
1616 6.8 264 5.9
1717 7.0 289 5.6
1818 7.4 308 4.9
1919 6.4 267 3.8
2020 5.0 190 2.5
2121 3.8 125 1.4
2222 3.5 120 0.6
2323 3.3 116 0.4
2424 3.1 87 0.1

In [23]:
data = readtable(fname, separator = "\t")


type: readtable: in typeassert, expected Char, got ASCIIString
while loading In[23], in expression starting on line 1

In [24]:
data


Out[24]:
Hour_CO_Traffic_Wind
11 2.4 50 -0.2
22 1.7 26 0.0
33 1.4 16 0.0
44 1.2 10 0.0
55 1.2 12 0.1
66 2.0 41 -0.1
77 3.4 157 -0.1
88 5.8 276 -0.2
99 6.8 282 0.2
1010 6.6 242 1.0
1111 6.6 200 2.3
1212 6.3 186 3.8
1313 5.8 179 4.6
1414 5.5 178 5.4
1515 5.9 203 5.9
1616 6.8 264 5.9
1717 7.0 289 5.6
1818 7.4 308 4.9
1919 6.4 267 3.8
2020 5.0 190 2.5
2121 3.8 125 1.4
2222 3.5 120 0.6
2323 3.3 116 0.4
2424 3.1 87 0.1

In [25]:
?readtable


INFO: Loading help data...
readtable (generic function with 3 methods)

In [26]:
help(readtable
)


readtable (generic function with 3 methods)

In [27]:
fname2 = "health.csv"


Out[27]:
"health.csv"

In [28]:
using DataFrames
data2 = readtable(fname, separator=",")
typeof(data2)


type: readtable: in typeassert, expected Char, got ASCIIString
while loading In[28], in expression starting on line 2

In [29]:
data2


Out[29]:
HourCOTrafficWind
112.450-0.2
221.7260.0
331.4160.0
441.2100.0
551.2120.1
662.041-0.1
773.4157-0.1
885.8276-0.2
996.82820.2
10106.62421.0
11116.62002.3
12126.31863.8
13135.81794.6
14145.51785.4
15155.92035.9
16166.82645.9
17177.02895.6
18187.43084.9
19196.42673.8
20205.01902.5
21213.81251.4
22223.51200.6
23233.31160.4
24243.1870.1

In [30]:
size(data2)


Out[30]:
(24,4)

In [38]:
using Gadfly
p = plot(data2[:CO], Geom.bar())


`plot` has no method matching plot(::DataArray{Float64,1}, ::BarGeometry)
while loading In[38], in expression starting on line 2

In [37]:
typeof(data2)


Out[37]:
DataFrame (constructor with 11 methods)

In [ ]: