anaconda update all possible packages?

TL;DR: dependency conflicts: Updating one requires (by it’s requirements) to downgrade another You are right: is actually the way to go1. Conda always tries to upgrade the packages to the newest version in the series (say Python 2.x or 3.x). Dependency conflicts But it is possible that there are dependency conflicts (which prevent a further … Read more

Updating a dictionary in python

I’ve been stuck on this question for quite sometime and just can’t figure it out. I just want to be able to understand what I’m missing and why it’s needed. What I need to do is make a function which adds each given key/value pair to the dictionary. The argument key_value_pairs will be a list … Read more

How to condense if/else into one line in Python?

Possible Duplicate:Python Ternary OperatorPutting a simple if-then statement on one line Is there a way to compress an if/else statement to one line in Python?I oftentimes see all sorts of shortcuts and suspect it can apply here too.

Python: finding an element in a list [duplicate]

The best way is probably to use the list method .index. For the objects in the list, you can do something like: with any special processing you need. You can also use a for/in statement with enumerate(arr) Example of finding the index of an item that has value > 100. Source