-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: 'DataFrame' object has no attribute 'ix'
in Time Series Forecastings
#43
Comments
The .ix indexer has been deprecated in Pandas, which is why you're getting an AttributeError. Instead, you should use .loc or .iloc for label-based or integer-location based indexing, respectively. In the context of your code, you're trying to find the first date where office sales were higher than furniture sales. Here's how you can fix it using .loc: first_date = store.loc[store['office_sales'] > store['furniture_sales'], 'Order Date'].min()
print("Office supplies first time produced higher sales than furniture is {}.".format(first_date.date())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I tried to run
Time Series Forecastings
example. FromI got
AttributeError: 'DataFrame' object has no attribute 'ix'
If I replace
ix
toiloc
, based onhttps://stackoverflow.com/questions/59991397/attributeerror-dataframe-object-has-no-attribute-ix
then I gotValueError: Location based indexing can only have [integer, integer slice (START point is INCLUDED, END point is EXCLUDED), listlike of integers, boolean array] types
How to fix it? Thanks
The text was updated successfully, but these errors were encountered: