顯示具有 python 標籤的文章。 顯示所有文章
顯示具有 python 標籤的文章。 顯示所有文章

random integer array

  • 0
np.random.randint(_random_within_this_value, size(_row, _column))

output: _row*_column 的 random integer array

[python] 模組 __name__, ...

  • 0
http://caterpillar.onlyfun.net/Gossip/Python/ModuleABC.html

[python] pass by reference or value 參數是傳參考還是傳值?

  • 0
Referencing: Python: How do I pass a variable by referencePassing values in Python
其實重點是在 data type. 
到底在寫 function 的時候,傳的參數 (argument, parameter) 是 reference or value?
全部都是passes references-to-objects by value (like Java), 只是 mutable data type would act like pass by reference

[python] Parsing, Decoding, Read json

  • 0
Referencing: parsing json python, python json decoding
These two article should be clear enough! 這兩篇應該就蠻清楚的了!

JSON objects behave like dictionaries, JSON format is a list containing objects
-> access object by json[object], and len(json) would get the length of json
-> using iterator on a dictionary, hence can be used on json format.
get keys by simple dict.keys(), get values by simple dict.values()
http://www.python.org/dev/peps/pep-3106/