1 2 3 # Initialize Otter import otter grader = otter.Notebook("hw01.ipynb") HW 1: Math Review and Plotting 重点在coding,理论供参考 Due Date: Thursday Jan 27, 11:59 PM Collaboration Policy Data science is a collaborative activity. While you may talk with others about the homework, we ask that you write your solutions individually. If you do discuss the assignments with others please include their names at the top of your notebook.
Collaborators: list collaborators here
DataFrames: a data structure for tabular data API always remember to turn to GPT/google/doc
indexing and loc/iloc generate subsets:
loc: an operator select items by labels
1 df.loc[row_indexer, column_indexer] row_indexer: can be a single label, a list of labels, slice(闭区间), single value column_indexer: same as row_indexer returns a DataFrame or Series iloc: an operator select items by positions
1 df.iloc[row_indexer, column_indexer] row_indexer: numeric index or a list of numeric indices,此时回到python经典索引 左闭右开 column_indexer: same as row_indexer returns a DataFrame or Series 通常情况下,我们使用 loc 进行索引 .
definitions A sort is a permutation (re-arrangement) of a sequence of elements that brings them into order according to some total order. A total order ≼ is:
Total: x ≼ y or y ≼ x for all x, y Reflexive: x ≼ x Antisymmetric: x ≼ y and y ≼ x iff x = y (x and y are equivalent). Transitive: x ≼ y and y ≼ z implies x ≼ z.