Lecture: Learning Python 0-cheat sheets ver. 66

Last Updated on July 9, 2022 by shibatau

The red part is added.

I. What will you learn?

These posts are Python tutorials for beginners and used for my lectures.

Learning Python 0-Cheat Sheets

Learning Python 1-Google Colaboratory

Learning Python 2-Sample data

Learning Python 3-Lists and Comprehensions

Learning Python 4-Dictionaries and Data frames

Learning Python 5-Functions

Learning Python 6-If Statements

Learning Python 7-For Loops

Learning Python 8-Classes and Objects

II. Some rules for the lectures

1.Be teleological

Think of what your scripts are used for. It is much easier to understand and memorize scripts when you know the practical usage of them.

2.Use the sample datas suitable for beginners

 Use as few sample data sets as possible. It would help you focus on codes.

3.Memorize scripts

Memorize scripts using the data you are interested in. The scripts should have a story to you for memorizing.

4.Refer to Cheat Sheets

Create you own cheat sheets. They will tell you what you should learn and memorize. You can create beautiful cheat sheets with Keynote, PowerPoint or something like that. You can get sample templates here:

R: Create R cheat sheets using templates

In my opinion:

  1. You don’t have to take any lectures or online courses. You can learn Python on your own because you can find almost anything for beginners on the web pages. It will motivate you to learn more when you find the solutions yourself. Enjoy learning through self-study.
  2. You should have a courage to suspend the troubles that you can’t solve immediately. You will be most satisfied when you have solved them with the knowledge or techniques that didn’t look related to them at first sight.
  3. You shouldn’t give up learning Python at the initial stage. When you begin to learn Python, it looks very difficult to understand and you may not know what you are doing. It is said that Python has a steep learning curb, that is, it is easy to begin to learn. But in my experience, any language is difficult to begin especially when you don’t have any computer science background just like me. So you don’t have to blame yourself if you feel Python is difficult.

III. Cheat sheets

Cheat sheets help you understand what you have learned and show you what you should learn by heart. The following sheets are my cheat sheets though they are not completed yet. Please make your own cheat sheets with Keynote or PowerPoint.

IV. How to use ( ), [ ], and { }

Certainly, parentheses, square brackets, and braces are very confusing for beginners but it makes you feel at ease to know the following general usage of them when you understand and memorize snippets.

1.Square brackets [ ]

  • Creating lists
  • Requesting items

2.Curly braces { }

  • Creating dictionaries
  • Creating sets
  • f-strings

3.Parentheses ( )

  • Callables (functions and classes)
  • Creating tuples
  • Cheating Python’s indentation rules

In the Cheat sheets I have shown some scripts similar to R scripts with pipes using ( ):

df0 = pd.read_csv("https://pastebin.com/raw/cSZ8pYWh")
(df0.  # about df0
 filter(['english', 'japanese']). # select columns
 mean(). # get the means
 to_frame(name = 'average') # 

You can learn more here:

A Quick Introduction to the Python Pandas Package

Python parentheses primer

About shibatau

I was born and grown up in Kyoto. I studied western philosophy at the University and specialized in analytic philosophy, especially Ludwig Wittgenstein at the postgraduate school. I'm interested in new technology, especially machine learning and have been learning R language for two years and began to learn Python last summer. Listening toParamore, Sia, Amazarashi and MIyuki Nakajima. Favorite movies I've recently seen: "FREEHELD". Favorite actors and actresses: Anthony Hopkins, Denzel Washington, Ellen Page, Meryl Streep, Mia Wasikowska and Robert DeNiro. Favorite books: Fyodor Mikhailovich Dostoyevsky, "The Karamazov Brothers", Shinran, "Lamentations of Divergences". Favorite phrase: Salvation by Faith. Twitter: @shibatau

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.