numpy and pandas
生活随笔
收集整理的這篇文章主要介紹了
numpy and pandas
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
安裝了anacoda ,結果 spyder 無法運行
1.通過pip安裝pyqt5:
pip install pyqt5
2.輸入以下命令:
spyder --new-instance
就好了
結果如下:
np.r_ data_list1和data_list2合并 [ 4 6 12 6 0 3 7 1 5 2 65 6 7 3] np.r_ data_list1和data_list3合并 [ 4 6 12 6 0 3 7 1 5 2 65 6] np.c_ data_list1和data_list2合并[[ 4 1][ 6 5][12 2][ 6 65][ 0 6][ 3 7][ 7 3]] np.c_ data_list1和data_list3合并 ValueError: all the input array dimensions except for the concatenation axis must match exactly [Finished in 0.2s with exit code 1]簡單地總結一下用法就是:
np.r_是按行連接兩個矩陣,就是把兩矩陣上下相加,要求列數相等,類似于pandas中的concat()
np.c_是按列連接兩個矩陣,就是把兩矩陣左右相加,要求行數相等,類似于pandas中的merge()
Python numpy函數:zeros()、ones()、empty()
總結
以上是生活随笔為你收集整理的numpy and pandas的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 机器学习吴恩达
- 下一篇: LeetCode刷题中遇到的一些知识点