'Trying to read in an Amazon review dataset through Python
I am trying to read in a Amazon dataset with the following code:
def parse(path):
g = gzip.open(path, 'r')
for l in g:
yield eval(l)
import pandas as pd
import gzip
def parse(path):
g = gzip.open(path, 'rb')
for l in g:
yield eval(l)
def getDF(path):
i = 0
df = {}
for d in parse(path):
df[i] = d
i += 1
return pd.DataFrame.from_dict(df, orient='index')
df = getDF('Electronics.json.gz')
Unfortunately I get the following error:
NameError: name 'true' is not defined
Does anoyone know what the reason of this error is? I downloaded the file from the following page: https://jmcauley.ucsd.edu/data/amazon/
Kind regards,
Tim
Solution 1:[1]
Ok, it was not Bootstrap nor JQuery fault.. I found this piece of code:
$('[data-dismiss=modal]').on('click', function (e) {
var $t = $(this),
target = $t[0].href || $t.data("target") || $t.parents('.modal') || [];
$(target)
.find("input,textarea,select")
.val('')
.end()
.find("input[type=checkbox], input[type=radio]")
.prop("checked", "")
.end();
})
The key part is related to the Jquery selector "[data-dismiss=modal]" that seems related to bootstrap. Here you can find something about it.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | leotato008 |
