Skip to content

convert string to pandas dataframe #16

@MasterGeorge

Description

@MasterGeorge

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions