Update Pandas dataframe value based on present value
<p>I have a Pandas dataframe with values which should lie between, say, <code>11-100</code>. However, sometimes I'll have values between <code>1-10</code>, and this is because the person who was entering that row used a convention that the value in question should be multiplied by 10. So what I'd like to do is run a Pandas command which will fix those particular rows by multiplying their value by <code>10</code>.</p>

<p>I can reference the values in question by doing something like </p>

<pre><code>my_dataframe[my_dataframe['column_name']&lt;10] 
</code></pre>

<p>and I could set them all to a particular value, like 50, like so</p>

<pre><code>my_dataframe[my_dataframe['column_name']&lt;10] = 50
</code></pre>

<p>but how do I set them to a value which is 10* the value of that particular row?</p>

<p>I think you can use:</p>

<pre><code>my_dataframe[my_dataframe['column_name']&lt;10] *= 10
</code></pre>

python pandas indexing dataframe multiplying