When to use ‘raise NotImplementedError’?

As the documentation states [docs], In user defined base classes, abstract methods should raise this exception when they require derived classes to override the method, or while the class is being developed to indicate that the real implementation still needs to be added. Note that although the main stated use case this error is the indication … Read more

Python 3.6 No module named pip

On Fedora 25 Python 3.6 comes as a minimalistic version without pip and without additional dnf installable modules. But you can manually install pip: After that you can use it as python3.6 -m pip or just pip3.6.

Tab Error in Python

You cannot mix tabs and spaces, according the PEP8 styleguide: Spaces are the preferred indentation method. Tabs should be used solely to remain consistent with code that is already indented with tabs. Python 3 disallows mixing the use of tabs and spaces for indentation. Python 2 code indented with a mixture of tabs and spaces should … Read more

datetime to string with series in pandas

There is no str accessor for datetimes and you can’t do dates.astype(str) either, you can call apply and use datetime.strftime: You can change the format of your date strings using whatever you like: strftime() and strptime() Behavior. Update As of version 0.17.0 you can do this using dt.strftime will now work