T O P I C R E V I E W |
syxz0628 |
Posted - 04/25/2023 : 09:00:55 AM 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. |
2 L A T E S T R E P L I E S (Newest First) |
murray3 |
Posted - 01/26/2024 : 04:25:38 AM 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. |
minimax |
Posted - 04/25/2023 : 10:08:06 AM please update originpro package to the latest v1.1.6 |
|
|