import pandas as pd
df = pd.DataFrame([[1,2],[3,5]],columns=['a','b'])
print(df)
a b
0 1 2
1 3 5
df['a'].apply(lambda x: 1 if x > 1 else 0)
a b
0 0 2
1 1 5
import pandas as pd
df = pd.DataFrame([[1,2],[3,5]],columns=['a','b'])
print(df)
a b
0 1 2
1 3 5
df['a'].apply(lambda x: 1 if x > 1 else 0)
a b
0 0 2
1 1 5
繼續運行 🥋 回憶上次內容 上上次 真寫了 萬行 代碼 這 萬行 代碼 都是寫在 明面 上的 這次 使用git命令 下載了 github上面的倉庫