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.
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 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.
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.
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.
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...
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
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,...?
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?
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)
@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.
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.
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
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.
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.
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... ;)
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]
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
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.
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..
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.
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?
I'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...
@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.
@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.
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
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.
@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.
@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 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
@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.)
@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.
@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.
@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