Python Forum
Multiple MEAN value using FOR loop
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple MEAN value using FOR loop
#2
There is no meanAll[1]. You probably want to do this:
ndays = ([5, 8])
meanALL = []
 
for n in ndays:
    meanALL.append(df.rolling(window=n).Price.mean() \
                   .groupby('Name').head(n).dropna())
Reply


Messages In This Thread
Multiple MEAN value using FOR loop - by kka_anand - Jul-14-2020, 03:43 PM
RE: Multiple MEAN value using FOR loop - by deanhystad - Jul-14-2020, 03:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Trying to loop through code to plot seaborn line plots across multiple subplots eyavuz21 0 1,861 Dec-05-2022, 10:46 AM
Last Post: eyavuz21
  Multiple Loop Statements in a Variable Dexty 1 1,301 May-23-2022, 08:53 AM
Last Post: bowlofred
  Multiple user defined plots with secondary axes using for loop maltp 1 1,638 Apr-30-2022, 10:19 AM
Last Post: maltp
  Trying to separate a loop across multiple threads stylingpat 0 1,754 May-05-2021, 05:21 PM
Last Post: stylingpat
Question How to print multiple elements from multiple lists in a FOR loop? Gilush 6 3,151 Dec-02-2020, 07:50 AM
Last Post: Gilush
  How to Display Multiple Time Tables With While Loop ZQ12 2 2,261 Nov-10-2019, 04:15 AM
Last Post: ZQ12
  pytest loop through multiple tests? burvil 0 4,434 Sep-26-2019, 11:42 PM
Last Post: burvil
  Pasting multiple images on to one image with a for loop. DreamingInsanity 2 6,614 Feb-01-2019, 12:39 PM
Last Post: DreamingInsanity
  Creating multiple lists from file without long for loop Curtnos 2 4,571 Jan-28-2018, 09:11 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

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