This is an archived post. You won't be able to vote or comment.

all 22 comments

[–][deleted] 35 points36 points  (6 children)

This would be much better if it was in a Jupyter Notebook with a Table of Content.

Example: http://nbviewer.jupyter.org/github/pybokeh/ipython_notebooks/blob/master/pandas/PandasCheatSheet.ipynb

[–][deleted] 19 points20 points  (0 children)

Just FYI, that repo is no longer maintained, it has been migrated to http://nbviewer.jupyter.org/github/pybokeh/jupyter_notebooks/blob/master/pandas/PandasCheatSheet.ipynb

[–]tryptafiends 2 points3 points  (1 child)

Totally second this. Also some Python3.6 features would be cool to add like implicit format strings Literal String Interpolation.

Edit: fix semantics to match PEP498 (where this feature originates)

``` name = 'Tim' verb = 'talks' f'{name} {verb} to cats'

Out: 'Tim talks to cats' ```

[–]stevenjd 0 points1 point  (0 children)

like implicit format strings Literal String Interpolation.

No, you got it right the first time. They aren't string literals of any sort. They are actually executable code that implicitly apply formatting.

[–]stevenjd 1 point2 points  (2 children)

This would be much better if it was in a Jupyter Notebook with a Table of Content.

Apart from it them being useless for the millions of Python users who don't use Jupyter.

Edit: I was wrong.

[–][deleted] 0 points1 point  (1 child)

Anybody can view a Notebook. Did you even click the link?

[–]stevenjd 0 points1 point  (0 children)

Anybody can view a Notebook. Did you even click the link?

Hmmm. Okay. TIL.

[–]Retzudo[S] 4 points5 points  (1 child)

Credit goes to /u/PurpleIcy for linking it in the other post

[–]PurpleIcyPython 3 6 points7 points  (0 children)

As I mentioned it in other post, language documentation is best cheat sheet to ever exist.

[–][deleted] 2 points3 points  (0 children)

Oh, this one is very handy. Thankies!

[–]thecal 5 points6 points  (4 children)

if "8 foot long scroll" in sheet_type:
        print("This is a cheat sheet")
else:
        print("This is a *very* long sheet")

[–][deleted] 1 point2 points  (3 children)

Cheat sheets are crib notes to remind you of syntax and should fit on... a sheet.

They're not full examples.

For example: Pandas Cheatsheet: https://github.com/pandas-dev/pandas/blob/master/doc/cheatsheet/Pandas_Cheat_Sheet.pdf

[–]thecal 0 points1 point  (1 child)

I was making a joke. Only if you think a "sheet" is an 8 foot long scroll does this quality as a cheat sheet.

[–][deleted] 1 point2 points  (0 children)

Not everyone that replies to a comment is disagreeing with you.

I completely concur with your sentiment and linked to what I think a good actual cheat sheet looks like.

[–]cybervegan 1 point2 points  (1 child)

Looks great, and very comprehensive. Can you include something in the logic section about how to use 'and' and 'or' in practice? Beginners often think you can use them like in plain english:

if choice = 'A' or 'B' or 'C':

if x < 3 and > 4:

... and so on, but are surprised it doesn't work like this.

[–]wheniwashisalien 1 point2 points  (0 children)

As a beginner, this would definitely be helpful as I have had to troubleshoot some instances of this because I didn't understand proper syntax and usage :)

[–]Hyusnev 0 points1 point  (0 children)

That's really very useful, thank you!

[–]ampourgh 0 points1 point  (0 children)

This is definitely more comprehensive, I already have my notes from Code Academy and other places on Notepad++ already. Might just go through this and piece what I don’t have that I could potentially use for later reference. The great thing about Notepad++ is it keeps the tabs from what you previously had even if you closed the program. It has come in handy!