1. 程式人生 > >常用STL庫的整理

常用STL庫的整理

常用STL庫的整理

1、vector

1. 在C++中的詳細說明
vector是C++標準模板庫中的部分內容,它是一個多功能的,能夠操作多種資料結構和演算法的模板類和函式庫。
vector之所以被認為是一個容器,是因為它能夠像容器一樣存放各種型別的物件,
簡單地說,vector是一個能夠存放任意型別的動態陣列,能夠增加和壓縮資料。


2. 使用vector,
必須在你的標頭檔案中包含下面的程式碼:
  #include 


vector屬於std命名域的,因此需要通過命名限定,如下完成你的程式碼:
  using std::vector;
  vector
vInts;    或者連在一起,使用全名: std::vector vInts;    建議使用全域性的命名域方式: using namespace std; 3. 初始化 vector // 建立一個空的vector。 vector c1(c2) // 複製一個vector vector c(n) // 建立一個vector,含有n個數據,資料均已預設構造產生 vector c(n, elem) // 建立一個含有n個elem拷貝的vector vector c(beg,end) // 建立一個含有n個elem拷貝的vector
4. 解構函式 c.~vector () // 銷燬所有資料,釋放記憶體 5. 成員函式 c.assign(beg,end)c.assign(n,elem)   將[beg; end)區間中的資料賦值給c。將n個elem的拷貝賦值給c。 c.at(idx)   傳回索引idx所指的資料,如果idx越界,丟擲out_of_range。 c.back() // 傳回最後一個數據,不檢查這個資料是否存在。 c.begin() // 傳回迭代器中的第一個資料地址。 c.capacity() // 返回容器中資料個數。 c.clear() // 移除容器中所有資料。
c.empty() // 判斷容器是否為空。 c.end() // 指向迭代器中末端元素的下一個,指向一個不存在元素。 c.erase(pos) // 刪除pos位置的資料,傳回下一個資料的位置。 c.erase(beg,end) //刪除[beg,end)區間的資料,傳回下一個資料的位置。 c.front() // 傳回第一個資料。 get_allocator // 使用建構函式返回一個拷貝。 c.insert(pos,elem) // 在pos位置插入一個elem拷貝,傳回新資料位置。 c.insert(pos,n,elem) // 在pos位置插入n個elem資料。無返回值。 c.insert(pos,beg,end) // 在pos位置插入在[beg,end)區間的資料。無返回值。    c.max_size() // 返回容器中最大資料的數量。 c.pop_back() // 刪除最後一個數據。 c.push_back(elem) // 在尾部加入一個數據。 c.rbegin() // 傳回一個逆向佇列的第一個資料。 c.rend() // 傳回一個逆向佇列的最後一個數據的下一個位置。 c.resize(num) // 重新指定佇列的長度。 c.reserve() // 保留適當的容量。 c.size() // 返回容器中實際資料的個數。 c1.swap(c2) swap(c1,c2) // 將c1和c2元素互換。同上操作。 operator[] // 返回容器中指定位置的一個引用。 6. 用法示例: 6.1. 建立一個vector vector容器提供了多種建立方法,下面介紹幾種常用的。 建立一個Widget型別的空的vector物件:   vector vWidgets;    建立一個包含500個Widget型別資料的vector:   vector vWidgets(500);    建立一個包含500個Widget型別資料的vector,並且都初始化為0:   vector vWidgets(500, Widget(0));    建立一個Widget的拷貝:   vector vWidgetsFromAnother(vWidgets);    向vector新增一個數據   vector新增資料的預設方法是push_back()。 push_back()函式表示將資料新增到vector的尾部,並按需要來分配記憶體。 例如:向vector中新增10個數據,需要如下編寫程式碼:   for(int i= 0;i<10; i++) {    vWidgets.push_back(Widget(i));   } 6.2 獲取vector中指定位置的資料   vector裡面的資料是動態分配的,使用push_back()的一系列分配空間常常決定於檔案或一些資料來源。 如果想知道vector存放了多少資料,可以使用empty()。 獲取vector的大小,可以使用size()。 例如,如果想獲取一個vector v的大小,但不知道它是否為空,或者已經包含了資料,如果為空想設定為-1, 你可以使用下面的程式碼實現:   int nSize = v.empty() ? -1 : static_cast(v.size());    6.3 訪問vector中的資料 使用兩種方法來訪問vector1vector::at() 2vector::operator[]   operator[]主要是為了與C語言進行相容。它可以像C語言陣列一樣操作。 但at()是我們的首選,因為at()進行了邊界檢查,如果訪問超過了vector的範圍,將丟擲一個例外。 由於operator[]容易造成一些錯誤,所有我們很少用它,下面進行驗證一下:    分析下面的程式碼:   vector v;   v.reserve(10);    for(int i=0; i<7; i++) {    v.push_back(i);   }    try {int iVal1 = v[7];    // not bounds checked - will not throw    int iVal2 = v.at(7);    // bounds checked - will throw if out of range   } catch(const exception& e) {    cout << e.what();   }    6.3 刪除vector中的資料 vector能夠非常容易地新增資料,也能很方便地取出資料, 同樣vector提供了erase(),pop_back(),clear()來刪除資料, 當刪除資料時,應該知道要刪除尾部的資料,或者是刪除所有資料,還是個別的資料。 Remove_if()演算法 如果要使用remove_if(),需要在標頭檔案中包含如下程式碼::   #include Remove_if()有三個引數:   1、 iterator _First:指向第一個資料的迭代指標。   2、 iterator _Last:指向最後一個數據的迭代指標。   3、 predicate _Pred:一個可以對迭代操作的條件函式。    6.4 條件函式 條件函式是一個按照使用者定義的條件返回是或否的結果,是最基本的函式指標,或是一個函式物件。 這個函式物件需要支援所有的函式呼叫操作,過載operator()()操作。 remove_if()是通過unary_function繼承下來的,允許傳遞資料作為條件。 例如,假如想從一個vector中刪除匹配的資料,如果字串中包含了一個值,從這個值開始,從這個值結束。 首先應該建立一個數據結構來包含這些資料,類似程式碼如下: #include enum findmodes { FM_INVALID = 0, FM_IS,  FM_STARTSWITH,  FM_ENDSWITH,  FM_CONTAINS }; typedef struct tagFindStr {  UINT iMode;  CString szMatchStr; } FindStr; typedef FindStr* LPFINDSTR;    然後處理條件判斷: class FindMatchingString : public std::unary_function { public:  FindMatchingString(const LPFINDSTR lpFS) :  m_lpFS(lpFS) {}  bool operator()(CString& szStringToCompare) const {   bool retVal = false;    switch (m_lpFS->iMode) {   case FM_IS: {    retVal = (szStringToCompare == m_lpFDD->szMatchStr);    break;   }   case FM_STARTSWITH: {    retVal = (szStringToCompare.Left(m_lpFDD->szMatchStr.GetLength())    == m_lpFDD->szWindowTitle);    break;   }   case FM_ENDSWITH: {    retVal = (szStringToCompare.Right(m_lpFDD->szMatchStr.GetLength())    == m_lpFDD->szMatchStr);   break;   }   case FM_CONTAINS: {    retVal = (szStringToCompare.Find(m_lpFDD->szMatchStr) != -1);    break;   }   }   return retVal; } private:  LPFINDSTR m_lpFS; }; 通過這個操作你可以從vector中有效地刪除資料: FindStr fs;   fs.iMode = FM_CONTAINS;   fs.szMatchStr = szRemove;   vs.erase(std::remove_if(vs.begin(), vs.end(), FindMatchingString(&fs)), vs.end());    Remove(),remove_if()等所有的移出操作都是建立在一個迭代範圍上的,不能操作容器中的資料。 所以在使用remove_if(),實際上操作的時容器裡資料的上面的。 看到remove_if()實際上是根據條件對迭代地址進行了修改,在資料的後面存在一些殘餘的資料, 那些需要刪除的資料。剩下的資料的位置可能不是原來的資料,但他們是不知道的。 呼叫erase()來刪除那些殘餘的資料。 注意上面例子中通過erase()刪除remove_if()的結果和vs.enc()範圍的資料。 7. 綜合例子: //--------------------------------------------------------------------------- #include #pragma hdrstop #include "Unit1.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; #include #include using namespace std; struct STResult { double Time; double Xp; double Yp; int id; }; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } vector ResultVector; void __fastcall test() { //test //vector ResultVector; STResult stritem; stritem.Time = .1; stritem.Xp = .1; stritem.Yp = .1; stritem.id = 1; ResultVector.push_back( stritem ); } //--------------------------------------------------------------------------- void __fastcall TForm1::Button1Click(TObject *Sender) { test(); assert(ResultVector[0].id == 1); } //---------------------------------------------------------------------------
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208
  • 209
  • 210
  • 211
  • 212
  • 213
  • 214
  • 215
  • 216
  • 217
  • 218
  • 219
  • 220
  • 221
  • 222
  • 223
  • 224
  • 225
  • 226
  • 227
  • 228
  • 229
  • 230
  • 231
  • 232
  • 233
  • 234
  • 235
  • 236
  • 237
  • 238
  • 239
  • 240
  • 241
  • 242
  • 243
  • 244
  • 245
  • 246
  • 247
  • 248
  • 249
  • 250
  • 251
  • 252
  • 253
  • 254
  • 255
  • 256
  • 257
  • 258
  • 259
  • 260
  • 261
  • 262
  • 263
  • 264
  • 265
  • 266
  • 267
  • 268
  • 269
  • 270
  • 271
  • 272
  • 273
  • 274
  • 275
  • 276
  • 277
  • 278
  • 279
  • 280

