Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Merge all the coin frames into one, we populate the list first with Namecoin as it is the largest, by doing this
- # all sequencial merges will be of smaller size ie we don't loose any data
- data2['merged'] = data2['Namecoin']
- for coin in coins:
- data2['merged'] = pd.merge(left=data2['merged'],right=data2[coin], left_on='timestamp', right_on='timestamp', how='left')
- MemoryError Traceback (most recent call last)
- <ipython-input-16-a3fff37d9a9c> in <module>()
- 5
- 6 for coin in coins:
- ----> 7 data2['merged'] = pd.merge(left=data2['merged'],right=data2[coin], left_on='timestamp', right_on='timestamp', how='left')
- C:\Python27\lib\site-packages\pandas\tools\merge.pyc in merge(left, right, how, on, left_on, right_on, left_index, right_index, sort, suffixes, copy, indicator)
- 33 right_index=right_index, sort=sort, suffixes=suffixes,
- 34 copy=copy, indicator=indicator)
- ---> 35 return op.get_result()
- 36 if __debug__:
- 37 merge.__doc__ = _merge_doc % '\nleft : DataFrame'
- C:\Python27\lib\site-packages\pandas\tools\merge.pyc in get_result(self)
- 208 [(ldata, lindexers), (rdata, rindexers)],
- 209 axes=[llabels.append(rlabels), join_index],
- --> 210 concat_axis=0, copy=self.copy)
- 211
- 212 typ = self.left._constructor
- C:\Python27\lib\site-packages\pandas\core\internals.pyc in concatenate_block_managers(mgrs_indexers, axes, concat_axis, copy)
- 4454 copy=copy),
- 4455 placement=placement)
- -> 4456 for placement, join_units in concat_plan]
- 4457
- 4458 return BlockManager(blocks, axes)
- C:\Python27\lib\site-packages\pandas\core\internals.pyc in concatenate_join_units(join_units, concat_axis, copy)
- 4551 to_concat = [ju.get_reindexed_values(empty_dtype=empty_dtype,
- 4552 upcasted_na=upcasted_na)
- -> 4553 for ju in join_units]
- 4554
- 4555 if len(to_concat) == 1:
- C:\Python27\lib\site-packages\pandas\core\internals.pyc in get_reindexed_values(self, empty_dtype, upcasted_na)
- 4836 for ax, indexer in self.indexers.items():
- 4837 values = com.take_nd(values, indexer, axis=ax,
- -> 4838 fill_value=fill_value)
- 4839
- 4840 return values
- C:\Python27\lib\site-packages\pandas\core\common.pyc in take_nd(arr, indexer, axis, out, fill_value, mask_info, allow_fill)
- 785 out = np.empty(out_shape, dtype=dtype, order='F')
- 786 else:
- --> 787 out = np.empty(out_shape, dtype=dtype)
- 788
- 789 func = _get_take_nd_function(arr.ndim, arr.dtype, out.dtype,
- MemoryError:
Advertisement
Add Comment
Please, Sign In to add comment