1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to be sure that my data types are float64 in my equations?

Discussion in 'Programming/Internet' started by Mypel, Sep 12, 2018.

  1. Mypel

    Mypel Guest

    I have a DataFrame with index (Dates) and two columns (A and B). The DataFrame type, is float64 at these columns.

    I am using for loop, to make some calculations. and i want to add the results x1 and x2 to a new columns, Alpha and Beta, Respectively.

    I tried to use the following line to recognize the data type

    print (df.dtypes)

    to see the type of my data, after ...


    My code is:

    for Rw in range(25):
    def adj(df):

    if R>=V:

    print (df.dtypes)

    I get an Error:

    AttributeError: 'float' object has no attribute 'dtypes'

    I'm afraid that lines with .at[ _ ] in the loop, are not represents float64 types.

    How can i be sure or how can i change to float64 or how can i add these "Alpha" and "Beta" to my DataFrame? ...i am using python27.

    Login To add answer/comment

Share This Page