In [14]:
import time
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline

In [4]:
"test{}".format("AA")


Out[4]:
'testAA'

In [5]:
365/7.0*5


Out[5]:
260.7142857142857

In [7]:
dates = pd.date_range('2010-01-22',"2010-01-26")

In [8]:
dates[0]


Out[8]:
Timestamp('2010-01-22 00:00:00', offset='D')

In [9]:
df1 = pd.DataFrame(index=dates)

In [10]:
pd.read_csv("",index_col=["Date"parse_dates=True,usecols=["Date","Adj Close"])
df1.rename(),


Out[10]:
2010-01-22
2010-01-23
2010-01-24
2010-01-25
2010-01-26

In [19]:
df1.fillna(0)


Out[19]:
2010-01-22
2010-01-23
2010-01-24
2010-01-25
2010-01-26

In [18]:
pd.concat([1,2,2,2,3],[1,2,3,4,5])


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-18-628a6a92ec7b> in <module>()
----> 1 pd.concat([1,2,2,2,3],[1,2,3,4,5])

/home/h6/anaconda/lib/python2.7/site-packages/pandas/tools/merge.pyc in concat(objs, axis, join, join_axes, ignore_index, keys, levels, names, verify_integrity, copy)
    752                        keys=keys, levels=levels, names=names,
    753                        verify_integrity=verify_integrity,
--> 754                        copy=copy)
    755     return op.get_result()
    756 

/home/h6/anaconda/lib/python2.7/site-packages/pandas/tools/merge.pyc in __init__(self, objs, axis, join, join_axes, keys, levels, names, ignore_index, verify_integrity, copy)
    803         for obj in objs:
    804             if not isinstance(obj, NDFrame):
--> 805                 raise TypeError("cannot concatenate a non-NDFrame object")
    806 
    807             # consolidate

TypeError: cannot concatenate a non-NDFrame object

In [25]:
df1 = pd.DataFrame(np.random.randn(4,5))

In [26]:
df1


Out[26]:
0 1 2 3 4
0 -0.812504 0.850178 0.215251 0.030075 1.053832
1 0.435357 0.730535 0.572815 0.585009 -1.183603
2 0.127696 -0.828830 -0.186443 -0.316630 0.466003
3 -1.972530 -0.917138 -0.345931 0.691864 0.823518

In [39]:
df1.ix[:-1]


Out[39]:
0 1 2 3 4

In [42]:
df1.values[1,1] = 1

In [43]:
df1


Out[43]:
0 1 2 3 4
0 -0.812504 0.850178 0.215251 0.030075 1.053832
1 0.435357 1.000000 0.572815 0.585009 -1.183603
2 0.127696 -0.828830 -0.186443 -0.316630 0.466003
3 -1.972530 -0.917138 -0.345931 0.691864 0.823518

In [45]:
np.sqrt(252)*(0.001-0.0002)/0.001


Out[45]:
12.699606293110037

In [ ]:
np.sqrt()