« first day (1384 days earlier)      last day (3789 days later) » 

01:10
i need to reference a variable from an ini file from a different section
i know you can %(var1)s to reference a variable from the same section
but can anything be done to reference one from a different section?
 
1 hour later…
02:30
@OllieFord they probably want your public ssh key; that is okay.
 
3 hours later…
05:25
cbg()
 
2 hours later…
07:08
cbg()
07:35
c(bg)
07:59
cbg
08:15
cbg[:]
TypeError: 'function' object is not subscriptable
:P
Am i the only person who finds Pandas really confusing/poorly documented?
@Oxinabox I think all zookeepers would agree with you
Cabbage all
08:30
Haha, nice one :D
I thought so
You know, I've always wondered about the seeminly arbitrary dotted lines in SOchat
08:49
rbrb
@Oxinabox I've always found the pandas docs great.
@IntrepidBrit I believe it's for when you've been alt-tabbed, so you can tell where you were last "active"
@Ffisegydd You're right you know - chat.stackoverflow.com/faq#read
Had never bothered me enough to check before today
09:53
back
cbg()
@Jon BRIIIIIIIIIIIIIIIIIAN!
@Ffisegydd STEWIE!!!!!!!!!!!!!!!!!!!!!!!!!!!
Don't know the reason. We have a dupe for that, but it won't cover all the problems in the question
But it will not solve is not defined error
10:01
@Ffisegydd Can you link me to the docs you are using?
Maybe I am just looking at the wrong website. (Or do you mean using in-python help?)
Which are the official docs.
@vaultah someone has answered the question anyway which answers that part.
I wish they were more like numpys.
and had a index of docstrings.
Which was heavily cross referenced.
@Oxinabox you might also want to consider using IPython and making use of the ?/?? magic methods for looking up docs/source code.
I have a different definition of the word "glorious" to you obviously.
user559633
10:06
user559633
haha cmon pizza and beer socks
Know what's even better? Just pizza and beer.
user559633
in america, we're taught that we can chase our dreams.
user559633
pizza and beer socks while eating pizza and beer
I am.
But I would rather have something in a sperate window,
WRT my complaining about cross referencing:
This page says how to use all the groupby tools but never links to the docstring pages for them.
10:08
@Oxinabox I do see your point, I suppose I've never noticed them being missing before. Maybe ask about it on Github? Raise an issue and suggest it?
and so many things are confusing.
(I suspect it would all make sense if I was used to R)
Or kinda don't work (Eg the dtypes parameter on the Dataframe constructor)
I should do that yes
The docs are generated using Sphinx, I wonder if there's a way to create an index and then cross-link automatically.
I though numpy was generated with Sphinx as well (I might be getting confused)>
It is probably numpy's truly varst community that caused it to be well documented.
@Oxinabox numpy docs are generated by Sphinx yes. Whether it's automatic or not I don't know.
SO is full of other people asking questions I have about Pandas,
but all the answers are along the lines of "In your case you don't need to do [what ever the OP was asking about], do X instead."
which is great for the OP, but useless to anyone who is googling the OPs stated problem.
10:12
It seems that you can use sphinx-doc.org/markup/inline.html but it'd have to be added manually.
10:23
Reading this great book on Bayes theory and it's aimed at programmers. The author has provided all of the source code and uses Python to boot so it's pretty much perfect. Unfortunately he doesn't follow PEP8 and every time I read a line of code I die a little inside.
First world Pythonista problems...
It's also really good at showing the source code but he's replacing mathematical equation with code. Meaning that rather than an easy-to-digest equation you've got to work out what his code is doing. Oh the humanity...
 
