/avatar.jpg

61B-3: References, Recursion, and Lists

Primitive Types 8 primitive types in Java: byte, short, int, long, float, double, boolean, char Everything else, including arrays, is a reference type. The Golden Rule of Equals (GRoE) Given variables y and x: y = x copies all the bits from x into y. Reference Types Everything else, including arrays, is a reference type. 和cpp的区别之一不显式使用指针 Parameter Passing pass by value 😋 pass by reference(某种意义上java纯纯pass by value 😏) Instantiation of Arrays IntList and Linked Data Structures 单链表,不赘述

DATA100-L4: Pandas Ⅱ

lambda function 1 lambda x: x**2 非显式定义函数,可以直接使用lambda表达式来定义一个函数。 This is a lambda function that takes in one argument x and returns the square of x. 再看sort_values() 注意传递key 1 df.sort_values(by='column_name', keys=lambda x: x.str.lower(), ascending=True) add move modify and so on sort by length of string approach1: create a new column and add to original df 1 2 3 newdf = df["Name"].str.len() # create a new column with length of each string df['length'] = newdf df.