Python Forum

Full Version: data frame excel cell calulation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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.