二進位的 0000 0100 0000 0011 0000 0010 0000 0001
(8*4 = 32個0或1,最前面5個0可以省略,剩下27位數)
是十進位的多少? ans: 67305985
1.手工算: =1*2^26+1*2^17+1*2^16+1*2^9+1*2^0 = 67305985
2.用小算盤:
程式設計人員 => 位元切換鍵台:

除了十進位demical (python無前綴)
八進位octal (python前綴0o,數字+英文字母)
十六進位hexadecimal(python前綴0x)
也一併算出來了
3. Python前綴0b 或0B (第一個為阿拉伯數字):
0b00000100000000110000001000000001

用python驗算小算盤的8進位跟16進位:
8進位( 0o400601001 ,第二個字母O可大寫)
16進位( 0x4030201 ,第二個字母X可大寫)

十進位的67305985是2進位的多少?
用bin()函數:

前面的5個0都去掉,所以位數比較少
十進位的67305985是
8進位(oct函數)
16進位(hex函數)的多少?

十進位轉為2,8,16進位:

2,8,16進位轉為10進位:

“0xff” (str)與 0xff (int)

推薦hahow線上學習python: https://igrape.net/30afN





![Python Pandas GroupBy 的 size 陷阱:為什麼你的計數結果總是不對?如何計算重複次數? duplicates = df.duplicated( subset = [‘name’] ) Python Pandas GroupBy 的 size 陷阱:為什麼你的計數結果總是不對?如何計算重複次數? duplicates = df.duplicated( subset = [‘name’] )](https://i2.wp.com/savingking.com.tw/wp-content/uploads/2025/06/20250609143758_0_53821c.png?quality=90&zoom=2&ssl=1&resize=350%2C233)

![Python: pandas.Series如何只保留str,去除重複值?#isinstance(x:Any, str) -> bool #.drop_duplicates() #Series.apply( function )逐元素應用function運算 #DataFrame.apply( function )逐Series應用function運算 .drop_duplicates() 跟.unique()有何差別? df.drop_duplicates() 等效於 df[~df.duplicated()] Python: pandas.Series如何只保留str,去除重複值?#isinstance(x:Any, str) -> bool #.drop_duplicates() #Series.apply( function )逐元素應用function運算 #DataFrame.apply( function )逐Series應用function運算 .drop_duplicates() 跟.unique()有何差別? df.drop_duplicates() 等效於 df[~df.duplicated()]](https://i2.wp.com/savingking.com.tw/wp-content/uploads/2024/11/20241123194900_0_5218de.png?quality=90&zoom=2&ssl=1&resize=350%2C233)


近期留言