Learn practical skills, build real-world projects, and advance your career
import pandas as pd
df1 = pd.read_excel("C:/Users/Admin/Downloads/jaycopy.xlsx")
df2 = pd.read_excel("C:/Users/Admin/Downloads/shwetacopy.xlsx")
df2.head(44)
pd.merge(df1, df2, on=["Review Comment", "Category Comment"])
--------------------------------------------------------------------------- MemoryError Traceback (most recent call last) <ipython-input-4-0ce553970213> in <module> ----> 1 pd.merge(df1, df2, on=["Review Comment", "Category Comment"]) D:\softwares\Anaconda\anaconda\lib\site-packages\pandas\core\reshape\merge.py in merge(left, right, how, on, left_on, right_on, left_index, right_index, sort, suffixes, copy, indicator, validate) 87 validate=validate, 88 ) ---> 89 return op.get_result() 90 91 D:\softwares\Anaconda\anaconda\lib\site-packages\pandas\core\reshape\merge.py in get_result(self) 666 self.left, self.right = self._indicator_pre_merge(self.left, self.right) 667 --> 668 join_index, left_indexer, right_indexer = self._get_join_info() 669 670 llabels, rlabels = _items_overlap_with_suffix( D:\softwares\Anaconda\anaconda\lib\site-packages\pandas\core\reshape\merge.py in _get_join_info(self) 882 ) 883 else: --> 884 (left_indexer, right_indexer) = self._get_join_indexers() 885 886 if self.right_index: D:\softwares\Anaconda\anaconda\lib\site-packages\pandas\core\reshape\merge.py in _get_join_indexers(self) 861 """ return the join indexers """ 862 return _get_join_indexers( --> 863 self.left_join_keys, self.right_join_keys, sort=self.sort, how=self.how 864 ) 865 D:\softwares\Anaconda\anaconda\lib\site-packages\pandas\core\reshape\merge.py in _get_join_indexers(left_keys, right_keys, sort, how, **kwargs) 1348 }[how] 1349 -> 1350 return join_func(lkey, rkey, count, **kwargs) 1351 1352 pandas\_libs\join.pyx in pandas._libs.join.inner_join() MemoryError: Unable to allocate 700. GiB for an array with shape (93923574892,) and data type int64