« first day (3703 days earlier)      last day (1228 days later) » 

3:13 AM
i did have found my problem... i had a folder named "pychromecast" in same directory of the script i have imported the pychromecast.. so pychromecast python files were not found in ./pychromecast/... :)
 
3:46 AM
Hi guys, is there any way to hold the pass the value of first iteration onto the second? Like {'10:00-12:00': 'Maths', '13:00-15:00': 'Physics', '16:00-18:00': 'History', '19:00-22:00': 'Biology', '23:00-1:00': 'Chemistry', '2:00-4:00': 'Computer', '5:00-10:00': 'English'} I have a dict like this, and I want to compare 12:00 and 13:00, is there any way to do this with for loop?
What im currently using is
for (k, v) in data.items():
    start = k[:5]
    stop = k[6:]
but this gives 16:00 and 18:00 as start and stop. Any way to get 18:00 on the second iteration with 19:00 ? Or do I have to make some other dict with these values and loop through that?
 
user13415013
4:39 AM
Hi guys, Andras :)
I am now clean :) only one account :)
 
5:12 AM
annoying!!!!
 
 
1 hour later…
6:17 AM
cbg all :D
 
hi everyone !
I am going to start learning ML using python , so will it be tough for me if i directly jump to GANs ?
 
 
1 hour later…
7:32 AM
can any1 suggest Machine learning community chat groups?
 
recbg
 
8:14 AM
@CoolCloud The simplest solutions is just to store the previous values in a separate variable. After stop, store prev = start, stop.
Alternatively, there are recipes for helpers that cleanly do that for you
 
8:37 AM
@MisterMiyagi Could you explain this a bit more please
 
# something like this
prev_stop = None
for (k, v) in data.items():
    start = k[:5]
    stop = k[6:]
    if prev_stop is not None:
       ... # do stuff
    prev_stop = stop
NB: I generally recommend using helpers for this. It's better to separate the processing logic ("start - prev_stop") from the pre-processing logic ("pairs of prev, current").
 
8:52 AM
@MisterMiyagi Okays. ill take a look, thanks alot!
 
9:52 AM
@MisterMiyagi @CoolCloud One useful way to separate processing from selection is to use generators to yield only those items of interest. Your processing logic then simply iterates over the generator in a for loop.
 
