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
  Filtering a data frame according to number of occurences of an observation Menthix 1 199 May-31-2021, 10:50 PM
Last Post: supuflounder
Smile Set 'Time' format cell when writing data to excel and not 'custom' limors 3 483 Mar-29-2021, 09:36 PM
Last Post: Larz60+
  How to append a value to specific excel cell using openpyxl hobbyist 0 592 Mar-05-2021, 07:14 PM
Last Post: hobbyist
  get year information from a timestamp data frame asli 1 297 Jan-08-2021, 09:11 PM
Last Post: Larz60+
  update column in one data frame with value of column from another data frame flexer 0 333 Dec-04-2020, 03:29 PM
Last Post: flexer
  Extract data from PDF page to Excel nathan_nz 1 402 Oct-29-2020, 08:04 PM
Last Post: Larz60+
  I try to import data from Excel table to Word Template. NewbiePyPy 0 556 Oct-21-2020, 12:25 PM
Last Post: NewbiePyPy
  Iterating Through Data Frame Rows JoeDainton123 1 697 Aug-06-2020, 05:54 AM
Last Post: scidam
  Extracting Rows From Data Frame and Understanding The Code JoeDainton123 0 476 Aug-03-2020, 04:08 PM
Last Post: JoeDainton123
  Exporting data from python into excel Zankawah 5 936 Jun-02-2020, 03:17 AM
Last Post: buran

Forum Jump:

User Panel Messages

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