- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我有两个 pickle 文件,其中包含 numpy ndarray 列表。
第一个泡菜文件:
{'encodings': [array([-0.18668848, 0.09167872, 0.02361359, -0.04610855, -0.11987427,
-0.06734911, 0.00542389, 0.02105863, 0.17828396, -0.00141097,
0.166828s45, -0.01075029, -0.20508201, 0.02762154, -0.00806585,
0.098497 , -0.17736666, -0.11334869, -0.10142692, -0.1134191 ,
0.06917755, 0.07989676, -0.04121129, 0.04280601, -0.12306173,
-0.29819348, -0.07650399, -0.10041754, 0.02334423, -0.06270325,
0.12638046, 0.10296188, -0.10587093, -0.08311734, 0.06213638,
0.08304631, -0.03443629, -0.08486824, 0.23685798, 0.01827276,
-0.10278646, 0.01152256, 0.08467054, 0.37257931, 0.15582474,
0.02709438, 0.04016857, -0.08466265, 0.14121686, -0.27717495,
0.13716345, 0.18896437, 0.05110805, 0.106585 , 0.15150583,
-0.1350172 , 0.02701535, 0.14240757, -0.17536291, 0.07862181,
0.06092819, 0.00497432, -0.03655054, -0.15420173, 0.1805391 ,
0.10382829, -0.07878115, -0.08832525, 0.15745324, -0.07997591,
-0.13981505, 0.04213319, -0.19279024, -0.15900737, -0.29393584,
0.10862678, 0.41602921, 0.15656555, -0.11855101, 0.04216752,
-0.0232455 , -0.03370954, 0.0355633 , 0.03816839, -0.13917619,
-0.06723036, -0.04189514, 0.11147611, 0.1995673 , 0.03261004,
-0.10638862, 0.1559474 , 0.05621403, -0.05708034, 0.0482568 ,
0.01418147, -0.04671318, -0.06601512, -0.20332824, -0.0691556 ,
0.12811929, -0.07675947, -0.01019647, 0.12645237, -0.19479996,
0.10532782, 0.03804317, -0.04418825, -0.06108642, 0.02885859,
-0.15403567, 0.05608891, 0.19509147, -0.15066354, 0.22698388,
0.12219262, 0.05469556, 0.15206271, 0.06922045, 0.04643065,
-0.02632714, -0.01712689, -0.09087028, -0.06960677, 0.08032852,
0.13741611, 0.06458308, 0.07958878])], 'names': ['tom']}
第二个泡菜文件:
{'encodings': [array([-1.10906549e-01, 2.82760076e-02, 1.40928570e-02, -7.55623430e-02,
-1.18420059e-02, -6.79435134e-02, 7.94159248e-04, -2.11588703e-02,
1.68759167e-01, -6.51913695e-03, 1.54918343e-01, 2.80910246e-02,
-2.08628818e-01, -2.71124691e-02, 2.27540880e-02, 3.07342559e-02,
-1.96070462e-01, -9.49537754e-02, -8.10625032e-02, -8.46448690e-02,
3.26108336e-02, 4.36929706e-03, 4.52538766e-02, 1.06669012e-02,
-1.42774120e-01, -3.27435136e-01, -9.54359397e-02, -1.95318609e-01,
6.05729260e-02, -7.79287443e-02, 6.29613698e-02, -1.52168227e-02,
-1.35686964e-01, -3.66957076e-02, 2.39675865e-04, 4.68941033e-02,
-4.50511239e-02, -3.71131971e-02, 1.89375550e-01, 4.80678454e-02,
-1.22665457e-01, -3.68929692e-02, -3.50655429e-03, 3.41097176e-01,
1.51335686e-01, 8.24191347e-02, 9.05722976e-02, -2.97215953e-03,
1.33755967e-01, -2.90517062e-01, 1.33845448e-01, 9.89130512e-02,
6.75613731e-02, 3.23878974e-02, 1.52221993e-01, -1.62803844e-01,
8.13175887e-02, 1.11765333e-01, -2.38216847e-01, 1.41546726e-01,
9.62506086e-02, 3.70164961e-03, -5.48346117e-02, 3.90823977e-03,
2.20120877e-01, 1.01806007e-01, -1.14795811e-01, -1.18746825e-01,
7.93062896e-02, -1.68676943e-01, -1.02184657e-02, 8.04015025e-02,
-1.35200977e-01, -1.91683397e-01, -2.35828787e-01, 1.02385968e-01,
4.50523496e-01, 1.27005681e-01, -7.58898705e-02, 4.50269431e-02,
-5.20654880e-02, -4.20882925e-02, 1.13409899e-01, 6.25026077e-02,
-1.17209882e-01, 2.94286814e-02, -1.15291528e-01, 5.63262142e-02,
1.39795944e-01, -1.62808914e-02, -4.35662456e-02, 1.33413598e-01,
-3.00255269e-02, -1.28360288e-02, -3.27749550e-03, 8.85868631e-03,
-1.23581521e-01, 4.58956361e-02, -5.75632229e-02, 6.86901249e-03,
1.01847328e-01, -7.13049620e-02, -4.22733976e-03, 5.29949181e-02,
-1.64895400e-01, 1.34815559e-01, -2.89627630e-02, -6.24453239e-02,
-3.33562531e-02, -2.41741575e-02, -9.46198851e-02, -3.14747319e-02,
1.33324310e-01, -2.73984402e-01, 1.59612253e-01, 2.19413936e-01,
4.25861105e-02, 1.33684829e-01, -2.11685020e-02, -3.15915793e-04,
1.95543766e-02, 8.47738683e-02, -1.88602582e-01, -2.10027974e-02,
-6.66024908e-03, 2.21308358e-02, -1.30187161e-03, -5.09036798e-03])], 'names': ['jack']}
我想要:
{'encodings': [array([-1.10906549e-01, 2.82760076e-02, 1.40928570e-02, -7.55623430e-02,
-1.18420059e-02, -6.79435134e-02, 7.94159248e-04, -2.11588703e-02,
1.68759167e-01, -6.51913695e-03, 1.54918343e-01, 2.80910246e-02,
-2.08628818e-01, -2.71124691e-02, 2.27540880e-02, 3.07342559e-02,
-1.96070462e-01, -9.49537754e-02, -8.10625032e-02, -8.46448690e-02,
3.26108336e-02, 4.36929706e-03, 4.52538766e-02, 1.06669012e-02,
-1.42774120e-01, -3.27435136e-01, -9.54359397e-02, -1.95318609e-01,
6.05729260e-02, -7.79287443e-02, 6.29613698e-02, -1.52168227e-02,
-1.35686964e-01, -3.66957076e-02, 2.39675865e-04, 4.68941033e-02,
-4.50511239e-02, -3.71131971e-02, 1.89375550e-01, 4.80678454e-02,
-1.22665457e-01, -3.68929692e-02, -3.50655429e-03, 3.41097176e-01,
1.51335686e-01, 8.24191347e-02, 9.05722976e-02, -2.97215953e-03,
1.33755967e-01, -2.90517062e-01, 1.33845448e-01, 9.89130512e-02,
6.75613731e-02, 3.23878974e-02, 1.52221993e-01, -1.62803844e-01,
8.13175887e-02, 1.11765333e-01, -2.38216847e-01, 1.41546726e-01,
9.62506086e-02, 3.70164961e-03, -5.48346117e-02, 3.90823977e-03,
2.20120877e-01, 1.01806007e-01, -1.14795811e-01, -1.18746825e-01,
7.93062896e-02, -1.68676943e-01, -1.02184657e-02, 8.04015025e-02,
-1.35200977e-01, -1.91683397e-01, -2.35828787e-01, 1.02385968e-01,
4.50523496e-01, 1.27005681e-01, -7.58898705e-02, 4.50269431e-02,
-5.20654880e-02, -4.20882925e-02, 1.13409899e-01, 6.25026077e-02,
-1.17209882e-01, 2.94286814e-02, -1.15291528e-01, 5.63262142e-02,
1.39795944e-01, -1.62808914e-02, -4.35662456e-02, 1.33413598e-01,
-3.00255269e-02, -1.28360288e-02, -3.27749550e-03, 8.85868631e-03,
-1.23581521e-01, 4.58956361e-02, -5.75632229e-02, 6.86901249e-03,
1.01847328e-01, -7.13049620e-02, -4.22733976e-03, 5.29949181e-02,
-1.64895400e-01, 1.34815559e-01, -2.89627630e-02, -6.24453239e-02,
-3.33562531e-02, -2.41741575e-02, -9.46198851e-02, -3.14747319e-02,
1.33324310e-01, -2.73984402e-01, 1.59612253e-01, 2.19413936e-01,
4.25861105e-02, 1.33684829e-01, -2.11685020e-02, -3.15915793e-04,
1.95543766e-02, 8.47738683e-02, -1.88602582e-01, -2.10027974e-02,
-6.66024908e-03, 2.21308358e-02, -1.30187161e-03, -5.09036798e-03]), array([-0.18668848, 0.09167872, 0.02361359, -0.04610855, -0.11987427,
-0.06734911, 0.00542389, 0.02105863, 0.17828396, -0.00141097,
0.16682845, -0.01075029, -0.20508201, 0.02762154, -0.00806585,
0.098497 , -0.17736666, -0.11334869, -0.10142692, -0.1134191 ,
0.06917755, 0.07989676, -0.04121129, 0.04280601, -0.12306173,
-0.29819348, -0.07650399, -0.10041754, 0.02334423, -0.06270325,
0.12638046, 0.10296188, -0.10587093, -0.08311734, 0.06213638,
0.08304631, -0.03443629, -0.08486824, 0.23685798, 0.01827276,
-0.10278646, 0.01152256, 0.08467054, 0.37257931, 0.15582474,
0.02709438, 0.04016857, -0.08466265, 0.14121686, -0.27717495,
0.13716345, 0.18896437, 0.05110805, 0.106585 , 0.15150583,
-0.1350172 , 0.02701535, 0.14240757, -0.17536291, 0.07862181,
0.06092819, 0.00497432, -0.03655054, -0.15420173, 0.1805391 ,
0.10382829, -0.07878115, -0.08832525, 0.15745324, -0.07997591,
-0.13981505, 0.04213319, -0.19279024, -0.15900737, -0.29393584,
0.10862678, 0.41602921, 0.15656555, -0.11855101, 0.04216752,
-0.0232455 , -0.03370954, 0.0355633 , 0.03816839, -0.13917619,
-0.06723036, -0.04189514, 0.11147611, 0.1995673 , 0.03261004,
-0.10638862, 0.1559474 , 0.05621403, -0.05708034, 0.0482568 ,
0.01418147, -0.04671318, -0.06601512, -0.20332824, -0.0691556 ,
0.12811929, -0.07675947, -0.01019647, 0.12645237, -0.19479996,
0.10532782, 0.03804317, -0.04418825, -0.06108642, 0.02885859,
-0.15403567, 0.05608891, 0.19509147, -0.15066354, 0.22698388,
0.12219262, 0.05469556, 0.15206271, 0.06922045, 0.04643065,
-0.02632714, -0.01712689, -0.09087028, -0.06960677, 0.08032852,
0.13741611, 0.06458308, 0.07958878])], 'names': ['jack', 'tom']}
如何将这两个 pickle 文件放入一个 pickle 文件中,以便“编码”位于一个位置,“名称”位于同一位置。每个编码都对应于最终 pickle 文件中的相应名称。
最佳答案
将第一个文件命名为 d1,将第二个文件命名为 d2,并使用下面的代码...让我知道这是否有帮助..否则我将再次编辑我的代码。
看看我尝试过什么可以建议你
d1={'encodings': [[-0.18668848, 0.09167872, 0.02361359, -0.04610855, -0.11987427,
-0.06734911, 0.00542389, 0.02105863, 0.17828396, -0.00141097,
0.16682845, -0.01075029, -0.20508201, 0.02762154, -0.00806585,
0.098497 , -0.17736666, -0.11334869, -0.10142692, -0.1134191 ,
0.06917755, 0.07989676, -0.04121129, 0.04280601, -0.12306173,
-0.29819348, -0.07650399, -0.10041754, 0.02334423, -0.06270325,
0.12638046, 0.10296188, -0.10587093, -0.08311734, 0.06213638,
0.08304631, -0.03443629, -0.08486824, 0.23685798, 0.01827276,
-0.10278646, 0.01152256, 0.08467054, 0.37257931, 0.15582474,
0.02709438, 0.04016857, -0.08466265, 0.14121686, -0.27717495,
0.13716345, 0.18896437, 0.05110805, 0.106585 , 0.15150583,
-0.1350172 , 0.02701535, 0.14240757, -0.17536291, 0.07862181,
0.06092819, 0.00497432, -0.03655054, -0.15420173, 0.1805391 ,
0.10382829, -0.07878115, -0.08832525, 0.15745324, -0.07997591,
-0.13981505, 0.04213319, -0.19279024, -0.15900737, -0.29393584,
0.10862678, 0.41602921, 0.15656555, -0.11855101, 0.04216752,
-0.0232455 , -0.03370954, 0.0355633 , 0.03816839, -0.13917619,
-0.06723036, -0.04189514, 0.11147611, 0.1995673 , 0.03261004,
-0.10638862, 0.1559474 , 0.05621403, -0.05708034, 0.0482568 ,
0.01418147, -0.04671318, -0.06601512, -0.20332824, -0.0691556 ,
0.12811929, -0.07675947, -0.01019647, 0.12645237, -0.19479996,
0.10532782, 0.03804317, -0.04418825, -0.06108642, 0.02885859,
-0.15403567, 0.05608891, 0.19509147, -0.15066354, 0.22698388,
0.12219262, 0.05469556, 0.15206271, 0.06922045, 0.04643065,
-0.02632714, -0.01712689, -0.09087028, -0.06960677, 0.08032852,
0.13741611, 0.06458308, 0.07958878]], 'names': ['tom']}
d2={'encodings': [[-1.10906549e-01, 2.82760076e-02, 1.40928570e-02, -7.55623430e-02,
-1.18420059e-02, -6.79435134e-02, 7.94159248e-04, -2.11588703e-02,
1.68759167e-01, -6.51913695e-03, 1.54918343e-01, 2.80910246e-02,
-2.08628818e-01, -2.71124691e-02, 2.27540880e-02, 3.07342559e-02,
-1.96070462e-01, -9.49537754e-02, -8.10625032e-02, -8.46448690e-02,
3.26108336e-02, 4.36929706e-03, 4.52538766e-02, 1.06669012e-02,
-1.42774120e-01, -3.27435136e-01, -9.54359397e-02, -1.95318609e-01,
6.05729260e-02, -7.79287443e-02, 6.29613698e-02, -1.52168227e-02,
-1.35686964e-01, -3.66957076e-02, 2.39675865e-04, 4.68941033e-02,
-4.50511239e-02, -3.71131971e-02, 1.89375550e-01, 4.80678454e-02,
-1.22665457e-01, -3.68929692e-02, -3.50655429e-03, 3.41097176e-01,
1.51335686e-01, 8.24191347e-02, 9.05722976e-02, -2.97215953e-03,
1.33755967e-01, -2.90517062e-01, 1.33845448e-01, 9.89130512e-02,
6.75613731e-02, 3.23878974e-02, 1.52221993e-01, -1.62803844e-01,
8.13175887e-02, 1.11765333e-01, -2.38216847e-01, 1.41546726e-01,
9.62506086e-02, 3.70164961e-03, -5.48346117e-02, 3.90823977e-03,
2.20120877e-01, 1.01806007e-01, -1.14795811e-01, -1.18746825e-01,
7.93062896e-02, -1.68676943e-01, -1.02184657e-02, 8.04015025e-02,
-1.35200977e-01, -1.91683397e-01, -2.35828787e-01, 1.02385968e-01,
4.50523496e-01, 1.27005681e-01, -7.58898705e-02, 4.50269431e-02,
-5.20654880e-02, -4.20882925e-02, 1.13409899e-01, 6.25026077e-02,
-1.17209882e-01, 2.94286814e-02, -1.15291528e-01, 5.63262142e-02,
1.39795944e-01, -1.62808914e-02, -4.35662456e-02, 1.33413598e-01,
-3.00255269e-02, -1.28360288e-02, -3.27749550e-03, 8.85868631e-03,
-1.23581521e-01, 4.58956361e-02, -5.75632229e-02, 6.86901249e-03,
1.01847328e-01, -7.13049620e-02, -4.22733976e-03, 5.29949181e-02,
-1.64895400e-01, 1.34815559e-01, -2.89627630e-02, -6.24453239e-02,
-3.33562531e-02, -2.41741575e-02, -9.46198851e-02, -3.14747319e-02,
1.33324310e-01, -2.73984402e-01, 1.59612253e-01, 2.19413936e-01,
4.25861105e-02, 1.33684829e-01, -2.11685020e-02, -3.15915793e-04,
1.95543766e-02, 8.47738683e-02, -1.88602582e-01, -2.10027974e-02,
-6.66024908e-03, 2.21308358e-02, -1.30187161e-03, -5.09036798e-03]], 'names': ['jack']}
d3={key: value + d2[key] for key, value in d1.iteritems()}
d3
关于python - 如何将多个pickle文件放入一个pickle文件中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54454592/
我需要将文本放在 中在一个 Div 中,在另一个 Div 中,在另一个 Div 中。所以这是它的样子: #document Change PIN
奇怪的事情发生了。 我有一个基本的 html 代码。 html,头部, body 。(因为我收到了一些反对票,这里是完整的代码) 这是我的CSS: html { backgroun
我正在尝试将 Assets 中的一组图像加载到 UICollectionview 中存在的 ImageView 中,但每当我运行应用程序时它都会显示错误。而且也没有显示图像。 我在ViewDidLoa
我需要根据带参数的 perl 脚本的输出更改一些环境变量。在 tcsh 中,我可以使用别名命令来评估 perl 脚本的输出。 tcsh: alias setsdk 'eval `/localhome/
我使用 Windows 身份验证创建了一个新的 Blazor(服务器端)应用程序,并使用 IIS Express 运行它。它将显示一条消息“Hello Domain\User!”来自右上方的以下 Ra
这是我的方法 void login(Event event);我想知道 Kotlin 中应该如何 最佳答案 在 Kotlin 中通配符运算符是 * 。它指示编译器它是未知的,但一旦知道,就不会有其他类
看下面的代码 for story in book if story.title.length < 140 - var story
我正在尝试用 C 语言学习字符串处理。我写了一个程序,它存储了一些音乐轨道,并帮助用户检查他/她想到的歌曲是否存在于存储的轨道中。这是通过要求用户输入一串字符来完成的。然后程序使用 strstr()
我正在学习 sscanf 并遇到如下格式字符串: sscanf("%[^:]:%[^*=]%*[*=]%n",a,b,&c); 我理解 %[^:] 部分意味着扫描直到遇到 ':' 并将其分配给 a。:
def char_check(x,y): if (str(x) in y or x.find(y) > -1) or (str(y) in x or y.find(x) > -1):
我有一种情况,我想将文本文件中的现有行包含到一个新 block 中。 line 1 line 2 line in block line 3 line 4 应该变成 line 1 line 2 line
我有一个新项目,我正在尝试设置 Django 调试工具栏。首先,我尝试了快速设置,它只涉及将 'debug_toolbar' 添加到我的已安装应用程序列表中。有了这个,当我转到我的根 URL 时,调试
在 Matlab 中,如果我有一个函数 f,例如签名是 f(a,b,c),我可以创建一个只有一个变量 b 的函数,它将使用固定的 a=a1 和 c=c1 调用 f: g = @(b) f(a1, b,
我不明白为什么 ForEach 中的元素之间有多余的垂直间距在 VStack 里面在 ScrollView 里面使用 GeometryReader 时渲染自定义水平分隔线。 Scrol
我想知道,是否有关于何时使用 session 和 cookie 的指南或最佳实践? 什么应该和什么不应该存储在其中?谢谢! 最佳答案 这些文档很好地了解了 session cookie 的安全问题以及
我在 scipy/numpy 中有一个 Nx3 矩阵,我想用它制作一个 3 维条形图,其中 X 轴和 Y 轴由矩阵的第一列和第二列的值、高度确定每个条形的 是矩阵中的第三列,条形的数量由 N 确定。
假设我用两种不同的方式初始化信号量 sem_init(&randomsem,0,1) sem_init(&randomsem,0,0) 现在, sem_wait(&randomsem) 在这两种情况下
我怀疑该值如何存储在“WORD”中,因为 PStr 包含实际输出。? 既然Pstr中存储的是小写到大写的字母,那么在printf中如何将其给出为“WORD”。有人可以吗?解释一下? #include
我有一个 3x3 数组: var my_array = [[0,1,2], [3,4,5], [6,7,8]]; 并想获得它的第一个 2
我意识到您可以使用如下方式轻松检查焦点: var hasFocus = true; $(window).blur(function(){ hasFocus = false; }); $(win
我是一名优秀的程序员,十分优秀!