Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #98564

Re: Extracting and summing student scores from a JSON file using Python 2.7.10

Path csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From MRAB <python@mrabarnett.plus.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 00:29:50 +0000
Lines 16
Message-ID <mailman.194.1447115400.16136.python-list@python.org> (permalink)
References <1d1610e5-d401-48f2-b5ee-3af91b9e485f@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de CfJXXVmVFQHoSSr2HQhTZwyl7jA3V0sP0jiAPUT3ydGQ==
Return-Path <python@mrabarnett.plus.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; 'json': 0.05; 'subject:file': 0.07; 'subject:using': 0.09; 'subject: \n ': 0.15; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'received:192.168.1.4': 0.16; '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; 'student': 0.20; 'skip:= 20': 0.22; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'appreciated.': 0.27; 'print': 0.30; 'code': 0.30; 'problem': 0.33; 'skip:j 20': 0.33; 'step': 0.36; 'but': 0.36; 'list,': 0.36; 'should': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'data': 0.39; 'subject:from': 0.39; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'skip:u 10': 0.61; 'back': 0.62; 'hours': 0.65; 'scores': 0.91
X-CM-Score 0.00
X-CNFS-Analysis v=2.1 cv=CvRCCSMD c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=EBOSESyhAAAA:8 a=IkcTkHD0fZMA:10 a=vFvQ7Ah-AAAA:8 a=Nixn36yd0z7z_p3crzwA:9 a=QEXdDO2ut3YA:10
X-AUTH mrabarnett@:2500
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
In-Reply-To <1d1610e5-d401-48f2-b5ee-3af91b9e485f@googlegroups.com>
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:98564

Show key headers only | View raw


On 2015-11-09 23:52, Bernie Lazlo wrote:
> This should be a simple problem but I have wasted hours on it. Any help would be appreciated. [I have taken my code back to almost the very beginning.]
> ========================
> The student scores need to be summed.
> ========================
> import json
> import urllib
> url = "http://www.wickson.net/geography_assignment.json"
> response = urllib.urlopen(url)
> data = json.loads(response.read())
> lst1 = list(data.items())
> print lst1
>
Do it a step at a time.

It's a list, so start with indexing.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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