2、string

#include <string>// 注意是<string>,不是<string.h>,帶.h的是C語言中的標頭檔案

using  std::string;

using  std::wstring;

或

using namespace std;

下面你就可以使用string/wstring了,它們兩分別對應著charwchar_tstring和wstring的用法是一樣的,以下只用string作介紹:


string類的建構函式:

string(const char *s);    //用c字串s初始化
string(int n,char c);     //用n個字元c初始化
此外,string類還支援預設建構函式和複製建構函式,如string s1;string s2="hello";都是正確的寫法。當構造的string太長而無法表達時會丟擲length_error異常 ;


string類的字元操作:
const char &operator[](int n)const;
const char &at(int n)const;
char &operator[](int n);
char &at(int n);
operator[]和at()均返回當前字串中第n個字元的位置,但at函式提供範圍檢查,當越界時會丟擲out_of_range異常,下標運算子[]不提供檢查訪問。
const char *data()const;//返回一個非null終止的c字元陣列
const char *c_str()const;//返回一個以null終止的c字串
int copy(char *s, int n, int pos = 0) const;//把當前串中以pos開始的n個字元拷貝到以s為起始位置的字元陣列中,返回實際拷貝的數目


string的特性描述:
int capacity()const;    //返回當前容量(即string中不必增加記憶體即可存放的元素個數)
int max_size()const;    //返回string物件中可存放的最大字串的長度
int size()const;        //返回當前字串的大小
int length()const;       //返回當前字串的長度
bool empty()const;        //當前字串是否為空
void resize(int len,char c);//把字串當前大小置為len,並用字元c填充不足的部分

string類的輸入輸出操作:
string類過載運算子operator>>用於輸入,同樣過載運算子operator<<用於輸出操作。
函式getline(istream &in,string &s);用於從輸入流in中讀取字串到s中,以換行符'\n'分開。

string的賦值:
string &operator=(const string &s);//把字串s賦給當前字串
string &assign(const char *s);//用c型別字串s賦值
string &assign(const char *s,int n);//用c字串s開始的n個字元賦值
string &assign(const string &s);//把字串s賦給當前字串
string &assign(int n,char c);//用n個字元c賦值給當前字串
string &assign(const string &s,int start,int n);//把字串s中從start開始的n個字元賦給當前字串
string &assign(const_iterator first,const_itertor last);//把first和last迭代器之間的部分賦給字串

string的連線:
string &operator+=(const string &s);//把字串s連線到當前字串的結尾 
string &append(const char *s);            //把c型別字串s連線到當前字串結尾
string &append(const char *s,int n);//把c型別字串s的前n個字元連線到當前字串結尾
string &append(const string &s);    //同operator+=()
string &append(const string &s,int pos,int n);//把字串s中從pos開始的n個字元連線到當前字串的結尾
string &append(int n,char c);        //在當前字串結尾新增n個字元c
string &append(const_iterator first,const_iterator last);//把迭代器first和last之間的部分連線到當前字串的結尾


