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 7408543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:56:08+00:00 2026-05-29T05:56:08+00:00

I have this array of JSON: [{‘pk’: 4L, ‘model’: u’logic.member’, ‘fields’: {‘profile’: 3L, ‘name’:

  • 0

I have this array of JSON:

[{'pk': 4L, 'model': u'logic.member', 'fields': {'profile': 3L, 'name': u'1', 'title': u'Mr', 'dob': datetime.date(1983, 1, 1), 'lastname': u'jkjk', 'redressno': u'jdsfsfkj', 'gender': u'm'}}, {'pk': 5L, 'model': u'logic.member', 'fields': {'profile': 3L, 'name': u'2', 'title': u'Mr', 'dob': datetime.date(1983, 1, 1), 'lastname': u'jkjk', 'redressno': u'jdsfsfkj', 'gender': u'm'}}]

I want to make separate array of JSON for only fields property.

What I tried is:

memarr=[] 

       for index,a in data1:
          print index
          print a
          memarr[index]=a[index].fields

And it is giving an error of:

too many values to unpack

Please correct.

  • 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-05-29T05:56:09+00:00Added an answer on May 29, 2026 at 5:56 am

    First of all, data1 is a list, so you can’t unpack it into 2 variables.

    If you want the index, you have to use something like enumerate.

    Second, you can’t assign to a list via indexing if the key doesn’t exist. You have to append or use another valid list insert method.

    Third, a[index].fields doesn’t really make sense – there is no key in a that would be associated with an integer index and fields is not an attribute.

    You’re probably looking for something like this:

    memarr = []
    for index, a in enumerate(data1):
        memarr.append(a['fields'])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JSON array like this: { forum:[ { id:1, created:2010-03-19 , updated:2010-03-19
i have this json structure and I made it into an array. I was
I have this JSON array // Json array var productList = {products: [ {description:
I have a json array in my Particles controller that looks like this after
Possible Duplicate: PHP : Create array for JSON I have an array like this
I have this following method that connectss to db and returns a json array.
I Have a json array like [{name:A,value:A},{name:B,value:B},{name:C,value:C}] How can i pass(to the backend) and
I am trying to deserialize this JSON array into my android project. [{Name:Ban,Price:1},{Name:Banana,Price:1},{Name:chicken,Price:14},{Name:pizza,Price:16},{Name:slice,Price:1}] I
I have this Array i wrote a function MostFreq that takes an array of
I have this array in PHP: array( [0] => array( 'username' => 'user1' )

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.