list/tuple的串接:

# tup1+tup2 串接為新的tuple
# tup1 tup2都沒變動
但對ndarray做加法運算
不是串接的意思
而是逐元素相加
需使用 np.concatenate([ary1,ary2])
#不要忘記()中的[]
#np.concatenate() 使用list當作參數

Series類似ndarray
只是多帶index而已

推薦hahow線上學習python: https://igrape.net/30afN
pd.concat([ser1,ser2], axis=1 )
可以讓兩個Series做橫方向的串接
但是對於1D array則不行:

先使用np.expand_dims()
擴展array的維度:

對擴展維度後的array
才能使用參數 axis=1

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

![Python: 字串 str.find(關鍵字[,start][,end]),找不到的話回傳-1,如何找出資料字串中,所有關鍵字的index?詞頻計算 Python: 字串 str.find(關鍵字[,start][,end]),找不到的話回傳-1,如何找出資料字串中,所有關鍵字的index?詞頻計算](https://i2.wp.com/savingking.com.tw/wp-content/uploads/2022/11/20221122100657_32.png?quality=90&zoom=2&ssl=1&resize=350%2C233)



![Python: pandas.DataFrame 如何對某些欄做格式化字串? apply(); applymap() ; map() 的差別? df[‘Salary’] = df[‘Salary’].map( ‘${:,.2f}’ .format) Python: pandas.DataFrame 如何對某些欄做格式化字串? apply(); applymap() ; map() 的差別? df[‘Salary’] = df[‘Salary’].map( ‘${:,.2f}’ .format)](https://i1.wp.com/savingking.com.tw/wp-content/uploads/2023/05/20230527091636_49.png?quality=90&zoom=2&ssl=1&resize=350%2C233)
![Python常用的模組內建常數; __name__ ; __file__ ; __doc__ ; __all__ ;__dict__; vars()->Dict[str,str] ; dir()->List[str] Python常用的模組內建常數; __name__ ; __file__ ; __doc__ ; __all__ ;__dict__; vars()->Dict[str,str] ; dir()->List[str]](https://i2.wp.com/savingking.com.tw/wp-content/uploads/2022/11/20221112184006_50.png?quality=90&zoom=2&ssl=1&resize=350%2C233)



近期留言