Python Forum
Help with finding correct topic in Python learning
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with finding correct topic in Python learning
#2
that's called unpacking (or iterable unpacking)

long story short - on the right side there is some data structure and values are assign to variables on the left side
in your first example mnist.load_data() shuld return tuple/list of 2 tuples/list with 2 elements each, e.g. ((1, 3), (5, 2)) (just arbitrary numbers for example) and then x_train = 1, y_train=3, x_test=5, y_test=2

check this SO question and accepted answer
https://stackoverflow.com/questions/6967...-unpacking

there is also extended unpacking
https://www.python.org/dev/peps/pep-3132/
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
RE: Help with finding correct topic in Python learning - by buran - Jun-06-2019, 05:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Confusing in [for loop] topic Sherine 11 3,374 Jul-31-2021, 02:53 PM
Last Post: deanhystad
  [split] New thread/topic rajp1497 1 1,844 Sep-24-2020, 01:55 AM
Last Post: micseydel
  Finding Max and Min Values Associated with Unique Identifiers in Python ubk046 1 2,006 May-08-2020, 12:04 PM
Last Post: anbu23
  Python - Most effective way to correct keyboard-user-input. ppel123 8 4,059 Apr-08-2020, 07:41 AM
Last Post: ppel123
  subscribing to kafka topic/key georgelza 10 4,125 Jan-03-2020, 04:58 AM
Last Post: georgelza
  Finding nearest point of a Multidigraph in Python 3.7 stixmagiggins 5 3,659 Aug-24-2019, 08:51 AM
Last Post: ThomasL
  How do I create a actor if I subscribe to a specific topic? sdf1444 0 1,671 Aug-01-2019, 09:29 PM
Last Post: sdf1444
  numpynot associted with correct python version ErnestTBass 17 6,107 Jan-16-2019, 02:47 PM
Last Post: ErnestTBass
  finding problems connecting python to sqlite Dennis 1 2,259 Dec-10-2018, 02:58 PM
Last Post: Larz60+
  Topic Modelling - Document Labels Nicson 0 1,683 Nov-20-2018, 04:56 PM
Last Post: Nicson

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020