« first day (2898 days earlier)      last day (2051 days later) » 

12:14 AM
hello all!
 
hi @payne
 
I have a problem with shapes and numpy
I have a <class 'numpy.ndarray'> that contains 32 <class 'numpy.ndarray'> of shape (350,350,3).
How do I convert that to a single <class 'numpy.ndarray'> of dimension (32,350,350,3) ?
 
def function(1,2,...,32): joking
 
I mean, if it's what it takes...
I lost 1 hour trying to do it
latests attemp:
ValueError: cannot reshape array of size 32 into shape (350,350,3)
 
are those 32 items all the same?
 
12:22 AM
"Python with braces" eww...
 
@Alucard yes
well, "same" as in the same shape, but they aren't exactly the same (their number values differ)
it's basically 32 images
 
@payne The total number of elements in the array must be the same before and after changing the shape. 350x350x3 elements is waaaaaaaaaaay more than 32.
 
oh
but why can't it understand that the 32 arrays inside the one array can be all merged into a single array ?
:(
 
why do you have an array of arrays? Can you put all the data into a single array to begin with?
you should show a minimal working code example in order to get any help
 
anyone here having experience in making executables (in other languages too) for windows?
if so: is python good in this compared to other languages?
 
12:40 AM
some other dude figured it out
it,s because I was filling an array with 2 different types of images
and LATER ON splitting it in half so that each half had exactly same dimension of images
but that would screw with numpy and prevent it from reducing the dimension
X_train = np.array([x for x in X_train]) <- that fixed it
 
cbg all
 
another blooddrinker :D
 
Indeed I am :P
 
@Alucard python is usually run as interpreted. I'm sure there are compilers that create an executable but this isn't the typical path for python progams
 
Well I have a question related to Python (I mean, makes sense seeing as this is a Python chat) but I wanted to ask for permission to ask, because I don't want to spam either
 
12:48 AM
@payne yah, that seems like the right solution. Put all of your data into a numpy array from the beginning.
 
@Code-Apprentice Also I know a very good Python compiler is anyone here is interested
 
@SaltyHelpVampire you will probably get more traction by posting on the main site...at least if it's an on-topic quesiton
 
@Code-Apprentice Makes sense. Wanted to ask here because the official question I made was largely ignored and not very well formulated
 
@Code-Apprentice so, python is comparable to java, in that it needs something installed on the machine in order to run? or is it severe different?
 
@Alucard In that regard, I think it is quite similar. Biggest difference there is that not many people have IDLE on their computers
 
12:54 AM
@SaltyHelpVampire "...and not very well formulated" sounds like you need to edit the question in order to formulate it better
 
i used to use codeblocks while i made a journy with c++ and compiling was easy even as a beginner
 
@Code-Apprentice Touchée. The thing is that I think there is a similar question (if not almost the exact same one) but since I was unable to replicate it and was searching for a simpler method and I glossed over it. I might even delete my question, but it got two upvotes so idk
 
@Alucard Yes, that similarity is true. Java is still a compiled language. The Java code you write is compiled into bytecode that runs on a Java Virtual Machine (the "something installed on the machine in order to run"). On the other hand, Python is an interpreted language. You usually copy your python code directly onto the machine where you want to run it. That machine must also have a python interpreter installed.
@SaltyHelpVampire keep working at it. Sometimes you have to read a question and answer several times in order to adapt it to your specific situation.
@Alucard python is different than C++. With C++, you compile your code to an executable and copy that file to another machine with the same operating system to run it.
 
@Code-Apprentice Thx :D. If I'll try a few things and if I struggle I'll come back here :P
 
and what is the future of programming? i mean with all the smartphones and so on
smartphones capable of things that pcs can
no problem to write in python and still target smartphones right?
 
1:11 AM
currently it is difficult to deploy a native app that is written in Python because you have to include the runtime. This can make your app file size quite large for even the most simplest app.
I mean it's possible to do, but I don't know of any big-name apps that do it. App development is done either with the native API (Java or Kotlin for Android, Objective-C or Swift for iOS) or with cross-platform tools like Xamarin or React Native.
 
@Code-Apprentice Got it to work at the end, so I am indeed very glad. Thx for all the help. I am leaving soon, but I hope to find you around here when I join :D
 
1:39 AM
@SaltyHelpVampire you can answer your own questions
 
 
3 hours later…
4:59 AM
cabbage
 
cbg
 
@Code-Apprentice How often and when do you do your Android programming streams?
 
 
4 hours later…
9:22 AM
Should this be reopened? I think that dupe is awful
 
9:46 AM
@Aran-Fey IMO, nope. There's already an answer there, plus the dupe's 2nd answer is quite short n sweet (for this Q).
yeah, nothing directly answers this question, but I guess the title of the dupe question does :-p
 
alright
 
10:04 AM
@davidism Congrats on acquiring the Mjölnir.
6
 
11:01 AM
@SaltyHelpVampire you should read our room rules, which tells you 1. there's no need to ask whether it's OK to ask, also 2. when it's OK to ask
 
11:12 AM
brief cbg
 
cbg
 
@AndrasDeak I did indeed read them, I just forgot about that part. Sorry. I thought since I had already asked the question and I didn't want to send the link due to it being a simple question that it was better to ask for permission. I'll re-read them, I guess
 
Welcome back
 
no worries
 
11:22 AM
@AndrasDeak Thx for reminding me tho. I just have doubts about the question as well. At this point I think it is a duplicate. I guess I'll delete it
 
duplicates aren't inherently bad
if you have an answer then deleting counts against you
 
@AndrasDeak I got no answers, but I do have two upvotes
 
if it's not an exact duplicate, you should keep it.
if you are unsure, you should keep it.
 
yup, even exact dupes can help with different phrasing
 
@shad0w_wa1k3r I'll check if meets all of this criteria and will edit acordingly
 
11:27 AM
And IMO you are taking all the rules too rigidly, you should loosen up a bit :) (But given your name, there might be some related history, anyway, just my 2 cents satoshis)
 
