Python

coursera Python Basics

Python Classes and Inheritance: week3

Test cases, edge casesThe test.testEqual Functionassert statementPythonにはassertという文があります。assert の後に Python の式が続きます。もしこの式...
coursera Python Basics

Python Classes and Inheritance: week2

Inheriting Variables and Methodsクラスのargumentにクラスを置くと、メソッドがinherit継承される。継承するクラスのメソッドを指定するとこうなる。うーんわからない。Overriding Method...
coursera Python Basics

Python Classes and Inheritance: wee1;

object 志向って結局何?メソッドとは、クラスのファンクションである。メソッドはファンクションと違ってargumentが一つだけらしい。Pythonでは、すべての値は、実際にはオブジェクトです。辞書であろうと、リストであろうと、整数であ...
coursera Python Basics

Data Collection and Processing with Python: week3 API!!

The Internet: Behind the ScenesRESTとは、REPRESENTATIONAL STATE TRANSFERの略である。もともとはもっと抽象的な意味だったが、現在では、pythonの関数のように、特定のパラメー...
coursera Python Basics

Python Basic5 : Aliasing(名前変えるだけ)とcloning(複製)と上書きmutation 

Aliarisingか、cloningか、それが問題だ。aliasing happens whenever one variable's value is assigned to another variable,idを同じにする、同じob...
coursera Python Basics

Data Collection and Processing with Python: week2: nested itemsとzip function

Extraction from nested datadictionaryをlist化する方法nested_d = {'Beijing':{'China':51, 'USA':36, 'Russia':22, 'Great Britain'...
coursera Python Basics

Python Functions, Files, and Dictionaries7 : project

replace使わなかった件。ref = open("project_twitter_data.csv", "r")ref = open("positive_words.txt", "r")ref = open("negative_word...
coursera Python Basics

Python Functions, Files, and Dictionaries6: sorting

Dictionaryはsortできないからlistにして作り直すいや、dictionaryもsortできました。だが、sortしたら辞書でなくなる。Pythonはsortが得意な言語のようです。sorted(sortedされる辞書, key...
coursera Python Basics

Python Functions, Files, and Dictionaries5: while statement

To apply the while loop for indefinite iteration To be able to identify while loops that are likely to be infinite loops...
coursera Python Basics

Python Functions, Files, and Dictionaries4: Tupleって結局なんだっけ。

とりあえずprintでtuple使いましょう。tupleにするは、英語でpack into tuple13.1.1. Learning ObjectivesAt the end of this chapter, you will be ab...