<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Applying a formula to list of python dataframes produces error: object of type 'builtin_function_or_method' has no len().  How to fix? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/applying-a-formula-to-list-of-python-dataframes-produces-error/m-p/18741#M12480</link>
    <description>&lt;P&gt;I have a df where I am calculating values by month. When I run this code on my df it generates the desired results:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;for i in range(12,len(df.index)):
    df.iloc[i, 1] = df.iloc[i-12,1]*(((df.iloc[i,3]/100)+(df.iloc[i,6]/100))+1)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So far so good. I want to apply this same formula to more than 1 df so I try using a list &amp;amp; modify the code above. To begin I place my initial df into the list and run the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;my_dfs=[df]
&amp;nbsp;
for i in range(12,len(my_dfs.index)):
    my_dfs.iloc[i, 1] = my_dfs.iloc[i-12,1]*(((my_dfs.iloc[i,3]/100)+(my_dfs.iloc[i,6]/100))+1)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But I get the error message:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;object of type 'builtin_function_or_method' has no len()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How do I fix this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jun 2022 20:18:55 GMT</pubDate>
    <dc:creator>Jack</dc:creator>
    <dc:date>2022-06-03T20:18:55Z</dc:date>
    <item>
      <title>Applying a formula to list of python dataframes produces error: object of type 'builtin_function_or_method' has no len().  How to fix?</title>
      <link>https://community.databricks.com/t5/data-engineering/applying-a-formula-to-list-of-python-dataframes-produces-error/m-p/18741#M12480</link>
      <description>&lt;P&gt;I have a df where I am calculating values by month. When I run this code on my df it generates the desired results:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;for i in range(12,len(df.index)):
    df.iloc[i, 1] = df.iloc[i-12,1]*(((df.iloc[i,3]/100)+(df.iloc[i,6]/100))+1)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So far so good. I want to apply this same formula to more than 1 df so I try using a list &amp;amp; modify the code above. To begin I place my initial df into the list and run the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;my_dfs=[df]
&amp;nbsp;
for i in range(12,len(my_dfs.index)):
    my_dfs.iloc[i, 1] = my_dfs.iloc[i-12,1]*(((my_dfs.iloc[i,3]/100)+(my_dfs.iloc[i,6]/100))+1)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But I get the error message:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;object of type 'builtin_function_or_method' has no len()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How do I fix this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 20:18:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/applying-a-formula-to-list-of-python-dataframes-produces-error/m-p/18741#M12480</guid>
      <dc:creator>Jack</dc:creator>
      <dc:date>2022-06-03T20:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: Applying a formula to list of python dataframes produces error: object of type 'builtin_function_or_method' has no len().  How to fix?</title>
      <link>https://community.databricks.com/t5/data-engineering/applying-a-formula-to-list-of-python-dataframes-produces-error/m-p/18743#M12482</link>
      <description>&lt;P&gt;Hey there @Jack Homareau​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope all is well! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We'd love to hear from you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 16:38:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/applying-a-formula-to-list-of-python-dataframes-produces-error/m-p/18743#M12482</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-11T16:38:40Z</dc:date>
    </item>
  </channel>
</rss>

