« first day (3019 days earlier)      last day (2153 days later) » 

02:49
cabbage
03:22
Here's another fun physics question: physics.stackexchange.com/questions/455526/…
03:33
"erg" - named due to the first sound made by a scientist after having to write out 10^-7 Joules several hundred times in a paper - "ERG! There has to be a better way to write this!"
04:12
Laurel. :) But IIRC, physicists were using CGS units before they switched to MKS / SI units. I remember reading about ergs & dynes before I ever heard about Joules & Newtons.
 
2 hours later…
06:01
cbg
 
4 hours later…
10:09
I am able to login using the same payload
10:52
I hope this is not your actual pw otherwise ask a mod to delete the message
and change your pw
@pythonRcpp ^
it is a valid password, lol xD
 
3 hours later…
13:36
Hi
Can anybody tell me how can I learn ORM which is used in Django?
cabbage !
@MohammadGhonchesefidi read the official documentation ?
hey @MartijnPieters
But I want to know about ORM it self
it was long
13:38
not specific ORM
as I understand they all have same logic
@MohammadGhonchesefidi what do you want to know: each orm is different
@XavierCombelle So tell me what ORM is Django using?
@XavierCombelle And how I can learn it?
@MohammadGhonchesefidi django use it's own ORM
@MohammadGhonchesefidi you can learn it on django official doc
@XavierCombelle Oh! it got more complicated :D
@XavierCombelle Do you know any video base tutorial?
I searched in youtube but there was no tutorial specific about Django orm
13:44
Searching for "Django ORM" under Google / videos gave me youtube.com/watch?v=eio1wDUHFJE & youtube.com/watch?v=b2W7aJjbbC0
@XavierCombelle Excellent!
cbg
14:02
cbg
14:30
cbg
cbg \o
14:49
I am trying to iterate through rows and columns of the Pandas DataFrame and write that result in a new DataFrame if some condition is met. I am able to iterate on the following DataFrame which has different names for row and column.

W0O5 W1O5 W2O5 W3O5
W0O5 0.0 0.0 0.0 0.0
W1O5 0.0 0.0 1.0 0.0
W2O5 0.0 1.0 0.0 0.0
W3O5 0.0 0.0 0.0 0.0
I used the following approach

