C Hashtable中存入陣列 List

2022-03-15 06:05:39 字數 1350 閱讀 7562

雜湊表中存入陣列示例**:

using

system;

using

system.collections.generic;

using

system.linq;

using

system.text;

using

system.threading.tasks;

using

system.collections;

namespace

; //

陣列 hash1.add("

key", data); //

陣列作為值存入雜湊表,對應鍵為key

hash1.add(kk, data);

int num1 = (int)hash1["

key"]; //

取出鍵為key的值

int num2 = (int

)hash1[kk];

int x = ((int)hash1["

key"])[2

]; console.writeline(

"x =

" +x);

console.writeline(

"陣列1:");

foreach (int i in num1) //

列印陣列1

console.write(i + "");

console.writeline(

"\n陣列2:");

foreach (int i in num2) //

列印陣列2

console.write(i + "");}}

}

輸入結果為:

x = 3

陣列1:12

345陣列2:12

345 請按任意鍵繼續. . .

存入list示例**:

using

system;

using

system.collections;

using

system.collections.generic;

using

system.linq;

using

system.text;

using

system.threading.tasks;

namespace

}}

執行結果:

list :12

3從雜湊表中取出list:12

3

**簡單,可以一下就看懂,類的話與之類似。

將numpy 陣列存入mysql中

首先在資料庫中建表 create table testblob framenum int not null,feature blob not null 其中framenum代表幀號,features代表256維的特徵向量,使用mysql中的blob型別 假如我們得到乙個特徵向量 feature 入庫...

將numpy 陣列存入mysql中

首先在資料庫中建表 create table testblob framenum int not null,feature blob not null 其中framenum代表幀號,features代表256維的特徵向量,使用mysql中的blob型別 假如我們得到乙個特徵向量 feature 入庫...

將numpy 陣列存入mysql中

首先在資料庫中建表 create table testblob framenum int not null,feature blob not null 其中framenum代表幀號,features代表256維的特徵向量,使用mysql中的blob型別 假如我們得到乙個特徵向量 feature 入庫...