10:09 AM
@holdenweb Im not familiar with generators or yield yet :( Could there be any example?
 
Wait until you're ready! Some examples at wiki.python.org/moin/Generators
rbrb - off shopping :-(
 
@holdenweb Thanks, sure, ill try it out xp
 
10:28 AM
@CoolCloud See the link I gave above. It has some examples for your use case.
 
10:50 AM
@MisterMiyagi Im trying to relate, but all of them are for list, but using an dict, the indexing doesnt work same right?
 
11:05 AM
Most of them are on iterables, not lists. This one is a nice generator-based helper working with arbitrary iterables.
 
@MisterMiyagi Ill take a look, anyway I asked a question here too
 
I don't understand that question at all. No clue how you get that output from that input
 
@CoolCloud You might want to add something more to the question other than just the task descriptions. It reads very gimmecodez'y at the moment.
 
> I could just make this dictionary myself, but
so tell "us" how you'd do it
 
@AndrasDeak I mean by hardwire it
 
11:12 AM
It can't be answered as is. Once you at least explain what code you want written we can consider reopening it.
Imagine that the reader is the computer. Tell the reader how it should get dict 2 from dict 1. Simple as that. It might even help you code it yourself.
 
@AndrasDeak See i was trying it from yesterday, I've tried to do what I could, using function and looping, but I cant seem to pass a value from one iteration to another or even get the dict I wanted
 
Until you can explain in exact terms what dict you really want (i.e. an algorithm) there's no way you'll be able to implement it
OK, I see what you want to do. But that's not clear from your question at all.
 
Props to the answerers for figuring it out, but that code... posted by a 41k user... that's painful
 
I guess im poor at explaining things
 
11:30 AM
@CoolCloud Consider that this is the skill you should work on, above solving individual problems. At the end of the day, "writing code" means explaining what you want to the machine and yourself.
 
@MisterMiyagi Your right, ive to work alot on it. Thanks guys for the help!
 
ugh
 
Hello!
Is it okay to post a tech support question on stack overflow?
I wonder how long until that question gets closed
 
@BlackPanther I think its more perfect for SuperUser
 
11:46 AM
@BlackPanther It would be better to ask that before posting the question, don't you think? FWIW, it is generally not okay to post fresh questions in this room as per the room rules to begin with.
 
@CoolCloud That may be so, thanks.
@MisterMiyagi It's not my question. Fresh questions? I am not sure what that means, and where in the rules it is mentioned
 
@BlackPanther it's not even remotely about programming so it's off-topic here.
@BlackPanther you'd have to read the rules for that
@BlackPanther as a general rule don't onebox low-quality or off-topic posts, it's just noise
 
 
2 hours later…
1:48 PM
how does random module randomize stuff?
 
@Praveen pseudorandomly
 
meaning?
like it uses some algorithm?
then why does cloudflare use lava lamps instead of just using PRNG??
 
2:10 PM
I can parse that last question, but fail to make sense of it... :/
 
Did you actually read that article? The first paragraph seems to answer your question.
 
meaning a number generated by PRNG has high probability that it could be repeated?, then why cant we use multiple PRNG and add them?
 
PRNGs as used by Python's random module are guaranteed to repeat, with a fixed sequence length.
Chaining multiple PRNGs merely increases that length.
That may seem like a lot, but it is easily reached in combinatorics – for example, permutations of a list.
See e.g. the documentation of random.shuffle
 
3:06 PM
finally managed to land a job after 5 months of graduation, nothing cool or FAANG but it has some python in it, I want to thank most/all of the regulars who helped me <3
11
 
Congrats!
 
I could star it but you know :D
one new question I got was "design a domain specific language and an interpreter for it" :/
 
3:40 PM
Streaming Advent of Code day 5! twitch.tv/davidism
 
 
3 hours later…
6:12 PM
@python_learner I starred it, to remind us that our efforts benefit people. Congratulations on landing the gig.
 
Rnj
6:28 PM
have u guys used google colab?
 
6:39 PM
I don't think we have any u guys here to answer that question
 
Rnj
why so? are colab questions not allowed here or its too basic or its just that people here dont really use colab?
 
It was just a fun attempt that pointing out that "u" looks terrible in the middle of an otherwise decently typed sentence.
 
@holdenweb laurel. It wasn’t a brag post. There’s a lot of actual devs here. I didn’t want to be ungrateful. Thanks anyways. :D
 
Rnj
@AndrasDeak aah ohkay ...
having trouble with colab
say currently I have this view:
https://i.postimg.cc/rspJvYz5/image.png
When I click button to go up a directory, I get this:
https://i.postimg.cc/ZRwPFFjn/image.png
I want to know how can I get back earlier view. That is how can I again go inside content directory?
I have many such small questions which are simply not allowing me to get productive with colab ... :(
 
6:59 PM
@Rnj I'm struggling to see any relationship with Python here
 
Rnj
I know its not specifically related to python "code"...
 
Hadn't realised until closer study we are talking about Jupyter.
Going up one directory will show you a listing of another directory. One of the entries is the directory you just left. Click on it and you're back there.
 
Rnj
7:55 PM
@holdenweb Doesnt work. It just expands that particular folder. So rest of them are still there. Doesnt really go inside that folder / open it: i.postimg.cc/PxrH7bsX/image.png
Also want to know if we can have a project kind of environment in either kaggle or colab. I want to have several python files and data files in my workspace and say one or two jupyter notebooks that can import those files and use them. And I want to share such workspace with my friends / colleagues / public. Is this possible with colab or kaggle. Or in other words can we have project explorer which will show different python and data files used in notebooks like IDEs in colab or kaggle?
 

« first day (3703 days earlier)      last day (1228 days later) »