@shad0w_wa1k3r There is indeed a reason behind the name :P
Also thx, I feel like this is a professional website to ask for programming doubts so I try to formulate my questions as well as I can, so sometimes I might be too rigid with rules
cbg
 
11:44 AM
can't hurt to be too careful
 
@AndrasDeak That is true indeed, it's better than not being careful at all. I have been too fast to ask sometimes and I have gotten downvotes and such for it (which were deserved by the way, I'm just pointing it out)
 
yup
 
 
3 hours later…
2:40 PM
@RichieBendall I usually stream on the weekends, Saturday and/or Sunday. I took last week off, though.
occasionally I'll do a Friday evening. Weekday evenings are pretty rare
 
3:12 PM
cbg
 
3:29 PM
Seems that Visual Studio support for Python has some interesting quirks
 
3:40 PM
Hello guys, I have a question, if we return list to a function and want to iterate through that list in another function, how to unpack them?
 
What do you mean by unpack?
 
@KaranM That's a bit too vague sorry. Do you have an example?
 
I have read unpacking the list by using * operator
 
That doesn't seem to be related to what you asked?
 
it is relatable, I cant iterate through all the items in the list
 
3:43 PM
Can you provide an MCVE? What input you expect, what code handles that input, and what output you expect out of that code.
 
@shad0w_wa1k3r it's the OP's question and it's less than 2 days old btw
 
Yeah, but I am supposing they are happy with the answer and trying to figure out something else (which may be closely related to the Q, but not necessarily so)
 
Anyone know a good dupe for "Why is my returned variable not defined?" questions?
def func():
    x = 5
    return x

func()
print(x)
 
Was a "just sayin'"moment :)
 
I also checked the question :-p
 
DSM
3:48 PM
@PM2Ring: I was interested in that random sequence question so I wrote up a uniform sampling approach.
 
cbg-noon
what are the best alternatives to pycharm?
 
I use Atom Editor and a terminal :-p
 
I use Spyder and have a love-hate relationship with it, but it's certainly not a drop-in replacement to PyCharm
 
^ closed
 
Thanks
 
4:06 PM
cbg
 
recbg
 
4:51 PM
Anyone know of a good resource, or have experience with building a program in python, compiling it to a portable exe, and getting it to register/run as a windows service?
I have already written a program that runs great as a .exe when added to the startup items, but this last piece is killing me
 
yeah, windows that to you some times :-p
 
rb folks / see ya
 
5:42 PM
@DSM Oh, good. I think I understand your answer... well, most of it. :) I'll have to let my brain digest it a bit longer. It's a pity that OEIS doesn't give an algorithm for generating those sequences.
 
user8729657
6:07 PM
Is flask a webserver?
 
6:29 PM
recbg
 
@user3483203 You should undelete that Counter answer. It's still useful if someone has a normal dict rather than a Counter
 
 
2 hours later…
DSM
8:07 PM
@Code-Apprentice thanks, I'll have a look!
 
I wish "fix my code for me" debugging questions weren't allowed on SO. So much useless content...
 
I often comment with a link to eric leipert's debugging blog article
@DSM a future release will have a much better example data set
 
cbg
 
9:01 PM
cbg
 
 
1 hour later…
10:31 PM
cbg
after a long time I come.
 
hello
 
Hey @AndrasDeak
 
@AbhishekBhatia You've been here a lot. Don't ask about your new questions here in parallel. Reread the room rules if you've forgotten.
 
I should leave.
 
11:00 PM
I guess I forgot it.
 

« first day (2898 days earlier)      last day (2051 days later) »