Pandas .assign function is consuming a lot of memory.
#### Code Sample, a copy-pastable example if possible

```python
    def add_attribute(self, new_attribute, condition_column, categories, category, code):
        """
        This function adds new attribute with new values depends on the values in the condition column replaced
        with specific code.
        :param new_attribute: new attribute needs to be added
        :param condition_column: dependency of new attricute
        :param categories: categories data frame (diagrnosis/treatment)
        :param category: specific category
        :param code: icd9code for treatment, icd10code for diagnosis
        """
        print('Going to make new attribute: {}'.format(new_attribute))
        kwargs = {
            new_attribute: lambda x: self.data_frame[condition_column].loc[self.data_frame[condition_column].isin(
                list(categories[category][code].values)
            )].replace(
                list(categories[category][code].values),
                list(categories[category]['category'].values)
            )
        }
        self.data_frame = self.data_frame.assign(**kwargs)
```
#### Problem description
Sorry the code is a bit complex.
^^^ I am doing this for almost 150+ new attributes (columns) And with every new attribute the memory usage by the program increases badly.
Particularly it worked in Mac book with 8GB ram but in windows with 64GM ram it is throwing MemoryError.
Thanks in advance.

#### Output of ``pd.show_versions()``

<details>

INSTALLED VERSIONS
------------------
commit: None
python: 3.6.2.final.0
python-bits: 64
OS: Darwin
OS-release: 16.7.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None

pandas: 0.20.3
pytest: None
pip: 9.0.1
setuptools: 28.8.0
Cython: None
numpy: 1.13.1
scipy: 0.19.1
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.6.1
pytz: 2017.2
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 2.0.2
openpyxl: None
xlrd: 1.1.0
xlwt: 1.3.0
xlsxwriter: 1.0.2
lxml: None
bs4: 4.6.0
html5lib: 0.9999999
sqlalchemy: None
pymysql: None
psycopg2: 2.7.3.1 (dt dec pq3 ext lo64)
jinja2: None
s3fs: None
pandas_gbq: None
pandas_datareader: None
</details>

