Python Forum
data frame excel cell calulation
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
data frame excel cell calulation
#1
Question 1
I am having issue finding the information on operating


[Image: search?q=excel+worksheet&tbm=isch&chips=...fopxN7mbbM]

such as how can I make cell I2 = G8 / G9

I don't know where to start, and I cannot think of the proper keyword to search for it.

I want to operate on the calculation on two or more random numbers.

------
question 2
How do I add photo in the post? it only allows me to add URL for the image. won't allow me to attach one.
Reply
#2
Well, let me ask the question in another way.
def macdfuncs(data):
    
    # here are theclose=data['Close'] code for EMA short and EMA long
    close=data['Close']
    
    #EMA short
    sma_short = close.rolling(12).mean()
    temp1=close.copy()
    temp1.iloc[0:12] = sma_short[0:12]

    ema_short = temp1.ewm(span=12, adjust=False).mean()
This code is not efficient.

    sma_short = close.rolling(12).mean()
    temp1=close.copy()
    temp1.iloc[0:12] = sma_short[0:12]
I only need the 12th cell in "ema_short" column to be the average of the first 12 cells in "close" column . and 13th to end in "ema_short" to be EMA.
is there a way just set the specific cell to be the average of 12 cells?

Thanks.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  how do you style data frame that has empty rows. gsaray101 0 500 Sep-08-2023, 05:20 PM
Last Post: gsaray101
  Copy data from Excel and paste into Discord (Midjourney) Joe_Wright 4 1,926 Jun-06-2023, 05:49 PM
Last Post: rajeshgk
  Reading data from excel file –> process it >>then write to another excel output file Jennifer_Jone 0 1,048 Mar-14-2023, 07:59 PM
Last Post: Jennifer_Jone
  googletrans library to translate text language for using data frame is not running gcozba2023 0 1,165 Mar-06-2023, 09:50 AM
Last Post: gcozba2023
  How to properly format rows and columns in excel data from parsed .txt blocks jh67 7 1,802 Dec-12-2022, 08:22 PM
Last Post: jh67
  Trying to Get Arduino sensor data over to excel using Python. eh5713 1 1,621 Dec-01-2022, 01:52 PM
Last Post: deanhystad
  Appending a row of data in an MS Excel file azizrasul 3 1,140 Nov-06-2022, 05:17 PM
Last Post: azizrasul
  Deleting rows based on cell value in Excel azizrasul 11 2,480 Oct-19-2022, 02:38 AM
Last Post: azizrasul
  Moving data from one Excel to another and finding maximum profit azizrasul 7 1,415 Oct-06-2022, 06:13 PM
Last Post: azizrasul
  Load multiple Jason data in one Data Frame vijays3 6 1,500 Aug-12-2022, 05:17 PM
Last Post: vijays3

Forum Jump:

User Panel Messages

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