string的比較:
bool operator==(const string &s1,const string &s2)const;//比較兩個字串是否相等
運算子">","<",">=","<=","!="均被過載用於字串的比較;
int compare(const string &s) const;//比較當前字串和s的大小
int compare(int pos, int n,const string &s)const;//比較當前字串從pos開始的n個字元組成的字串與s的大小
int compare(int pos, int n,const string &s,int pos2,int n2)const;//比較當前字串從pos開始的n個字元組成的字串與s中

                                  //pos2開始的n2個字元組成的字串的大小
int compare(const char *s) const;
int compare(int pos, int n,const char *s) const;
int compare(int pos, int n,const char *s, int pos2) const;
compare函式在>時返回1,<時返回-1,==時返回0  


string的子串:
string substr(int pos = 0,int n = npos) const;//返回pos開始的n個字元組成的字串

string的交換:
void swap(string &s2);    //交換當前字串與s2的值


string類的查詢函式: 
int find(char c, int pos = 0) const;//從pos開始查詢字元c在當前字串的位置
int find(const char *s, int pos = 0) const;//從pos開始查詢字串s在當前串中的位置
int find(const char *s, int pos, int n) const;//從pos開始查詢字串s中前n個字元在當前串中的位置
int find(const string &s, int pos = 0) const;//從pos開始查詢字串s在當前串中的位置
//查詢成功時返回所在位置,失敗返回string::npos的值 
int rfind(char c, int pos = npos) const;//從pos開始從後向前查詢字元c在當前串中的位置
int rfind(const char *s, int pos = npos) const;
int rfind(const char *s, int pos, int n = npos) const;
int rfind(const string &s,int pos = npos) const;
//從pos開始從後向前查詢字串s中前n個字元組成的字串在當前串中的位置,成功返回所在位置,失敗時返回string::npos的值 
int find_first_of(char c, int pos = 0) const;//從pos開始查詢字元c第一次出現的位置
int find_first_of(const char *s, int pos = 0) const;
int find_first_of(const char *s, int pos, int n) const;
int find_first_of(const string &s,int pos = 0) const;
//從pos開始查詢當前串中第一個在s的前n個字元組成的數組裡的字元的位置。查詢失敗返回string::npos 
int find_first_not_of(char c, int pos = 0) const;
int find_first_not_of(const char *s, int pos = 0) const;
int find_first_not_of(const char *s, int pos,int n) const;
int find_first_not_of(const string &s,int pos = 0) const;
//從當前串中查詢第一個不在串s中的字元出現的位置,失敗返回string::npos 
int find_last_of(char c, int pos = npos) const;
int find_last_of(const char *s, int pos = npos) const;
int find_last_of(const char *s, int pos, int n = npos) const;
int find_last_of(const string &s,int pos = npos) const; 
int find_last_not_of(char c, int pos = npos) const;
int find_last_not_of(const char *s, int pos = npos) const;
int find_last_not_of(const char *s, int pos, int n) const;
int find_last_not_of(const string &s,int pos = npos) const;
//find_last_of和find_last_not_of與find_first_of和find_first_not_of相似,只不過是從後向前查詢


