I am currently trying to combine two different datasets with an identical column called Ccode using the following method:
import pandas as pd
data_a = pd.read_csv(r'system.csv', encoding = 'cp949')
data_b = pd.read_csv(r'Seoul.csv', encoding = 'cp949')
pd.merge(data_a, data_b, how = 'left', on = 'Ccode')
Instead of getting a combined table this error message keeps popping up:
MemoryError: Unable to allocate 73.7 GiB for an array with shape (162, 61021050) and data type int64
Should I try a different method or was there something wrong with my code?
EDIT: Here's a sample of the data I'm working with:
data_a = pd.DataFrame({'Ccode': [11260, 11203, 12121, 13101, 11002], 'Dname': ['Jonggu', 'Jongnogu', 'Seongbukgu', 'Mapogu', 'Dongdaemungu'], Xcoor [205310, 210191, 199768, 200974, 198397], Ycoor[445727, 446339, 452273, 451975, 451624]},
columns=['Ccode', 'Dname', 'Xcoor', 'Ycoor'])
data_b = pd.DataFrame({'Ccode': [12260, 11133, 11001, 11591, 10000], 'Acode': ['11', '11', '11', '11', '11'], Opostc [135080, 153010, 143200, 157812, 138735], Npostc[6149, 8545, 4992, 7619, 5510]},
columns=['Ccode', 'Acode', 'Opostc', 'Npostc'])
There are a total of 33 columns in data_a and 168 columns in data_b. The only column that the two data sets share is 'Ccode',