for i in pandas_df.index:
for j in pandas_df.columns:
print(i, j)
print(pandas_df.at[i, j])
if pandas_df.at[i, j] ==1:
I believe triple ` characters before and after will demarcate a bit of your post to be fixed width, which will also preserve leading whitespace (about which Python is persnickety)
@PaulMcG no
please see the pinned post for formatting code in chat
I saw the starred item re: backticks, I thought that was for posts in chat
I am sorry, this is my firs time in this room
Jan 10 at 18:12, by Andras Deak
PSA: SO main now supports triple backticks for code blocks, see announcement and updated formatting help. Doesn't apply to chat.
14:55
tl;dr
I tried to be as brief as possible :P
@hemanta it's OK, welcome. You can find the room rules here and a guide to formatting multiline code in chat here
@And
@AndrasDeak shall I format the code and post again?
Thanks for the pointers
@hemanta You can edit posts if you do it quick enough. Might be too late by now.
Also, paste services are usually better for lengthier code: dpaste.de
@malan thanks for your suggestions. I will keep in mind for future. Yea, it seems too late for now.
15:13
@hemanta Peaople can't really help you with your code if they can't read the white space. You might want to repost it by making a link to a paste bin of it.
cabbage @MartijnPieters it was long since I did not came here
I am getting :
ValueError: Cannot index with multidimensional key, when I try to iterate the following pandas DataFrame .   WO5  WO5  WO5  WO5
WO5  0.0  0.0  0.0  0.0
WO5  0.0  0.0  1.0  0.0
WO5  0.0  1.0  0.0  0.0
WO5  0.0  0.0  0.0  0.0
I am sorry, I am unable to use features correctly in chat room since I am new here.
I know the error is due to duplicate column names, but is there a way to handel this in pandas or python
 
1 hour later…
16:39
does somebody know what normal values would be for machine learning adding gaussian noise to training images? Already 1% and I can not even recognize what the image is depicting, so I wonder what others use
@IljaEverilä Over the weekend I discovered why we use application factories in Flask (in testing, every time I would make a call to the flask app to get something, all of my sqlalchemy relationships would fry).
what does would fry mean?
They would frizzle out. I couldn't get the proper returns from them. I.e., t.relationship (which should return a bunch of objects) would return nothing.
how can that happen :O ?
Side effects from using a global app context, I discovered.
16:48
Damn
Hi guys. I wrote a brute force script with the requests module for a CTF game: gist.github.com/philly-vanilly/70cd34a7686e4bb75b08d3caa1f6a820 and now I wanted to make it asnychonous to make it a bit faster. Would you recommend to stick with the requests (for async called grequests as far as I see) lib or switch to httplib like here: gist.github.com/zed/0a8860f4f9a824561b51
I would stick with requests
@Phil you could switch to aiohttp and utilize asyncio module
what I don't understand is why in that example the guy is using the multiprocessing lib. the request processing is not really a bottleneck, the waiting for a request is. and in some post somebody said that multiprocessing doesnt work well with grequests
don't use multiprocessing, there is no need for you to do that. you could even use threading + requests as GIL won't affect you
16:55
@marxin woah never heard of that. you might add another answer to this stackoverflow.com/questions/2018026/… haha
I guess it is more perfomant or what is the benefit?
I mean aiohttp
the benefit is that its lightweight and make io operations asynchronous like, which would work nice in your case
and there is no need to deal with multithreading / multiprocessing, which requires more care
ok I will check it out, thanks
Has somebody heard of how to change parameters in tensorflow while the training is running? google gives nothing
 
1 hour later…
18:22
How do I move a line plotted at x 0 - 1999 to x 2000 - 3999 with matplot lib? So a horizontal translation
19:05
when I have a headers {} object that for the most part has same attributes and only one has different values, do I need to use some sort of copy method if I want to alter that varying value in an async function?
foo = bar is just a reference assignment in python, no?
Interesting ongoing discussion / argument about the curation / moderation of this post (and its two possible duplicate targets) is ongoing in its comment thread: stackoverflow.com/q/32680081/1709587. Some folks here might wish to opine there.
(Note that my first comment there came before the current choice of duplicate target, confusingly.)
ah yeah nevermind, looks like I need to use dict.copy()
20:07
any kivy programmer?
0
Q: Clock.schedule_once not updating the label, but update method is being called

driftking9987I have a label in which I need to update the text once I receive the text from server. Method is working, am getting the output and the function is also getting called, but the label text is not updating. My code : #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jan 21 00:34:5...

I need to update the label text from a function. It's just not working. Can anyone help?
are there some examples of how to write a code to detect a pattern in the data. As in, in my data; one of the parameters has a certain 'value range of slope' for 15-20 rows. But there 1-2 points in the data that also showcase the same value at times. I have to find the 1st and last values of those 15-20 rows
check out fourier transform
20:29
How to destroy a codebase with anti-patterns: youtu.be/MTCYhbfSAuA -- I'm pretty sure this is a giant joke, right?
20:42
havent seen video yet, but yes, that dude is very capable of pulling out absolute hilarious stuff with an insanely serious face.
yes, its a joke haha. don't do that.
21:03
I'm just watching it like, really? Everything he has says "Ex- Tech Lead at Google" and his actual youtube channel is called "TechLead" and watching that video makes me thing he really did that. At Google.
21:27
In the with statement, do you generally want to keep it as maximum scope or as minimum scope as possible? I.e., if I'm using it inside a for loop, am I better off with it inside the for loop or outside? Which is more efficient?
it depends on when you want to close/exit the context manager
I would make it as tight as possible, otherwise you're just indenting stuff for no reason (and keeping stuff like file handles open for no reason)
I'm using the flask with app.app_context(): to programmatically prepopulate my db. I'm keeping it tight. Thanks for the advice.
But there's a tons of little pieces of db code that require it.
Well, whatever needs it should go inside.
If you have a line that needs it and one that needs it 50 lines later (without exiting and then reentering another with block) then don't worry about it. "Tight as possible" covers this.
21:42
https://i.sstatic.net/uPLXe.png

how to detect the start and end of the lower straight line.
Thanks Andras
Is it like a horrible anti-pattern to write a non-ternary single line if/with/for statement?
like with context(): do y
I'm not an expert but I'd always put the content of with blocks on proper indented lines
I'm not even sure how single-line ifs are generally regarded
That's why I'm curious. I've never seen anyone even mention them, but in my experience they work.
Sometimes it's so short I do it because it feels cleaner, but I have no idea if it's considered a bad practice
Oh yeah, for a single expression you don't need (syntactically speaking) a newline.
you can try figuring out if PEP 8 says anything about the matter
21:58
I need to just read all of PEP8. I can't find anything skimming
Well, anyway, thanks Andras. I'll do a little more digging. rbrb for now.
no worries, rbrb
> Compound statements (multiple statements on the same line) are generally discouraged.
Rather not:

if foo == 'blah': do_blah_thing()
do_one(); do_two(); do_three()
> While sometimes it's okay to put an if/for/while with a small body on the same line, never do this for multi-clause statements.
22:15
would it be possible to write something that downloads multiple parts of a video at once from a url?
@malan I used to do else: break on one line, but decided that the control flow is more visible if I don't do that.
A: Downloads 1%-25%; B: Downloads 26-50%; etc.
and have A,B,C, and D run at the same time?
Range requests would have to be used
hi guys, I am using Spyder IDE
How can I install packages?
I want to install this package
I try to put it in the IDE's terminal, but not working
22:35
@QuicoLlinaresLlorens you shouldn't use pip install in the Python terminal. You could open Anaconda Prompt and conda install requests there, or use pip install requests if pip points to your Anaconda installation. Or enter your virtual environment and use conda install there. But not via Spyder.
cbg
@roganjosh is spyder bundled with anaconda?
@AndrasDeak yes, it's the default IDE that comes with regular Anaconda. I'd be very surprised if they have Spyder without Anaconda but it may be possible; fair point
Why in the tutorial is doing it with pipenv?
Before we go down that path, do you have Anaconda?
22:38
yep
What .exe do I need to add to my path
to make pipenv work?
pipenv-resolver.exe or virtualenv.exe?
None, because Anaconda comes with its own environment manager but you're jumping ahead :)
Conda is used more for IPython than, say, PyCharm so you may end up just using the base environment
(base) C:\Users\quico\Desktop\Google drive\Sure bets>conda install requests
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.4.10
  latest version: 4.5.12

Please update conda by running

    $ conda update -n base conda



# All requested packages already installed.
So requests package should be already installed
But you get an error on import in Spyder?
Did not try yet
err, ok. That probably would be a wise thing to do :P
22:45
Yep
working bro
;)
thanks
I keep running into libraries that aren't on the Conda library list. You can still use pip for these, but you will want to check that pip points at the Anaconda installation
IIRC conda recommends that you don't do this, but I've not had ill effects. Then again, I've not tried to update a current Anaconda installation
I guess it tries to keep a grip of compatibility of libraries when you update and might fail with a pip installation
23:32
@ExoticBirdsMerchant please try to be relevant

« first day (3019 days earlier)      last day (2153 days later) »