Python Forum
calculate specified column or row mean
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
calculate specified column or row mean
#1
Hi,

I have the data pandas.DataFrame as below:
I want to compute column 3 mean and row 4 mean.
test:

AAB   BT     2     5  5.1
0  YUT  HYT  89.0  52.0  3.0
4  YHT   JU  25.0  63.0  2.0
0  YUT  HYT  89.0  52.0  3.0
4  YHT   JU  25.0  63.0  2.0
0  YUT  HYT  89.0  52.0  3.0
4  YHT   JU  25.0  63.0  2.0

I use the below command, but it give error:
DataFrame.mean(test[:,2])
Reply


Messages In This Thread
calculate specified column or row mean - by SriRajesh - May-20-2017, 12:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  iretate over columns in df and calculate euclidean distance with one column in pandas Pit292 0 3,370 May-09-2021, 06:46 PM
Last Post: Pit292

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020