1 hour later…
11:48
Can someone help me with stackoverflow.com/q/25056387/1860929 ?
Please don't link your recently asked questions into chat. Any members who are interested in answering questions will be paying attention to the site.
That question looks like it's already been answered. 1. sizeof misreports the object's true size; 2. "a lot slower" is something larger than 8x slowdown. Maybe Tim meant "not a thousand times slower" or "not worse Big O time complexity"
If dict access makes up a thousandth of the run time of your program, it doesn't really matter if it's eight times slower than usual
12:07
Wow. A Python 2.4 question
My server at work still uses 2.4 IIRC.
It makes me cry.
Nephew's little birthday party... rbrb
Being an adult at a kid's party gives you the unique opportunity of being drunk in a bouncy castle.
A chance like that doesn't come along every day.
wim missed the opportunity to get 100+ question upvotes by titling his question "Why can't I find a PILE OF POO?"
@vaultah Too bad it's not actually about 2.4.
12:32
rbrb
12:45
Hi, I have a severely awkward defaultdict issue, but can't really place a question since I can't isolate what causes the problem. But does anyone have a clue as to how I get a several instances of the same numpy/pandas nan as separate keys in the same defaultdict? defaultdict(<type 'int'>, {nan: 1, nan: 1,...?
@deinonychusaur yeah I've seen this before.
Do these nans all have the same id?
They do, all of them have the same id
In [167]: set(map(id, df.GOID[pd.notnull(df.GOID) == False]))
Out[167]: set([24799256])
I wonder if this has to do with the fact that NaN != NaN, even if the two values are the same instance
@Kevin yeah I assume it's something along those lines. Not all NaNs are created equally.
12:50
That was my first thought, but I can't really reproduce that in a simple case only in my too complex code
how do people magically get my phone number?
I'm thinking of learning php too after finding that more jobs in freelancing are offered to php devs
Odesk is filled with php jobs
@deinonychusaur this will re-create a dict for you
import numpy as np

d = {np.float64(np.nan):'a', np.float64(np.nan):'b'}

print(d)
# {nan: 'a', nan: 'b'}
I wonder if numpy is using some weird homemade defaultdict implementation, different from the usual collections version. How do you tell the origin of a class, again?
@Ffisegydd thanks, and gosh that is really aweful
12:53
The trick is needing to call np.float64 or similar on them
Weird part is that on some cases it adds them up and on some it does not
If you just have {np.nan:'a', np.nan:'b'} it will just make {nan: 'b'}
At the bottom of the page it has something which may help you, using isfinite
I'm in shock but nicely my frustration is at least going down
thanks a lot
I think I'll just filter all nan:s yeah
13:20
Cabbage all.
cbg @abhi
this is hilarious. Especially the first two examples.
Hello fellow dailywtf reader.
My work's database has a number of interesting tables. My favorite is named "Alice_and_Bobs_magical_adventure" (substituting Alice and Bob for my actual coworker's names)
Hello Zactrath
magical_adventure sounds interesting.
perhaps you can add contributions to thedailywtf.
13:26
Hi guys
@flieger85 cabbage.
has anyone been successful in calling wsdl based services from SoappY library in python?
i have been breaking my head over that one since yesterday afternoon.
Just noticed I have 666 answers. I think I need to retire from answering forever now.
Did you know that in binary, 666 is a palindrome, except when reversed all the digits are opposite?
1010011010
0101100101
I'm sure this is highly significant in some way.
@Wooble you could always sign up with a new user name.
Or work your way up to 666 questions.
13:36
666 is also a palindrome without having to resort to binary.\
I noticed that there was no Chrome web app for the Stack overflow chat, so I'm making one :P
And cabbage all! :D
@Ffisegydd so far I've only managed to come up with 1 question I found worth asking, and I'm not even sure that one really was. But it's nice to give angry people a downvote target they don't have to spend rep on. :)
Nah, quirks of the decimal representation of 666 can't be highly significant, because why would God hide facts about the universe in base 10? If we evolved with eight fingers, we'd miss all the symbolism.
@Iplodman is there one for firefox?
I'm not sure, I've only ever used Firefox on my phone.
And that was a while ago.
13:39
Yeah I keep swithcing back and forth between chrome and firefox.
@Kevin But binary is just a quirk of Aristotle randomly being accepted as right about things.
Has anyone seen Lev lately? I seem to remember him talking about some court date ages ago and not sure if I've seen him since O_o
Chances are my memory is faulty and I'm misremembering when the court date was.
@abhiI have a Chromebook so I just use it on everything :P I like the UI more, too.
@Ffisegydd Seen 4 hours ago on SO, so presumably he wan't sent off to Siberia.
@Wooble That's just the secret police poking around his account.
13:43
@Wooble or at least if he has been sent to Siberia then he's got internet.
I think I'd currently appreciate the temperature in Siberia....
It's beautiful and cool here today, makes a change. I wish it'd rain though.
I've had a shockingly temperate late-July.
Hasn't gone above 80 all week.
That's still too high.
It's been downright chilly here. I've worn a jacket in the morning the past 3 days.
13:45
It's 20C (68F) here and it's about right.
We had an absolutely insane rain storm the other day. lightning flashes every five seconds, for like two hours. ~-= weather chat =-~
I come up with interesting ideas but I'm too lazy to learn how to do it.
me too...
@IPlodman A chromebook was something I had during the great google beta process
but I unlucked out. mine didn't work very well.
so that put me off chrome books
@abhi Dayum.
13:52
I put Ubuntu on mine. Which doesn't work that well.
You should try them again some day.
@Ffisegydd I don't come up with interesting ideas, and I would be too lazy to implement them anyway.
@Wooble I was thinking about doing that.
@Wooble I just got a bad monitor. Perhaps faulty graphics card or something.
i returned it, but I never got a new one back. :-)
Well, my web app works! :D
13:53
Google was kind enough to pay for shipping.
abhi: ah. my wifi seems to be kind of spotty lately, but I don't use it much anyway.
The free 3G connection was nice while it lasted, though. Plus, you know, free laptop.
So does anyone here work with SoapPy?
Not me
or has access to some great documentation that will let me call a simple webservice?
funnily enough I am able to call the first part with suds
no issues
but the second call involves complex types and that is where suds throws its hands up in the air.
Microsoft made sure that once you go CSharp, you cannot pretty much look at anything else. CSharp made me a lazy programmer. ;-)
Maybe it is time to send an email to the guys who wrote SoapPy.
Soap itself should be used as less as possible.
Rest or web api are the way to go.
Ok my rant for today is over
I haven't had trouble with complex types in suds.
Well, that's kind of a lie, but not much trouble that I didn't figure out in a few minutes. :)
plz? I'm ashamed of you Kevin!
I'm surprised I had to post this; it's so very obviously a resource recommendation question, I expected it to get closed in literally seconds.
@Kevin ummm.... just our close votes on it still :)
[tag]testing[/tag]
@JonClements Is... Is that wrong? I can never remember whether the "proper" tag name has a z for ironic purposes.
@abhi, I think you want [tag:testing]
14:07
I think the automated tools some people use for it expect :)
thanks @Kevin
Thanks. I'll try to remember it's "pls" next time.
@Wooble - so how would you call a complex type in suds?
Whew... A lot of negative feelings towards SO here
abhi: it's been a couple of months since I was playing with it, but it looks like client.factory.create(some_ns:SomeType) and then editing the attributes of the resulting object, and composing your objects from those things. It does seem like a kind of unpythonic way to work with stuff, though.
14:16
I think comments of this type may be my weakness - I'm cheerfully ambivalent about flame wars regarding religion or politics or whatever, but hating on SO gets all up in my craw
@Wooble Gotcha. I need to read on some documentation and see if I can do this. My purpose is to learn this.
I think I found a link @Wooble
DSM
DSM
Cabbage, all.
cbg @DSM
14:22
cabbage
cbg @DSM
cbg
abhi: I should really get around to finishing my SOAP-related project one of these days. I got fed up with the different vendors' implementations of the service I need to use and went back to getting the data manually in CSV files.
I'm sort of hoping NISO will eventually realize SOAP is awful and move the whole protocol to something RESTful in a future spec.
look at what I just got in email: "Python Office Hours with #1 Stack Overflow Answerer Martijn Pieters"
14:28
@corvid Ahaha xD
@MartijnPieters would be proud.
cabbage y'all
DSM
DSM
Have some cabbage. I have extra from before.
sauerkraut?
Brassica oleracea
14:46
Good morning. I ran this command `virtualenv --no-site-packages django-virtualenv`
in the wrong location. Please tell me how to undo this, so I can re-run it in the correct location. Thank you.
Delete it.
Just delete the directory?
All it's created is some directories with some stuff inside.
Yep
yep, the django-virtualenv directory
I was worried it was hooked to the system somehow. Phew!!!! Thanks.
14:47
Make sure you deactivate if it's activated.
But yeah the whole point of a virtualenv is that it should be contained.
@aliteralmind nope, that's the beauty of virtualenvs. They're easily disposable.
So you can delete it easily.
One things you can't do is move them easily, or rename them.
I didn't run any activate command on it yet. I didn't run anything on it.
I realized immediately it was in the wrong place.
Unless you give it certain flags upon creation.
Thanks. Deleting.
14:48
dumb question, based on this code:
def register_blueprints(app, blueprints=default_blueprints):
  for bp in blueprints:
    app.register_blueprint() ### here be the problem
DSM
DSM
I just saw the "all zookeepers" quote but I'm not sure I want to click to see the context.
@DSM it involves pandas ;)
If I install Django via virtualenv in this way, should I use this virtual environment for all my Django projects? How do you use a single Django installation in multiple virtual envs? Should all apps be installed like this? I'm new to this, don't you know... ;)
I typically create a different virtualenv for each project, and install the correct libraries in each, even if they could overlap/duplicate.
Same.
14:53
yep, just add them to the .gitignore and good to go
Disk space is pretty cheap. And it makes it easier. What if for one project you need the latest dev version but for another you want the stable?
Install a duplicate of Django for each major Django app, in its own directory.
Or, even more likely, you may need an older version of a library for dependency reasons.
I also typically don't put my virtualenv in my project folder so there's no need to ignore it.
Hm. Version control, too.
14:55
~use mercurial, not git~ :)
I'm thinking of creating a virtualenvs folder under my python install folder.
create it separate from both your python install and your project folders
Okay. A peer of the python install folder then.
I personally prefer to keep them with the project they're associated with.
I typically create them next to my projects.
14:56
does anyone think of python as a functional language?
is there a way to pip freeze > requirements.txt before all git add?
i have been looking at some videos on functional languages and I think python is pretty close.
Oh. I see. Okay. I think I get it. A peer to the project it's going to be used in.
It can behave in a way that looks functional, but does not really provide any of the benefits besides superficial ones.
@abhi python is a multi-paradigm language, so that is partially true.
14:59
hm. if I have a nested dict with a bunch of key names that are kind of long, is it better to just load them into locals? like name = some_dict[thing][name]
DSM
DSM
Maybe.
Trick question. Don't use long names.
In [27]: d = dict(a=1, b=2)

In [28]: a = d['a']

In [29]: d['a']
Out[29]: 1

In [30]: a
Out[30]: 1

In [31]: d['a'] = 4

In [32]: a
Out[32]: 1

In [33]: d['a']
Out[33]: 4
DSM
DSM
15:02
If some_dict[thing][name] is going to be referenced a lot, I'm not going to type thirty more characters just for the sake of it. Sometimes you can avoid the issue by factoring out the work into another function into which you pass some_dict[thing][name] as an argument, but sometimes that's not practical.
I wonder how long the asker sat there wondering when he would see "Hello, World!"?
@davidism wow :(
"I RAN MY CODE! WHERE MY WEBSITE!? PYTHON IS CRAP! I WOULDN'T HAVE THIS PROBLEM WITH PHP!"
5
DSM
DSM
Hmmph. I'm not sure if there's a problem with my code structure or if I'm just being dense. Usually when I can't see where to put a middle layer it's a sign I'm missing something..
15:18
@davidism it happens to everyone who starts programming at some point or the other.
@Ffisegydd yes. in the very first version of classic asp, you could just press and make the code run in your browser.
maybe the user was looking for something similar.
@abhi python is functional to a point...
cbg()
there are just some very poor functions in python like random.shuffle which modifies a list in place, but does not return the list
really hard to use functional programming with that
This guy just doesn't get that HTML syntax errors are separate from Jinja syntax errors.
DSM
DSM
I'm not sure I'd say that random.shuffle is a poor function because of that, although it's obviously not useful for purely functional programming. I can always make a copy of a list if I want to, but if I only have random.shuffled which returns a copy it's not as easy to go the other way.
15:34
You can use random.sample(seq, len(seq)) but .... that's going to have more overhead
I need help :(
I'm getting the following when running the very first step in the Django tutorial. (I've already run through this tutorial successfully. I'm trying to do it again with a new project.)
R:\jeffy\programming\sandbox\python\django\tutorial\hibbert_tutorial>django-admin.py startproject mysite
'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "C:\applications\programming\python_341\Scripts\django-admin.py", line 4, in ?
   __import__('pkg_resources').run_script('django==1.6.5', 'django-admin.py')
 ImportError: No module named pkg_resources
I get this whether run in a virtualenv or not. Any ideas?
How are you running it @aliteralmind? From the command line?
Yes. Command line.
And you've activated the virtualenv?
This happens whether it's done in the virtualenv or not. Same error.
I'm searching through SO questions now for "Django ImportError", but nothing's helping yet.
15:41
Have you installed pkg_resources using your virtualenv version of pip?
133
Q: No module named pkg_resources

igniteflowI'm deploying a Django app to a dev server and am hitting this error when i run pip install requirements.txt: Traceback (most recent call last): File "/var/www/mydir/virtualenvs/dev/bin/pip", line 5, in <module> from pkg_resources import load_entry_point ImportError: No module named pkg_re...

DSM
DSM
What provides p_r? setuptools?
Does that help?
pip install -U setuptools
pip install -U setuptools --> Requirement already up-to-date
Same response, both in the virtualenv and out.
@Ffisegydd So run curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | python as suggested in the answer?
Response when running in the virtual env:
(hibbert_tutorial) C:\applications\utilities\curl>curl bitbucket.org/pypa/setupt
ools/raw/bootstrap/ez_setup.py | python

curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
More details here: curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
Same response when outside of the virtualenv as well.
Too big of a problem for a chat session...
cbg all
15:56
cbg @Jerry
s'up @Jon?
hello
cbg @python
Thanks anyway. Maybe I'll make this a question...
Is it good to keep python's project files in virtual enviroment folder or rather keep them separate?
I'm using pycharm
16:03
@python what do you mean by project files? Do you mean the actual python files that you're working on?
Yes
In that case you should keep them out of a virtualenv folder.
@Jerry not a lot - same old - busy busy
Project
--->Code
-------> my_file.py
-------> my_file2.py
--->venv
ahh k. ot some big inflow of work here myself. quite tired today -_- hopefully taking a week off in a few days :D
@python there is one example where you have a Project folder and inside you have a separate venv folder as well as other folders including your actual work.
That looks nice. I'll start to use that pattern. Thank you :)
DSM
DSM
@davidism: it seems like he basically conceded the point, though.
I'm quite perturbated by this behaviour
>>> from decimal import Decimal
>>> {1,1.0,Decimal(1.0)}
{Decimal('1')}
I couldn't decide if it is what ones should expect or not
cabbage all
DSM
DSM
Are you bothered by {"a", "a"} == {"a"}?
16:12
@XavierCombelle sets operate on hashes, not on the original values, so if two things hash equal only one will remain.
not exactly @davidism after checking if hash are equals it checks if the object are equals
DSM
DSM
@davidism: that's not quite true. You can have two elements with the same hash but which aren't equal, and they'll both show up in a set.
@DSM @DSM no I'm not bothered by {"a", "a"} == {"a"}
DSM
DSM
nans are a fun corner case, in that they're not equal to themselves but since identity is checked before equality, you can have both {nan} and {nan, nan}, depending.
@DSM can I get a reference for that? The docs only mention hash, not eq.
16:16
Ummm.... some nan bread with a lamb curry would be nice...
DSM
DSM
@Xavier: then what's the difference between that and {1, 1.0} which is annoying you? You have two objects, not identical (in general) but equal, and so only one winds up in the set.
@davidism: but that's how hash maps work. The hash is a many-to-one map. If you didn't check equality, then you're guaranteed to have a failure every time you collide.
@JonClements: silly puppy. Curries with naan are Friday food.
Well yeah... but I'm out for a chinese meal tomorrow...
This is officially the stupidest article I've ever read -> nytimes.com/2014/07/29/upshot/…
> A set object is an unordered collection of distinct hashable objects.
@DSM I need to read better.
@jonsharpe, does using *(generator) as a function argument unpack all of the generator's product at once?
16:31
I don't think Jon Sharpe is here right now
In any case. Yes it does.
See e.g. here - "The generator is expanded at the time of the function call"jonrsharpe 7 mins ago
@wwii Jon's not here- which is a shame - 'cos I'd reckon he'd be great here, but yes... in answer to your question, yes it does as it needs to translate the call into positional arguments which it can't do without doing so
DSM
DSM
<Star Trek voice>Materialize!</trek>
thnx
cbg
desktop app to follow stream OR desktop app for follow stream?
... so if I @user someone who is not in the room, they don't get notified?
16:39
"to"
@wwii nope - unless it's someone that's been in the room recently, they won't receive a notification
@Kevin <thumbs up>, thanks!
"for" might be acceptable if a gerund follows. ex. "This is a desktop app for following the stream"
my sentence is actually something like this:
> Cross-platform desktop application for following posts ...
that sounds correct
16:41
perfect — takk
@DSM one reason why I'm bothered is other languages does different for example java stackoverflow.com/q/8671397/128629 and it should be easier to implement differently
Can Java even have a set containing more than one type?
DSM
DSM
It's a little newspapery, though, because it feels like there's a missing word.
@Kevin in java you can have a Set<Object>
DSM
DSM
@Xavier: but that's different. Java made a decision not to have numbers of two different types compare equal in that case. That's defensible, but in (e.g.) Python 2, having 1 != 1L would have been really annoying given the automatic coercions.
In Python, 1 == 1L == 1.0 (using == for .equals), so the situation isn't comparable.
(For the record, I've been programming in Java for about two weeks now, so don't take anything I say about it too seriously.)
16:46
@DSM How's your sanity going? :p
Safely stored in a jar on his shelf, where it can't do any harm.
He lost it all, then an alternate personality took over that is just pretending to be DSM to us.
but in Java you have 1L == 1 but !(new Long(1)).equals(Integer(1))
at least that case is solved in python3, there's no long type
DSM
DSM
@Xavier: Java's free to define equality however it likes, including to define what Python would call equal values as not equal based upon the types. And if you want to define a new XavierDecimal type which can have 1 as a value, and hashes as 1, but returns not equal for comparisons with non-XavierDecimal types, you can, and it'll behave as you want.
16:54
@XavierCombelle As far as I know, with settings things as object, you lose information about the object, hence Scala uses Any instead of object to define heterogenous lists.
I might be wrong though.
@GamesBrainiac Of course you don't lose information about the object you can have it back for example it should be for a different reason scala don't use it
DSM
DSM
@Jon: I'm surviving, more or less. You just start with C# and then take away everything I like about C#..
Sounds like a good analogy :)
@DSM I haven't touched Java in a while now, how's 8 doing for you?

« first day (1384 days earlier)      last day (3789 days later) »