随笔分类 - Python
摘要:Global Statistics: Common seen methods as such 1. Mean 2. Median 3. Standard deviation: the larger the number means it various a lot. 4. Sum. Rolling
阅读全文
摘要:NumPy Reference: Indexing Integer array indexing Boolean array indexing Note: The expression a < mean produces a boolean array, like:
阅读全文
摘要:NumPy Reference: Indexing Integer array indexing: Select array elements with another array
阅读全文
摘要:NumPy Reference: Indexing Note: Indexing starts at 0 (zero). def slicing(): a = np.random.rand(5,4) print(a) """ [[ 0.15372787 0.83347785 0.86855635 0
阅读全文
摘要:NumPy Reference: Mathematical functions numpy.sum: Sum of elements - along rows, columns or all numpy.min, numpy.max, numpy.mean: Simple statistics Al
阅读全文
摘要:Attributes of numpy.ndarray: numpy.ndarray.shape: Dimensions (height, width, ...) numpy.ndarray.ndim: No. of dimensions = len(shape) numpy.ndarray.siz
阅读全文
摘要:import numpy as np def test_run(): data=np.random.random((3,4)) """ [[ 0.80150549 0.96756513 0.18914514 0.85937016] [ 0.23563908 0.75685996 0.46804508 0.91735016] [ 0.7054...
阅读全文
摘要:It is easy to compare the data by normalize it.
阅读全文
摘要:import os import pandas as pd import matplotlib.pyplot as plt def test_run(): start_date='2017-01-01' end_data='2017-12-15' dates=pd.date_range(start_
阅读全文
摘要:For example we have dataframe like this: Now we only we want to get highlighted part: We can use Dataframe.ix[] method to get date related index data
阅读全文
摘要:Create an empty Data frame with date index: Now we want to load SPY.csv and get 'Adj Close' column value and copy the range (11-21, 11-28) data to the
阅读全文
摘要:Install:
阅读全文
摘要:Object oriented classes work much like classes in other languages. Learn how to create them and use them, learn the difference between class variables
阅读全文
摘要:Misunderstanding scope can cause problems in your application. Watch this lesson to learn how Python scope works and the hidden implications it presen
阅读全文
摘要:Exceptions cause your application to crash. Handling them allows you to recover gracefully and keep your application running. Learn how to handle exce
阅读全文
摘要:This lesson will teach you how to read the contents of an external file from Python. You will also learn how to use the python csv module to read and
阅读全文
摘要:A module is a function extracted to a file. This allows you to import the function and use it in any other code you may write. You’ll learn how to cre
阅读全文
摘要:Print statements will get you a long way in monitoring the behavior of your application, but logging will get your further. Learn how to implement log
阅读全文
摘要:A set is an unordered collection with no duplicate items in Python. In this lesson, you will learn how to create them, and perform basic operations to
阅读全文
摘要:Dictionaries may be familiar to you as hash maps. In this lesson, you will learn how to create them, get the values, and delete elements from the dict
阅读全文