//string類的替換函式: 
string &replace(int p0, int n0,const char *s);//刪除從p0開始的n0個字元,然後在p0處插入串s
string &replace(int p0, int n0,const char *s, int n);//刪除p0開始的n0個字元,然後在p0處插入字串s的前n個字元
string &replace(int p0, int n0,const string &s);//刪除從p0開始的n0個字元,然後在p0處插入串s
string &replace(int p0, int n0,const string &s, int pos, int n);//刪除p0開始的n0個字元,然後在p0處插入串s中從pos開始的n個字元
string &replace(int p0, int n0,int n, char c);//刪除p0開始的n0個字元,然後在p0處插入n個字元c
string &replace(iterator first0, iterator last0,const char *s);//把[first0,last0)之間的部分替換為字串s
string &replace(iterator first0, iterator last0,const char *s, int n);//把[first0,last0)之間的部分替換為s的前n個字元
string &replace(iterator first0, iterator last0,const string &s);//把[first0,last0)之間的部分替換為串s
string &replace(iterator first0, iterator last0,int n, char c);//把[first0,last0)之間的部分替換為n個字元c
string &replace(iterator first0, iterator last0,const_iterator first, const_iterator last);//把[first0,last0)之間的部分替換成[first,last)之間的字串


string類的插入函式: 
string &insert(int p0, const char *s);
string &insert(int p0, const char *s, int n);
string &insert(int p0,const string &s);
string &insert(int p0,const 
            
           

相關推薦

常用STL整理

常用STL庫的整理 1、vector 1. 在C++中的詳細說明 vector是C++標準模板庫中的部分內容,它是一個多功能的,能夠操作多種資料結構和演算法的模板類和函式庫。 vector之所以被認為是一個容器,是因為它能夠像容器一樣存放各種型別的物件, 簡

go語言常用開源整理

red ces href app ptc github 時間插件 ova 單元 框架 https://github.com/go-martini/martini 圖形驗證碼 https://github.com/dchest/captcha ORM https://gith

Vue-ui常用元件整理

Vue-ui常用元件庫整理 檢視全部整理內容==》 element-ui Element 是由餓了麼UED設計、餓了麼大前端開發的一套基於 Vue 2.0 的桌面端元件庫。 這款是我用了很久的,比較適合開發後臺管理系統,官方更新和維護也很負責,元件也能滿足大部分開發需求 文件官網

常用影象整理

此篇博文裡的大部分內容來源於我在知乎上對做影象檢索,影象庫從哪兒能下載到?問題的回答。 這個問題對於每個剛做影象檢索的人都會碰到,我剛開始CBIR的時候也是谷歌影象庫漫天搜,後來隨著論文讀得多了,接觸到的影象庫也漸漸多了。回到正題,目前做CBIR用得比較多且流行的有下面幾個: MNIST手寫數

C++STL常騰訊分用分彩平臺出租數據結構用法整理

隊列 splice 插入元素 key alloc ase 輸出 整理 eve vector騰訊分用分彩平臺出租 haozbbs.com Q1446595067創建對象,vector<int> vec;尾部插入數字,vec.push_back(a);使用下表訪

queue (C++中STL常用queue基本用法的實現) ([連結串列],[陣列]的實現)

Queue: 依循先進先出的規則的單調佇列. 下面是用連結串列實現的queue的幾個基本用法和一個clear()的補充用法: #include<stdio.h> /* *Date:2018/10/22 *Author:Fushicho *Name:queue連

ios開發常用第三方收集以及整理

1、RESideMenu 實現側邊欄選單 2、AFNetworking 實現網路通訊的第三方庫 3、一個有用的服務網站,提供各種JSON資料,包括天氣、電話號碼、身份證查詢等。。 4、Masony一個用來對VIEW進行佈局的三方庫 5、MBProgressHUD一個

python常用整理

Numpy:python中基本的數學計算相關的庫 Matplotlib:主要用於2d畫圖 skimage:影象分析的一些操作 SciPy : 由一些基於 Python ,用於數學,科學和工程的開源軟

C++ STL常用標準容器

其中幾種種序列容器型別 C++ STL中最基本以及最常用的類或容器無非就是以下幾個: string vector deque list forward_list queue priority_queue stack string 對比在C語言中一般怎麼使用

Android常用的第三方整理

Android開源庫 自己一直很喜歡Android開發,就如部落格簽名一樣, 我是程式猿,我為自己代言 。 在摸索過程中,GitHub上搜集了很多很棒的Android第三方庫,推薦給在苦苦尋找的開發者,而且我會 不定期的更新 這篇文章。 Android下的優秀開發庫數

stack (C++中STL常用stack基本用法的實現) ([連結串列],[陣列]的實現)

Stack:依循先進後出原則的單調佇列. 下面是用連結串列實現的stack的幾個基本用法和一個clear()的補充用法: #include<stdio.h> /* *Date:2018/

Android(常用)主流UI開源整理

這幾天剛做完一個專案。。有點空餘時間,就想著吧這一兩年做的專案中的UI介面用到的一些庫整理一下。後來想了一下,既然要整理,就把網上常用的 AndroidUI介面的主流開源庫 一起整理一下,方便檢視。 這次整理包涵一些常規的按鈕、Switch、進度條等控制元件都

JavaEE常用小知識點整理

context add 結束 gin 參數 thread 函數 線程 -m 1.獲取項目路徑:request.getContextPath(); 2.獲取請求的參數:request.getQueryString(); 3.指定請求的字符編碼格式:URLEncoder.enc

基於.NET平臺常用的框架整理

open producer oauth isp mps exce too cms table 自從學習.NET以來,優雅的編程風格,極度簡單的可擴展性,足夠強大開發工具,極小的學習曲線,讓我對這個平臺產生了濃厚的興趣,在工作和學習中也積累了一些開源的組件,就目前想到的先整理

.NET平臺常用的框架整理

國內開源 開發者 自動任務 無需 活躍 omap otn 寵物商店 compile 分布式緩存框架: Microsoft Velocity:微軟自家分布式緩存服務框架。 Memcahed:一套分布式的高速緩存系統,目前被許多網站使用以提升網站的訪問速度。 Redi

九. 常用、向量與哈希5.向量及其應用

構造 pty obj 元素 init container right setsize 使用數組 Vector(向量)是 java.util 包中的一個類,該類實現了類似動態數組的功能。向量和數組相似,都可以保存一組數據(數據列表)。但是數組的大小是固定的,一旦指定,就不能改

Oracle 常用腳本整理

mach type bsp trim cas dia flash ins tables 一、統計表所占空間大小(表容量) /*一般情況下,表所占空間分為三部分:表數據、表索引、表blob字段數據*/--1 統計含(blob字段)的單表所占用的空間SELECT TABLE_N

前端CDN公共整理

通過 developer index.php ace ogl xlib 流量 type 國外 轉自: 灰狼博客, 地址: http://itlobo.com/articles/2016.html 現在web應用都在使用js類庫,這些類庫小的幾十K,大的幾百K,而國內網絡訪

pandas 常用函數整理

移除 column () fin 方差 apply() 常用函數 apply class pandas常用函數整理,作為個人筆記。 僅標記函數大概用途做索引用,具體使用方式請參照pandas官方技術文檔。 約定 from pandas import Series

php常用函數整理

blog ole 類型 整理 bject php常用函數 字符 min color 1.類型轉換 php基本類型有 int,float,string,bool,array,object,轉換方式有三種,這裏只介紹下面一種 (int) (bool) (float) (s