Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8799961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:27:47+00:00 2026-06-14T00:27:47+00:00

I am trying to extract needed data from JSON data from Open weather maps

  • 0

I am trying to extract needed data from JSON data from Open weather maps API in Python (2.7)!
JSON file looks something like this.

{u'calctime': 0.0331,
 u'cnt': 2,
 u'cod': u'200',
 u'list': [{u'clouds': {u'all': 75},
            u'coord': {u'lat': 45.551109, u'lon': 18.69389},
            u'distance': 0.001,
            u'dt': 1351870200,
            u'id': 3193935,
            u'main': {u'humidity': 93,
                      u'pressure': 1008,
                      u'temp': 287.15,
                      u'temp_max': 291.18,
                      u'temp_min': 287.15},
            u'name': u'Osijek',
            u'weather': [{u'description': u'broken clouds',
                          u'icon': u'04d',
                          u'id': 803,
                          u'main': u'Clouds'}],
            u'wind': {u'deg': 70, u'speed': 4.6}},
           {u'clouds': {u'all': 75},
            u'coord': {u'lat': 45.568611, u'lon': 18.61389},
            u'distance': 6.526,
            u'dt': 1351870200,
            u'id': 3187657,
            u'main': {u'humidity': 93,
                      u'pressure': 1008,
                      u'temp': 285.43,
                      u'temp_max': 287.15,
                      u'temp_min': 282.15},
            u'name': u'Visnjevac',
            u'weather': [{u'description': u'light intensity shower rain',
                          u'icon': u'09d',
                          u'id': 520,
                          u'main': u'Rain'}],
            u'wind': {u'deg': 70, u'speed': 4.6}}],
 u'message': u'Model=GFS-OWM, '}

This is weather data for two geographical points. I know how to extract single data from the both points (for example humidity or temperature) by using json package but problem is that I can not extract multiple data of the same type put from different geographical points. In this example I want to extract/print names of those points (osijek, visnjevac).

Is there a way to that with json encoder/decder?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:27:48+00:00Added an answer on June 14, 2026 at 12:27 am

    What you have is not JSON, it is a Python object, so I am assuming you already passed the original JSON string through json.loads() or something similar.

    To extract the 'name' values for each dictionary in the list of cities, you can use the following:

    names = [city['name'] for city in data['list']]
    

    Result:

    >>> names
    [u'Osijek', u'Visnjevac']
    

    The assumes you have the content from your post in the variable data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to extract data from xml file that looks like this (see
I am trying to extract a section of text that looks something like this:
im trying to extract some files from a jar-file downloaded using java-webstart. below code
I'm trying to extract all the unique characters from my utf-8 French dictionary file
hi i'm trying to extract values from this tagged file here is the file
I'm trying to extract movies metadata (title and year) from their file name. The
I'm trying to extract specific fields from my file. Basically, output fields only containing
I am trying to retrieve the text data from an ePub file using Java.
I'm trying to extract a zip file from a TMemoryStream to another TMemoryStream using
I have limited experience with JSON, and am trying to extract image URLs from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.