OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Compute statistical values out of a precounted list in Python

  • Thread starter Thread starter MatMorPau22
  • Start date Start date
M

MatMorPau22

Guest
I have a dataframe of precounted data (shown below). Let's assume it's a "Do you like?" scale, where 4 people answered 1-Don't like at all, 10 people answer 2-Don't like and so on.

How can I compute the different statistical values? I want to compute the mean (in this case, it can be done by hand (4*1+10*2+125*3+85*4+25*5)/(4+10+125+85+25)=3.47) and the standard deviation

Code:
df=pd.DataFrame({1:4,2:10,3:125,4:85,5:25})
<p>I have a dataframe of precounted data (shown below). Let's assume it's a "Do you like?" scale, where 4 people answered 1-Don't like at all, 10 people answer 2-Don't like and so on.</p>
<p>How can I compute the different statistical values? I want to compute the mean (in this case, it can be done by hand <code>(4*1+10*2+125*3+85*4+25*5)/(4+10+125+85+25)=3.47)</code> and the standard deviation</p>
<pre><code>df=pd.DataFrame({1:4,2:10,3:125,4:85,5:25})
</code></pre>
 

Latest posts

S
Replies
0
Views
1
Safwan Aipuram
S

Online statistics

Members online
0
Guests online
4
Total visitors
4
Top