Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #98581
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Pete Dowdell <contact@stridebird.com> |
| Newsgroups | comp.lang.python |
| Subject | Re: Extracting and summing student scores from a JSON file using Python 2.7.10 |
| Date | Tue, 10 Nov 2015 09:38:15 +0700 |
| Lines | 17 |
| Message-ID | <mailman.201.1447145509.16136.python-list@python.org> (permalink) |
| References | <1d1610e5-d401-48f2-b5ee-3af91b9e485f@googlegroups.com> <mailman.194.1447115400.16136.python-list@python.org> <a5ad1e84-cd46-44b7-a7d4-ed0f9b74ec92@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=windows-1252; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.uni-berlin.de 305cILpnBQaBCU7bj9YVsARO48ap86bWHo/2be58hEVQ== |
| Return-Path | <contact@stridebird.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.011 |
| X-Spam-Evidence | '*H*': 0.98; '*S*': 0.00; 'subject:Python': 0.05; 'json': 0.05; 'subject:file': 0.07; 'int)': 0.09; 'subject:using': 0.09; 'subject: \n ': 0.15; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:JSON': 0.16; 'subject:student': 0.16; 'url:json': 0.16; 'urllib': 0.16; 'wrote:': 0.16; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'skip:j 20': 0.33; 'list': 0.34; 'received:google.com': 0.35; 'skip:i 20': 0.36; 'received:209.85': 0.36; 'data.': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:209': 0.38; 'received:209.85.220': 0.38; 'subject:from': 0.39; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'skip:u 10': 0.61; 'charset:windows-1252': 0.62; 'from:addr:contact': 0.66; 'now:': 0.72; 'analysis': 0.72; 'scores': 0.91 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=stridebird_com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=JHYH7LQYWEUdsxT6kGch+WHt5XsIr/Zg8IbHi8PsiII=; b=XSelx5B2Z7pV/ApdiMy7nifRA2FDgSkMiSi+ZfzvoSum2sWoUW/eN0BICZBnVOwM9S EVOU0+XONTPSJJXhAtCRZEv+qfe+pgVlNekJU970i2iqGPNoTosLEE4wEgWv3qjCSqDO foty/t1Ur18V//cfA0PRipM5YFNvSZXqZvAOMpC9Hq0Q6M3ySPc6C2/4rV06E6TuV7nM e5kAcDbFBO7iCnsOZ1VF4DGSu9ebvHTDbSFbbcG2iAbbFfF/uKtlFb5iP0ti/7/kL9SQ wR2rkVOTLNjz5aib6zPzuI85ZvbXkBV7FTvklInau/zlPPFGxZcAbbKCM7nRT7f16gQB gZuw== |
| X-Google-DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=JHYH7LQYWEUdsxT6kGch+WHt5XsIr/Zg8IbHi8PsiII=; b=Wc9FlRRI3+l+UsYovc6FVVC2iQ1FXdgxfD1NtXB1sSO8LJrQPT7halRuQzxVHR6NI1 NCUfFm6XzEJbwN2/rlRHQf8qdMjnvU7xtq/Fj2ZHfRkBrXU36grrsQDAd9Ac7ifsjSJL vdEmEMS4a/aK3V9432+9UmNWipCi7vuqn7riElElazufkuqDXBCi2pjwW3+PQOXKg8nn nlMpQ0mbdEp/4t6khWkz0CKu33A7GaJiOpAgPoZens14wvcaUaTNpprk5j0S8jOuHfi5 sSDSKmxLD3qbA5WnOA4hXNDmfldobGYWmcueq6FZ6e4YMMW9emSZA6vGm/Jdd0OqMF5e IrcA== |
| X-Gm-Message-State | ALoCoQkU+nvbJcDiYEJiAR8VAYPZt4DLTT+Q82qz9ABzY77h2fzQv6f1p079OIEcs2S7Jds3zV8Q |
| X-Received | by 10.69.4.5 with SMTP id ca5mr1795052pbd.149.1447123103437; Mon, 09 Nov 2015 18:38:23 -0800 (PST) |
| X-Google-Original-From | Pete Dowdell <pete@stridebird.com> |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
| In-Reply-To | <a5ad1e84-cd46-44b7-a7d4-ed0f9b74ec92@googlegroups.com> |
| X-Mailman-Approved-At | Tue, 10 Nov 2015 03:51:47 -0500 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.20+ |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Xref | csiph.com comp.lang.python:98581 |
Show key headers only | View raw
On 10/11/15 08:12, Bernie Lazlo wrote: > > > import json > > >import urllib > > >url ="http://www.wickson.net/geography_assignment.json" > > >response = urllib.urlopen(url) > > >data = json.loads(response.read()) All good up to data. Now: # make a list of scores scores = [d['score'] for d in data['comments'] if isinstance(d['score'], int) ] # analysis total_scores = sum(scores) average_score= total_scores/float(len(scores)) min_score, max_score = min(scores), max(scores) pd
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Extracting and summing student scores from a JSON file using Python 2.7.10 Bernie Lazlo <bjlazlo@gmail.com> - 2015-11-09 15:52 -0800
Re: Extracting and summing student scores from a JSON file using Python 2.7.10 MRAB <python@mrabarnett.plus.com> - 2015-11-10 00:29 +0000
Re: Extracting and summing student scores from a JSON file using Python 2.7.10 Bernie Lazlo <bjlazlo@gmail.com> - 2015-11-09 17:12 -0800
Re: Extracting and summing student scores from a JSON file using Python 2.7.10 MRAB <python@mrabarnett.plus.com> - 2015-11-10 01:31 +0000
Re: Extracting and summing student scores from a JSON file using Python 2.7.10 Bernie Lazlo <bjlazlo@gmail.com> - 2015-11-09 17:53 -0800
Re: Extracting and summing student scores from a JSON file using Python 2.7.10 MRAB <python@mrabarnett.plus.com> - 2015-11-10 02:13 +0000
Re: Extracting and summing student scores from a JSON file using Python 2.7.10 Pete Dowdell <contact@stridebird.com> - 2015-11-10 09:38 +0700
Re: Extracting and summing student scores from a JSON file using Python 2.7.10 Bernie Lazlo <bjlazlo@gmail.com> - 2015-11-09 19:21 -0800
Re: Extracting and summing student scores from a JSON file using Python 2.7.10 Denis McMahon <denismfmcmahon@gmail.com> - 2015-11-10 03:25 +0000
Re: Extracting and summing student scores from a JSON file using Python 2.7.10 wayne.wickson@gmail.com - 2015-11-09 19:53 -0800
Re: Extracting and summing student scores from a JSON file using Python 2.7.10 Bernie Lazlo <bjlazlo@gmail.com> - 2015-11-10 04:14 -0800
Re: Extracting and summing student scores from a JSON file using Python 2.7.10 Bernie Lazlo <bjlazlo@gmail.com> - 2015-11-10 04:16 -0800
csiph-web