我有一堆潘达的数据帧。我想要在HTML中查看它们(也想要json)。所以,我就是这么做的
json文件如下:{"A":1458000000000,"B":300,"C":1,"sid":101,"D":323.4775570025,“得分”:0.0726},{"A":1458604800000,"B":6767,"C":1,"sid":101,"D":321.8098393263,“得分”:0.9524},{"A":1458345600000,"B":9999,"C":3,"sid":29987,"D":125.6096891766,“得分”:0.9874},{"A":1457827200000,"B":3110,"C":2,"sid":787623,"D":3010.9544668798,“分数”:0.0318}
我面临的问题是: pd.to_json输出一个[]格式的jsonfile。就像一张单子。我无法使用这个json文件来加载。如下所示:
with open(jsonFile) as json_data:
js = json.load(json_data)
htmlStr = json2html.convert(json = js)
return htmlStr
有办法像上面那样加载json文件并转换成html吗?
发布于 2016-08-24 20:41:54
为什么不使用pandas.DataFrame.to_html?(html.html)
https://stackoverflow.com/questions/39132052
复制相似问题