‘Conda’ is not recognized as internal or external command

Although you were offered a good solution by others I think it is helpful to point out what is really happening. As per the Anaconda 4.4 changelog, https://docs.anaconda.com/anaconda/reference/release-notes/#what-s-new-in-anaconda-4-4: On Windows, the PATH environment variable is no longer changed by default, as this can cause trouble with other software. The recommended approach is to instead use Anaconda … Read more

ImportError: No module named requests

Requests is not a built in module (does not come with the default python installation), so you will have to install it: OSX/Linux Use $ pip install requests (or pip3 install requests for python3) if you have pip installed. If pip is installed but not in your path you can use python -m pip install requests (or python3 -m pip install requests for python3) Alternatively … Read more

TypeError: unhashable type: ‘dict’

You’re trying to use a dict as a key to another dict or in a set. That does not work because the keys have to be hashable. As a general rule, only immutable objects (strings, integers, floats, frozensets, tuples of immutables) are hashable (though exceptions are possible). So this does not work: To use a dict as a key you … Read more

What’s the canonical way to check for type in Python?

To check if o is an instance of str or any subclass of str, use isinstance (this would be the “canonical” way): To check if the type of o is exactly str (exclude subclasses): The following also works, and can be useful in some cases: See Built-in Functions in the Python Library Reference for relevant information. One more note: in this case, if you’re using Python 2, you … Read more

Merging dataframes on index with pandas

You should be able to use join, which joins on the index as default. Given your desired result, you must use outer as the join type. Signature: _.join(other, on=None, how=’left’, lsuffix=”, rsuffix=”, sort=False) Docstring: Join columns with other DataFrame either on index or on a key column. Efficiently Join multiple DataFrame objects by index at … Read more