LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-29-2023, 10:41 AM   #1
centguy
Member
 
Registered: Feb 2008
Posts: 635
Blog Entries: 1

Rep: Reputation: 48
numpy.reshape takes a sequence of integers or a tuple?


print( y.reshape( 3,4 ) == y.reshape( (3,4)) )

shows that a 3x4 matrix of True.

Why does python treat y.reshape( 3,4 ) as legitimate?

I thought the argument must be a tuple.
 
Old 10-29-2023, 05:04 PM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,874
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
What documentation do you use?
Something like this?: https://numpy.org/doc/stable/referen....reshape.html#
 
Old 10-29-2023, 09:28 PM   #3
centguy
Member
 
Registered: Feb 2008
Posts: 635

Original Poster
Blog Entries: 1

Rep: Reputation: 48
Post

I looked up that page. It is not clear about the non-tuple part, yet in practice it works.

I do not find any good documentation about this yet. (and stack overflow sometimes is very unkind for silly questions).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
append integers until total is x integers razorcbl Linux - Newbie 7 03-12-2014 02:29 PM
Any way to make mdadm (raid-5) reshape run faster? MikeyCarter Linux - Software 1 08-28-2011 08:28 PM
LXer: Light and Cheap, Netbooks Are Poised to Reshape PC Industry LXer Syndicated Linux News 1 04-03-2009 07:28 AM
LXer: Debian founder wants to 'reshape' OpenSolaris LXer Syndicated Linux News 0 03-07-2008 07:50 AM
How to read a sequence of integers from console? ArthurHuang Programming 5 10-30-2007 02:55 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration