« first day (1673 days earlier)      last day (3272 days later) » 

1:59 AM
huh
in python's json/decoder.py there's this bit:
raise ValueError(errmsg("Expecting value", s, err.value)) from None
What's that from doing there?
 
2:57 AM
@Musher Search for Exception Chaining in Python 3
 
 
2 hours later…
5:15 AM
cbg
@BhargavRao cbg
 
 
2 hours later…
6:59 AM
Hey up
 
7:26 AM
Hey up
 
Does anybody have ideas on getting the content of forum posts from a page written in WML?
 
 
1 hour later…
8:43 AM
brief cbg
 
Delicious cbg
I'm trying to figure out what the least amount of studying I can get away with is
Need to pass the exam, but I'm so sick of this
 
9:42 AM
Cbg
 
Hey up
 
10:21 AM
Trying to figure out sqlalchemy association objects
Think I can do it now
 
:(
 
cbg
@RobertGrant association objects?
 
Yes
Ooh, it beeps when someone pings me
I normally have my sound off :)
 
I mean what do you mean by association objects? :D or relationships generally
association objects are just like any other model objects...
 
They describe them here
Yeah it's just how I have to manipulate them in this instance
They're all set up and working etc
 
10:33 AM
the association object is the general case, what is special in sqlalchemy is all those patterns of many-to-many where you don't need an association object
 
I basically want a list of associated $things, via an association object $ass, but I also need the unassociated $things as well, just they won't have the extra data provided by each $ass
So do I get the $ass'd $things, then somehow do a select where not in sort of thing to get the non-$ass'd things?
Yeah I need the association to be an object in its own right, as it has various properties of its own
Am I making sense, or am I talking crazy?
Hello? looks behind him
@AlexV hi :) Please read the room rules, which include not asking in here a few minutes after posting on SO.
 
Sorry @Robert, first time here. Won't happen again and thanks for linking me to the rules
 
Cool, no worries :)
If you've not had an answer on the main site in about a day, try posting it on here, but don't spam it multiple times or anything. Most people on here are already monitoring SO for Python questions, and will answer if/when they can
 
Just read the rules. Short & clear!
On a different topic then, does anybody know if I can process a big pandas dataframe in a parallel way?
 
11:03 AM
Hmmm parallel pandas?
 
Woohoo it worked!
 
I don't think pandas really supports parallel execution. A lot of the stuff is vectorised of course.
 
11:36 AM
Hello Everyone
 
i used python to tranform my xml file and save it into a json format. now i need to put that file into a mongodb, what programs do you use for that ?
 
Cabbage people :-) Good news. One of the local training centers asked me if I can train people in Python.
 
Nice, congrats!
Who will you be teaching?
 
Melons :-)
I don't know who they are yet
 
Watermelon
 
11:46 AM
They asked me to come up with a course plan. That's a tough task I guess
 
@thefourtheye well done :)
 
Melons :-)
 
Woohoo, SQLA stuff working
 
12:03 PM
Good Morning Everyone! So I am outputting the formula ....

`p(z)=1/(1+e^(b0+b1∗FicoScore+b2∗LoanAmount))`

with numpy, so I use the numpy.exp() but for some reason I have to multiple the exponent by -1 and I don't get why.

This is more of a math question than python I think. http://nbviewer.ipython.org/github/nborwankar/LearnDataScience/blob/master/notebooks/B3.%20Logistic%20Regression%20-%20Analysis.ipynb is the link to the tutorial I am following.
 
Maybe there's a typo in the formula?
The co-effecients are negative in both the formula and the code, so I don't think that's a reason
 
@grasshopper ^ is not the power operator.
You should use **
Oh wait never mind.
 
12:19 PM
The weird part is that the answers seems... correct?
I am going to look up the original formula online now.
 
@grasshopper oh wait yes I see
Yeah that's wrong.
It should be f(t) = 1/(1 + e**(-t))
 
Yes I just found it online now.
Are you guys into... data analysis.
 
Yes.
 
oh really?... want to be friends?
 
No.
Lol, sorry, that was harsh.
 
12:26 PM
T__T
 
What do you mean friends?
 
Data friends! /inbetweeners
 
It just struck me as a strange thing to ask.
 
I am really just awkwardly expressing my interest in the field, trying to learn it now.
 
Awesome, good for you.
 
12:28 PM
I don't expect us to go out for virtual coffee or something lol.
 
Well I'm always here in chat, so can possibly answer questions/discuss problems if you want.
 
Well, that's not the most awkward virtual thing it could've been
 
There are more awkward virtual acts, yes.
I should add Logistic function to Gwydion
 
@Ffisegydd what Gwydion?
 
12:50 PM
@Ffisegydd /me virtually pats you
 
virtually <REDACTED> you in your <REDACTED> while holding a feather duster.
Since when did \me change your text to italics automatically?
 
/me doesn't know
 
Maybe it's a snippet I have?
 
It doesn't for me. You may have something installed
Yeah
 
@Ffisegydd think he is in over his head or nah?
 
1:50 PM
@grasshopper that doesn't matter; if it's a good question then it should be answered. Problem is, it's not a good question.
 
is it okay to ask a question thats not been answered for over 21 hrs?
 
....yeah go on then :) I see the one you mean. It's not had any answers or comments, so post it here, but this isn't peak time for people to be on here, so I wouldn't expect an answer right now.
 
yup its early. and ive been sneaking in here in and out lately looking for answers. reading stuff lately!
so in short, ive been playing around with geo location and sqlalchemy.
I read about its hybrid attribute property - seems like it is a descriptor over a Table method where one could apply a function like calculating a said geolocation with the geolocation attribute. I've been thinking over these lines but i sort of needed some guidance. here is the full question: http://stackoverflow.com/questions/30264374/yielding-sliced-results-using-a-custom-filter-and-hybrid-property
 
 
1 hour later…
3:09 PM
Anybody know why pywinusb keeps giving me a UnicodeEncodeError in version 2.7.9 only? (Works in 3.4)
 
How do I correctly ignore a parameter when vectorizing a function it with numpy?
the function I am vectorizing is Loanp and I want it to ignore the parameter 'coeff' which is an array.Here is the code I wrote after looking online/at documentation

vLoanp = np.vectorize(Loanp, excluded = ['coeff'])

It still vectorizes the parameter and so I get the error IndexError: Invalid index to scalar variable.
 
4:02 PM
Hey up boyos.
 
Wotcha peeps :-)
 
'Ello 'ello
Becoming slightly more comfortable with SQLA
 
Anything for the agenda anyone?
@Bob good, you can help me with the Kesh stuff :P
 
The BBC website is down. The end is nigh. The Scots must have bombed London.
 
4:05 PM
Wow
 
The letters of last resort are four identically worded handwritten letters written by the Prime Minister of the United Kingdom to the commanding officers of the four British ballistic missile submarines. They contain orders on what action to take in the event that an enemy nuclear strike has destroyed the British government and has killed or incapacitated both the Prime Minister and the "second person" (normally a high-ranking member of the Cabinet) whom the Prime Minister has designated to make a decision on how to act in the event of the Prime Minister's death. In the event that the orders were...
 
Did you not know about the Radio thing? It's really interesting/terrifying.
I hope that the letter just says "Bomb France."
 
Haha
 
@Ffisegydd It's that Nicola stirring up trouble again no doubt
I also hear the Scottish Labour leader is stepping down...
Most exciting GE yet... :)
 
4:24 PM
Dunno what Murphy thought he was playing at ... should have gone immediately.
You can't preside over a catastrophe like that and hold on.
 
Beeb is back online. London has been un-bombed.
 
is at least mildly relieved
 
4:47 PM
cbg
 
anyone ever read a json file into a mongodb database?
 
Yes
 
i always just used the given interface, which i cannot do anymore in my case
browsing through so , trying to find a solution, but i dont even know where the mentioned code is going
on the mongodb page, its all with command Prompts, there must be a more comfortable way i hope :)
 
5:05 PM
Okay.
You've not actually asked a question yet, you've simply stated facts :/
 
i am coming to it.. dont rush me :)
 
No, no. Take your time. You're only asking for my help on a Saturday evening.
Feel free to not rush.
 
@Ffisegydd best recall those Francophilic missiles
 
how do access mongodb or write code for it ? i read a topic about putting it in sublime, but that did not work, maybe i did something wrong
 
Use pymongo.
 
cbg
 
6:19 PM
Noob question: I have a class function that sets up a soap client and assigns it to a local variable called client. How do I add that local variable to my class definition so that I can access self.client in other class functions instead of creating a new variable inside another function like clients = class().setup_client()?
I have no arguments to pass to setup_client, so I can't do __init__(self, client): self.client = client and if I set client = None then I just have a None type problem.
 
Hi
 
Oli
Hello
 
cabbage another fantastic answer by @MartijnPieters
184
A: Why is [] faster than list()?

Martijn PietersBecause [] and {} are literal syntax. Python can create bytecode just to create the list or dictionary objects: >>> import dis >>> dis.dis(compile('[]', '', 'eval')) 1 0 BUILD_LIST 0 3 RETURN_VALUE >>> dis.dis(compile('{}', '', 'eval')) 1 ...

 
Oli
6:34 PM
Noob Question here. Does urllib.urlopen('http://python.org/') work for you guys? I can't get it to work on my Mac. I keep getting this error "File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.p‌​y", line 87, in urlopen"
I google'd this error and I can't find a solution!
 
@Oli Python 2 or Python 3?
 
Oli
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
I assume that means python 2 right?
 
Yeah looks like it.
 
2.7.5 to be exact
 
Oli
okay.. I just started learning Python a few days ago
so excuse me if I seem oh so noobish
 
6:41 PM
Heh don't worry about that :)
 
Oli
okay so
 
Works fine for me, I'm on Mac too.
 
Oli
oh wow really?
 
Are you using the default Python version on your Mac?
 
Oli
Here I will paste my script
gimme 1 minute
 
6:43 PM
Ooh, first ever use of Mjolnir, and it's unhammer time :-)
 
Oli
import random
import urllib2
import sys

url = "http://python.org/"
urllib.urlopen(url)
 
mac </3
 
Oli
lol
And yes I think I am using the default version on my Mac
 
@Oli what's your full error?
 
6:46 PM
@Oli is there still no Python 3 on mac with python3 command
@ZeroPiraeus I'd use set().union(*dicts)
 
Oli
-bash: python3: command not found
Hello world
Traceback (most recent call last):
File "open2.py", line 8, in <module>
urlopen(WORD_URL).readlines()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 87, in urlopen
return opener.open(url)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 208, in open
return getattr(self, name)(url)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 292, in open_http
import httplib
For this script...
 
@AnttiHaapala Doesn't work in Python 3.
 
>>> set().union(*[{1: 2}, {3:4}])
set([1, 3])
 
Oli
import random
from urllib import urlopen
import sys
WORD_URL = "http://learncodethehardway.org/words.txt"
urlopen(WORD_URL).readlines()
 
Python 3.4.3 (default, Mar 26 2015, 22:03:40)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> set().union(*[{1: 2}, {3:4}])
{1, 3}
 
6:48 PM
Ah, didn't notice the ().
Hmm, I think my verion is more expressive :-P
 
Thank you for the pymongo tip , will try it !
 
dunno about expressive, expensive it is at least :P
for key in set().union(*dicts):
so nice :D
 
Ok gotta run ... rbrb
 
downloaded a pymongo whl file, what do i do with it ? :)
 
You Google for help.
 
6:57 PM
doing it right now :)
 
Rather than coming here asking for help that you could easily Google (over and over again)
Then why ask?
Why potentially waste someones time, when you haven't researched it yourself fully?
 
most answers do not start at the beginning..
 
No. It just looks like you just prefer to have someone else do the work for you, well it's starting to get a bit far now.
 
@StephanKetterer you do not download wheels
you install them with pip
 
7:01 PM
This is your interaction with the room today:
"How do I use mongo?"
"OK, I got pymongo wheel, now what?"
Your next question will be "OK, I installed it, now what?"
Ask better questions.
 
Oli
@Ffisegydd Hey I found the error. I had small test scripts that were the same name as the module which caused the conflict
 
@Oli doh! Yeah that's a common problem, pain to find though.
 
@StephanKetterer read and understand: packaging.python.org/en/latest/installing.html
 
Oli
@Ffisegydd DOH! indeed!!!!
 
At least once you've been "stung" by it once, you remember.
 
Oli
7:04 PM
Yep
 
at microsoft you'd be fired for that ;)
 
Oli
@Ffisegydd But...why didn't Python tell me this? I don't know like. Shouldn't it have told me hey I looked in this user directory and it's causing me errors? The error given back to me was not helpful.
@Ffisegydd
 
How does it know you didn't mean to do that?
 
Oli
True
 
@davidism I think @Oli is right
the error message could contain the filename :D
 
Oli
7:06 PM
From the error though, it made me think my library files was wrong.
like it wasn't anything inside my current directory...
 
actually I'd post a issue for that... hmmhm
 
If you use (I think) the verbose flag, python will dump its attempts to load each module
 
Oli
I jut started learning about Python a few days ago, too...
 
AttributeError: 'module' object has no attribute 'foo'
 
Oli
How do I set the verbose flag?
 
7:07 PM
this is so useless :D
 
The error says exactly what's wrong: it tried to import Random from random, random being the first module it found named that on the path
python -v
 
Oli
Gotcha thanks.
 
cbg
 
7:27 PM
WoW they have these new next question buttons ... Any meta post on that?
 
@BhargavRao yeah.... there's one from someone asking if there's a way to disable them :p
 
MetaSO or MetaSE?
 
on meta.SO
 
Searched there, but couldn't find it :( ..... Have the link?
 
12
Q: Provide a way to disable the new Next / Previous question buttons

JonasCzSince recently, there have been two new buttons at either side of new questions. I find them quite distracting, as they are fixed in place, and stay in place as you scroll. Also, they pop up after the page loads, which is similarly distracting. I don't think they are terribly useful, as cl...

 
7:39 PM
Woah ... There is a already :/
 
This ask.wireshark.org looks like a copy of stackexchange :|
I couldn't find it on the stackexchange list too :(
 
@BhargavRao you do this occasionally, and I can never tell if you're joking. There's a link at the bottom that clearly says Powered by OSQA.
 
8:20 PM
Sorry ... The next time I'll be careful
 
Why do you tend to italicise your "sorry" words?
 
I didn't know you should not. I'll not italicize next time :)
 
It's just it makes it look really, really, really sarcastic/insincere.
As if you're saying "Yeah, pfft, well, sorry..."
 
I didn't know that italics makes it look sarcastic :( I use it for emphasis. Will not do so next time!
 
That's like me saying sorry I kicked you, it won't happen again. I'm not looking for an apology or a statement that next time will be different every time I tell you something. Just don't do it and learn from mistakes silently.
You don't need to emphasize "sorry" (or most other things) either. It's not like we wouldn't think you're sorry if you didn't italicize it.
 
8:34 PM
lol the osqa.net link is dead
 
not the one I linked, also there's this thing called Google :-P
 
lol x2 = osqa.net does not work, www. does
hmm strange
Firefox can't find the server at %6f%73%71%61.net.
hoho
woot?
 
Go home Firefox, You are drunk :P
 
yeah, some weird encoding issue
 
<a title="OSQA Development Build (SVN-1281)" href="http://%6f%73%71%61.net"> p​o​w​e​r​e​d by O​S​Q​A </a>
@BhargavRao in addition to OSQA there is also Askbot which is a SAAS company and Django software
 
8:41 PM
Yep, Askbot was there as an example in our course books actually
 
seems that both of these are django, but they're not related at all :D
Nihhitis anyone?
 
Lol! The top two results for google search on Nihhitis are from this chat room! :D
 
of course,
 
8:55 PM
Shouldn't it be nihilitis instead?
 
OK, regex question. Is it possible to have multiple capture groups, and replace each group with a different pattern, all at once? For instance, say I have the string "blah foo bloob foo bar bleep baz bar foo" and I want to replace each instance of "foo" with "cabbage", "bar" with "melon", and "baz" with "yam". Is there a way to do that with only one search/replace operation?
Otherwise, I'd have to search for all instances of "foo", replace them, then search for "bar", replace them, etc.
 
sub supports funcs ... So you can have multiple capture groups and then use a func to process the word
 
I can find the instances of my target words with something like `r"(foo)|(bar)|(baz)", but I can't figure out how to replace all instances of capture group 1 with one thing, 2 with something else, and so on...
 
Yep ... You can use a function there as the second argument to the sub function, where you can have a if this replace with this and so on
 
hmm. What is passed into the function - each capture?
 
9:08 PM
The match object
 
right - I'm just reading the docs now.
 
+-------
 
>>> def fun(s):
...      return {'foo':'cbg','bar':'melon','baz':'yam'}[s.group()]
...
>>> re.sub(r"(foo)|(bar)|(baz)",fun,s)
'blah cbg bloob cbg melon bleep yam melon cbg'
@MattDMo Yep it works fine!
 
awesome, thanks!
 
But you better change that ugly return there :P
Sleep time, Rhubarb all!
:)
 
10:01 PM
@Ffisegydd nihilitis sounds too much like nihilism
 

« first day (1673 days earlier)      last day (3272 days later) »