static void Main()
{
string json = @"
{
""0fea8f8a-4169-495d-8307-50bc333fd87d"": {
""serviceId"": ""4cb9125a-1eaa-4bd4-a473-cfccec0f3c63""
},
""0564d078-94f5-4f97-8398-b9f58a51f70b"": {
""serviceId"": ""00000000-0000-0000-0000-000000000000""
},
""f9a165d2-967d-4733-8599-1074270dae2e"": {
""serviceId"": ""00000000-0000-0000-0000-000000000000""
},
""86ccdsbf-e7ad-4851-93ff-6ec817469c1e"": {
""serviceId"": ""00000000-0000-0000-0000-000000000000""
}
}";
var result = JsonConvert.DeserializeObject<Dictionary<string, Service>>(json);
foreach (var pair in result)
{
Console.WriteLine("Key: " + pair.Key + " ServiceId: " + pair.Value.ServiceId);
}
}
当我运行此代码时,它显示此错误。实际上,我将k表示在movielens数据集上进行聚类。
答案 0 :(得分:0)
根据新版本的熊猫(1.1.x),语法已更改:
sp_arr = csr_matrix(most_rated_movies_1k)
sdf = pd.DataFrame.sparse.from_spmatrix(sp_arr)
sparse_ratings = sdf.sparse.to_coo()
希望这对您有用。