☰
Login
Signup
Home
›
General
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Register
Categories
Recent Discussions
Activity
Categories
13.8K
All Categories
0
Incidents
152
Node JS client
39
Go client
792
.Net API client
378
Kite Publisher
537
.Net / VBA / Excel (3rd party)
457
Algorithms and Strategies
992
Java client
1.1K
API clients
402
PHP client
4K
Python client
346
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.3K
General
In this Discussion
July 2016
sudheer1990
July 2016
Kailash
conversion of historical data of a stock to data-frame (like in R) or two dimensional array
sudheer1990
July 2016
in
General
I am using historical api provided by Kite, and fetching data in below way
data = urllib.request.urlopen(url).read()
print(data)
output
b'{"status": "success", "data": {"candles": [["2016-03-01T09:15:00+0530",1199,1243.35,1195,1232.9,150747],["2016-03-02T09:15:00+0530",1240,1259.8,1233.9,1243.25,140876],["2016-03-03T09:15:00+0530",1245.7,1259.8,1233,1254.15,226023],["2016-03-04T09:15:00+0530",1255,1256,1232,1239.35,189317],["2016-03-08T09:15:00+0530",1239.1,1254.95,1231.1,1241.15,151748],["2016-03-09T09:15:00+0530",1237.3,1249.7,1233.25,1243.75,304618],["2016-03-10T09:15:00+0530",1248,1250,1226.1,1230.35,157799]]}}'
I want to convert these data into data-frame (time, open, low, high, close ) or 2 D array
kindly tell how to do ?
Kailash
July 2016
@sudheer1990
this is JSON. You can use any JSON parsing library (every programming language has one), and loop through the ->data->candles[] array and print the values in whatever format you want.
sudheer1990
July 2016
edited July 2016
got it ....thank you. I fixed this issue using Json library
Sign In
or
Register
to comment.