Convert whole dataframe from lower case to upper case with Pandas
<p>I have a dataframe like the one displayed below: </p>

<pre><code># Create an example dataframe about a fictional army
raw_data = {'regiment': ['Nighthawks', 'Nighthawks', 'Nighthawks', 'Nighthawks'],
            'company': ['1st', '1st', '2nd', '2nd'],
            'deaths': ['kkk', 52, '25', 616],
            'battles': [5, '42', 2, 2],
            'size': ['l', 'll', 'l', 'm']}
df = pd.DataFrame(raw_data, columns = ['regiment', 'company', 'deaths', 'battles', 'size'])
</code></pre>

<p><a href="https://i.stack.imgur.com/fiOEt.png" rel="noreferrer"><img src="https://i.stack.imgur.com/fiOEt.png" alt="enter image description here"></a></p>

<p>My goal is to transform every single string inside of the dataframe to upper case so that it looks like this:</p>

<p><a href="https://i.stack.imgur.com/gprF6.png" rel="noreferrer"><img src="https://i.stack.imgur.com/gprF6.png" alt="enter image description here"></a></p>

<p>Notice: all data types are objects and must not be changed; the output must contain all objects. I want to avoid to convert every single column one by one... I would like to do it generally over the whole dataframe possibly.</p>

<p>What I tried so far is to do this but without success</p>

<pre><code>df.str.upper()
</code></pre>