multiplying two array in python3.7Tensorflow neural network TypeError: Fetch argument has invalid typeAppending to numpy array for creating datasetCustom conditional Keras metricTypeError: '<' not supported between instances of 'int' and 'str'The truth value of an array with more than one element is ambiguousHow feed a numpy array in batches in KerasPython: multiplication of sparse matrices slower in csr_matrix than numpy

How to avoid the "need" to learn more before conducting research?

ICO or PNG Format?

A simple stop watch which I want to extend

English - Acceptable use of parentheses in an author's name

Te-form and かつ and も?

Is Texas Instrument wrong with their pin number on TO-92 package?

Are differences between uniformly distributed numbers uniformly distributed?

Sign changes after taking the square root inequality. Why?

Three legged NOT gate? What is this symbol?

A tool to replace all words with antonyms

Can the Action some concentration spells grant be used in Attacks of Opportunity with the War Caster feat?

Can you castle with a "ghost" rook?

CTCI Chapter 1 : Palindrome Permutation

What is the length of pair of wires after twisting them around each other?

Should you play baroque pieces a semitone lower?

Multirow in tabularx?

multiplying two array in python3.7

What gave Harry Potter the idea of writing in Tom Riddle's diary?

How many different ways are there to checkmate in the early game?

Double redundancy for the Saturn V LVDC computer memory, how were disagreements resolved?

On the Rømer experiments and the speed if light

What does Apple mean by "This may decrease battery life"?

How to mark beverage cans in a cooler for a blind person?

Why did Gandalf use a sword against the Balrog?



multiplying two array in python3.7


Tensorflow neural network TypeError: Fetch argument has invalid typeAppending to numpy array for creating datasetCustom conditional Keras metricTypeError: '<' not supported between instances of 'int' and 'str'The truth value of an array with more than one element is ambiguousHow feed a numpy array in batches in KerasPython: multiplication of sparse matrices slower in csr_matrix than numpy






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1












$begingroup$


I am trying to multiply two array in python 3.7 using numpy by using the following syntax:



array1 = np.array([1,2,3,4,5,6,7,8]) 
print (array1)
array2=array1*array1
print(array2)


but this error arises



TypeError: unsupported operand type(s) for *: 'set' and 'set'









share|improve this question









New contributor



Charvi Yadav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






$endgroup$




















    1












    $begingroup$


    I am trying to multiply two array in python 3.7 using numpy by using the following syntax:



    array1 = np.array([1,2,3,4,5,6,7,8]) 
    print (array1)
    array2=array1*array1
    print(array2)


    but this error arises



    TypeError: unsupported operand type(s) for *: 'set' and 'set'









    share|improve this question









    New contributor



    Charvi Yadav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






    $endgroup$
















      1












      1








      1





      $begingroup$


      I am trying to multiply two array in python 3.7 using numpy by using the following syntax:



      array1 = np.array([1,2,3,4,5,6,7,8]) 
      print (array1)
      array2=array1*array1
      print(array2)


      but this error arises



      TypeError: unsupported operand type(s) for *: 'set' and 'set'









      share|improve this question









      New contributor



      Charvi Yadav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      $endgroup$




      I am trying to multiply two array in python 3.7 using numpy by using the following syntax:



      array1 = np.array([1,2,3,4,5,6,7,8]) 
      print (array1)
      array2=array1*array1
      print(array2)


      but this error arises



      TypeError: unsupported operand type(s) for *: 'set' and 'set'






      python numpy






      share|improve this question









      New contributor



      Charvi Yadav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share|improve this question









      New contributor



      Charvi Yadav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share|improve this question




      share|improve this question








      edited 9 hours ago









      Peter

      1,3291 gold badge3 silver badges19 bronze badges




      1,3291 gold badge3 silver badges19 bronze badges






      New contributor



      Charvi Yadav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      asked 10 hours ago









      Charvi YadavCharvi Yadav

      61 bronze badge




      61 bronze badge




      New contributor



      Charvi Yadav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      New contributor




      Charvi Yadav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.

























          1 Answer
          1






          active

          oldest

          votes


















          2












          $begingroup$

          You are simply defining your array so that it is made of python sets. That is a different data structure which is not able to be multiplied, unlike an array.



          Just change your code to this:



          array1 = np.array([[1,2,3,4],[5,6,7,8]])


          The only difference is using square brackets instead of curly ones. These are python list objects (or standard arrays).



          array2=array1*array1 
          print(array2)

          [[ 1 4 9 16]
          [25 36 49 64]]





          share|improve this answer









          $endgroup$

















            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "557"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );






            Charvi Yadav is a new contributor. Be nice, and check out our Code of Conduct.









            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f57393%2fmultiplying-two-array-in-python3-7%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2












            $begingroup$

            You are simply defining your array so that it is made of python sets. That is a different data structure which is not able to be multiplied, unlike an array.



            Just change your code to this:



            array1 = np.array([[1,2,3,4],[5,6,7,8]])


            The only difference is using square brackets instead of curly ones. These are python list objects (or standard arrays).



            array2=array1*array1 
            print(array2)

            [[ 1 4 9 16]
            [25 36 49 64]]





            share|improve this answer









            $endgroup$



















              2












              $begingroup$

              You are simply defining your array so that it is made of python sets. That is a different data structure which is not able to be multiplied, unlike an array.



              Just change your code to this:



              array1 = np.array([[1,2,3,4],[5,6,7,8]])


              The only difference is using square brackets instead of curly ones. These are python list objects (or standard arrays).



              array2=array1*array1 
              print(array2)

              [[ 1 4 9 16]
              [25 36 49 64]]





              share|improve this answer









              $endgroup$

















                2












                2








                2





                $begingroup$

                You are simply defining your array so that it is made of python sets. That is a different data structure which is not able to be multiplied, unlike an array.



                Just change your code to this:



                array1 = np.array([[1,2,3,4],[5,6,7,8]])


                The only difference is using square brackets instead of curly ones. These are python list objects (or standard arrays).



                array2=array1*array1 
                print(array2)

                [[ 1 4 9 16]
                [25 36 49 64]]





                share|improve this answer









                $endgroup$



                You are simply defining your array so that it is made of python sets. That is a different data structure which is not able to be multiplied, unlike an array.



                Just change your code to this:



                array1 = np.array([[1,2,3,4],[5,6,7,8]])


                The only difference is using square brackets instead of curly ones. These are python list objects (or standard arrays).



                array2=array1*array1 
                print(array2)

                [[ 1 4 9 16]
                [25 36 49 64]]






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 7 hours ago









                n1k31t4n1k31t4

                8,0112 gold badges6 silver badges27 bronze badges




                8,0112 gold badges6 silver badges27 bronze badges























                    Charvi Yadav is a new contributor. Be nice, and check out our Code of Conduct.









                    draft saved

                    draft discarded


















                    Charvi Yadav is a new contributor. Be nice, and check out our Code of Conduct.












                    Charvi Yadav is a new contributor. Be nice, and check out our Code of Conduct.











                    Charvi Yadav is a new contributor. Be nice, and check out our Code of Conduct.














                    Thanks for contributing an answer to Data Science Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    Use MathJax to format equations. MathJax reference.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f57393%2fmultiplying-two-array-in-python3-7%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

                    Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

                    Ласкавець круглолистий Зміст Опис | Поширення | Галерея | Примітки | Посилання | Навігаційне меню58171138361-22960890446Bupleurum rotundifoliumEuro+Med PlantbasePlants of the World Online — Kew ScienceGermplasm Resources Information Network (GRIN)Ласкавецькн. VI : Літери Ком — Левиправивши або дописавши її