我有大约1100万行和21列,因此:
area_id_number, c000, c001, c002 ...
01293091302390, 2, 2, 0 ...
01293091302391, 2, 0, 0 ...
01293091302392, 3, 1, 1 ...
我想以这样的方式结束:
value_id, area_id_number, value_type
1, 01293091302390, c000
2, 01293091302390, c000
3, 01293091302390, c001
4, 01293091302390, c001
5, 01293091302391, c000
6, 01293091302391, c000
7, 01293091302392, c000
8, 01293091302392, c000
9, 01293091302392, c000
10, 01293091302392, c001
11, 01293091302392, c002
...
我还没有找到一个方法来做这个。我已经查看了unpack/pivot/deaggregate(找不到这些术语的正确解决方案…)
这个问题的第二部分是,我会有记忆问题吗?我有什么需要考虑的吗?最后我应该有1.4亿行了。你知道吗
主进程是由
ndarray.repeat()
计算的,我没有足够的内存来测试11M行,但下面是代码:首先创建测试数据:
以下是流程代码:
相关问题 更多 >
编程相关推荐