In [1]:
import requests
import pandas as pd

In [2]:
price = pd.read_csv('d:/data/price.txt', index_col=0)

In [3]:
price.head()


Out[3]:
open close high low volume money change
2013-12-09 5.46 5.46 5.50 5.43 6209948.0 33837888.0 NaN
2013-12-10 5.47 5.42 5.51 5.40 7074551.0 38507928.0 -0.007326
2013-12-11 5.39 5.29 5.41 5.25 8341736.0 44297016.0 -0.023985
2013-12-12 5.28 5.29 5.31 5.23 6160861.0 32461552.0 0.000000
2013-12-13 5.23 5.25 5.29 5.22 4770927.0 25088916.0 -0.007561

In [4]:
price.info()


<class 'pandas.core.frame.DataFrame'>
Index: 1000 entries, 2013-12-09 to 2018-01-09
Data columns (total 7 columns):
open      1000 non-null float64
close     1000 non-null float64
high      1000 non-null float64
low       1000 non-null float64
volume    1000 non-null float64
money     1000 non-null float64
change    999 non-null float64
dtypes: float64(7)
memory usage: 62.5+ KB

In [5]:
price.index


Out[5]:
Index(['2013-12-09', '2013-12-10', '2013-12-11', '2013-12-12', '2013-12-13',
       '2013-12-16', '2013-12-17', '2013-12-18', '2013-12-19', '2013-12-20',
       ...
       '2017-12-26', '2017-12-27', '2017-12-28', '2017-12-29', '2018-01-02',
       '2018-01-03', '2018-01-04', '2018-01-05', '2018-01-08', '2018-01-09'],
      dtype='object', length=1000)

In [6]:
price.insert(0, 'code', '600111')

In [7]:
price.head()


Out[7]:
code open close high low volume money change
2013-12-09 600111 5.46 5.46 5.50 5.43 6209948.0 33837888.0 NaN
2013-12-10 600111 5.47 5.42 5.51 5.40 7074551.0 38507928.0 -0.007326
2013-12-11 600111 5.39 5.29 5.41 5.25 8341736.0 44297016.0 -0.023985
2013-12-12 600111 5.28 5.29 5.31 5.23 6160861.0 32461552.0 0.000000
2013-12-13 600111 5.23 5.25 5.29 5.22 4770927.0 25088916.0 -0.007561

In [14]:
txt = price.to_csv(header=None)
r = requests.post('http://140.143.195.110:9999/add', data=txt)

In [ ]: