Return Pandas DataFrame references/names to a list?
<p>I've defined a function that cleans a data frame and returns a new dataframe. I have many data frames that I want to run this function on. I had a list of my DFs, <code>namelist=[a,b,c]</code> and passed them in a loop through my function. I want to return a similar list, <code>cleanDFs=[aClean, bClean, cClean]</code>. I tried to do this like so:</p>

<pre><code>for i in range(0, len(Names)):
    c = dataCleaning(catDFs[i])
    cleanDFs.append(pd.DataFrame(c))
</code></pre>

<p>However, this makes <code>cleanDFs</code> be a list of the <em>contents</em> of each data frame, not a list of names. How can I accomplish what I'm trying to do?</p>

<p>I'd do</p>

<pre><code>cleadDFs = [dataCleaning(d) for d in catDFs]
</code></pre>

python pandas