Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 16150

Create a new dataset which displays the 'mean' for each column

$
0
0

I have a dataframe that looks like this:

NPlaceNumberCHEGD
1Angus253345236043
2Argyl432312561945
3Ayrsh144627921412

and i want to create a function which iterates through 'C', 'H', 'E', 'G', 'D', and creates a new dataframes where the row values are replaced with the mean, eg: meanC = 33/25, meanH = 45/25, meanE = 23/25.

I am not quite sure how to go about it.Any help would be appreciated, thankyou!


Viewing all articles
Browse latest Browse all 16150

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>