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

Python def function: How do you specify the end of the function?

In Python whitespace is significant. The function ends when the indentation becomes smaller (less). Note that one-line functions can be written without indentation, on one line: And, then there is the use of semi-colons, but this is not recommended: The three forms above show how the end of a function is defined syntactically. As for the semantics, in … Read more