Plotting (and saving) specific cells from multiple dataframe in Pandas
<p>For example, if I have 3 dataframes like this:</p>

<pre><code>In [1]: df1 = pd.DataFrame({'A': ['32', '36', '40', '33'],
   ...:                     'B': ['32', '34', '39', '35'],
   ...:                     'C': ['34', '32', '35', '36'],
   ...:                     'D': ['35', '39', '42', '40']},
   ...:                     index=[0, 1, 2, 3])
   ...: 

In [2]: df2 = pd.DataFrame({'A': ['33', '36', '37', '40'],
   ...:                     'B': ['42', '43', '46', '39'],
   ...:                     'C': ['34', '36', '38', '40'],
   ...:                     'D': ['32', '35', '34', '37']},
   ...:                      index=[0, 1, 2, 3])
   ...: 

In [3]: df3 = pd.DataFrame({'A': ['38', '39', '40', '41'],
   ...:                     'B': ['38', '37', '41', '40'],
   ...:                     'C': ['36', '39', '42', '41'],
   ...:                     'D': ['34', '39', '37', '39']},
   ...:                     index=[0, 1, 2, 3])
</code></pre>

<p>How if I want to plot specific cells from those 3 dataframe? For example, I want to plot the cell in the first row and first column from those dataframe, to see the trend.
To access it one by one using iloc is seem so lame, especially with more dataframes (actually I have 33 dataframes imported from csv, with 600 columns and 400 rows each)
Is there any way doing it easier than iloc?</p>

<p>You can do this either by doing a little bit of scripting or by making one big dataframe combining all the smaller dataframes</p>

<p>Scripting:</p>

<ol>
<li>Put all your df in a list <code>df_list = [df1, df2, df3]</code></li>
<li><p>Parse through the list, collect all the values in a list and then plot it. </p>

<pre><code>def plot_xy_cell(x, y, df_list):
    vals = [i.iloc(x, y) for i in df_list]
    ##plot the vals
</code></pre></li>
</ol>

<p>Big Dataframe:</p>

<ol>
<li>Create an extra index in each dataframe.</li>
<li>Combine all the dfs into one.</li>
<li>Use groupby clause to plot required columns</li>
</ol>

python pandas dataframe