Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert string to pandas dataframe #16

Open
MasterGeorge opened this issue Feb 2, 2019 · 0 comments
Open

convert string to pandas dataframe #16

MasterGeorge opened this issue Feb 2, 2019 · 0 comments

Comments

@MasterGeorge
Copy link

I have this code:

import requests
import json as JSON
import pandas as pd

item = "BTC-LTC"
url = "https://bittrex.com/Api/v2.0/pub/market/GetTicks?marketName="+item+"&tickInterval=fiveMin"
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}
response = requests.get(url, headers=headers)
print (response.content)

this is the result:

{"success":true,"message":"","result":[{"O":0.00884499,"H":0.00884499,"L":0.00884499,"C":0.00884499,"V":4.93801966,"T":"2019-01-13T02:45:00","BV":0.04367673},{"O":0.00884499,"H":0.00884499,"L":0.00884499,"C":0.00884499,"V":2.06198034,"T":"2019-01-13T02:50:00","BV":0.01823818},{"O":0.00886499,"H":0.00887511,"L":0.00886499,"C":0.00887511,"V":7.10660996,"T":"2019-01-13T02:55:00","BV":0.06300412},

how do i convert this string to json format or pandas dataframe for later use ?
notice that this is a response<200> from html and give me a string, and i neet to conver it to a python dict JSON OR PANDAS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant