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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:58:25+00:00 2026-06-16T13:58:25+00:00

I am using the maths package SAGE, which is written in Python. I am

  • 0

I am using the maths package SAGE, which is written in Python.

I am trying to manipulate some sets of vectors and I keep on getting the above error message. I have absolutely no idea what it is telling me, although I do understand what mutable means Can someone please explain in fairly simple conceptual terms what it is telling me is wrong?

  • 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-16T13:58:27+00:00Added an answer on June 16, 2026 at 1:58 pm

    It means that Python cannot use the content of ‘vectors’ to build a set, because the ‘vector object’ is just a ‘pointer’ to its content: the content is not ‘fixed’ and you can change it re-using the same vector vatiable (Python would have to rebuild the set to keep it working).

    So, you can use ‘set’ only of immutable objects (like tuples, strings, numbers).

    E.g.

    >>> l1 = [1, 2, 3]
    >>> l2 = [3, 4, 5]
    >>> set([l1, l2])
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: unhashable type: 'list'
    

    This is because you can change l1 and l2 (e.g. with .append).

    >>> t1 = (1, 2, 3)
    >>> t2 = (3, 4, 5)
    >>> set([t1, t2])
    set([(3, 4, 5), (1, 2, 3)])
    

    In this case you cannot change the content of t1 and t2.

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

Sidebar

Related Questions

I am using sage maths (which uses Python(more or less)) to do some work
I'm trying to convert some data from long to wide using the reshape2 package,
I have Python 2.7 running and trying to install scipy by using easy_install which
I'm looking into speeding up my python code, which is all matrix math, using
I am using a package written on top of XeLaTeX. This package uses fontspec
I am trying to do a little bit of math using dates in PHP.
I have been using findAssoc() with textmining ( tm package) but realized that something
I'm trying to create a simple user - role management project using asp.net mvc3
Python throws this when using the wolfram alpha api: Traceback (most recent call last):
I'm using the matplotlib candlestick module which requires the time to be passed as

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.