The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Python
 AttributeError: 'DataFrame' object has no attribut
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

syxz0628

China
4 Posts

Posted - 04/25/2023 :  09:00:55 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): Origin2022
Operating System:Windows
I got this error message when I simply use the command:
dfall = wksall.to_df()

AttributeError: 'DataFrame' object has no attribute

Looks like "iteritems" was removed in pandas 2.0.

Problem can be solved by installing pandas 1.5.
However, I am wondering if there is other solutions in the future.

minimax

348 Posts

Posted - 04/25/2023 :  10:08:06 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
please update originpro package to the latest v1.1.6
Go to Top of Page

murray3

United Kingdom
1 Posts

Posted - 01/26/2024 :  04:25:38 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by syxz0628

Origin Ver. and Service Release (Select Help-->About Origin): Origin2022
Operating System:Windows
I got this error message when I simply use the command:
dfall = wksall.to_df()

AttributeError: 'DataFrame' object has no attribute

Looks like "iteritems" was removed in pandas 2.0.

Problem can be solved by installing pandas 1.5.
However, I am wondering if there is other solutions in the future.



In this case, the 'iteritems' attribute is typically used to iterate over columns in a DataFrame. In pandas 2.0 and later versions, the preferred method for iterating over columns is to use the 'items()' method. Here's an example of how you can modify your code to work with the latest version of pandas:

dfall = wksall.to_df()
for column_name, column_data in dfall.items():
# Do something with each column
print(column_name, column_data)
By using the 'items()' method, you can iterate over the columns of the DataFrame and access both the column names and the corresponding data. This approach will ensure compatibility with future versions of pandas.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000