You are making call to search2rad function as search2rad(search) where search is the function. Within search2rad(), you are doing:

if distance.haversine([search.index]['geometry']['coordinates'][1],[search.index]['geometry']['coordinates'][0], t_dicc['tuits']['coordinates']['latitud'], t_dicc['tuits']['coordinates']['longitud']<=radius):

Here you have mentioned search.index. It is raising error since it is function (with no attribute as index).

I think what you want to do is to pass the value returned by search() call to search2rad(). For that, you may do:

 search2rad(search())

But the cleaner way will be to do it like:

 index = search()
 search2rad(index)
Answer from Moinuddin Quadri on Stack Overflow
🌐
Statology
statology.org › home › how to fix: ‘numpy.ndarray’ object has no attribute ‘index’
How to Fix: 'numpy.ndarray' object has no attribute 'index'
September 17, 2021 - This error occurs when you attempt to use the index() function on a NumPy array, which does not have an index attribute available to use.
Discussions

python - Django: 'module' object has no attribute 'index' - Stack Overflow
I've been trying to learn Django for the past few days, but recently I've stumbled upon a problem I can't seem to fix. After finishing Django's own tutorial on writing your first app I decided to go More on stackoverflow.com
🌐 stackoverflow.com
object has no attribute 'index'
class ABC: def __init__(self): self.details = {'Name' : ['Ankit', 'Aishwarya', 'Shaurya', 'Shivangi'],'Age' : [23, 21, 22, 21]} self.df = pd.DataFrame(self.details) looks like it has an indent problem, you probably want class ABC: def __init__(self): self.details = {'Name' : ['Ankit', 'Aishwarya', 'Shaurya', 'Shivangi'],'Age' : [23, 21, 22, 21]} self.df = pd.DataFrame(self.details) but i don't know if that's in your code or just in your reddit post More on reddit.com
🌐 r/learnpython
2
2
October 11, 2021
python - AttributeError: 'builtin_function_or_method' object has no attribute 'index' - Stack Overflow
im working on training and generating a confusion matrix but i keep getting this error i already double check the datasets can some help me Error: def load_face_dataset(inputPath, net, minConfiden... More on stackoverflow.com
🌐 stackoverflow.com
Why am I suddenly getting "AttributeError: 'Index' object has no attribute 'apply'"?
Is this your bug, maybe? # You've assigned your dataframes modified columns # to the `df` variable. df = df.columns.str.replace(' ', '') I wonder if, in fact, what you want is: df.columns = df.columns.str.replace(' ', '') More on reddit.com
🌐 r/learnpython
6
3
February 28, 2023
🌐
GitHub
github.com › slundberg › shap › issues › 944
AttributeError: 'Index' object has no attribute 'to_list' in function decision_plot · Issue #944 · shap/shap
December 12, 2019 - AttributeError: 'Index' object has no attribute 'to_list' in function decision_plot#944 · Copy link · davidgar · opened · on Dec 12, 2019 · Issue body actions · When trying to call the function "shap.decision_plot", I get the aforementioned error. It seems that it is an issue related to the use of "to_list()".
Author   davidgar
🌐
Arch Linux
bugs.archlinux.org › task › 63703
FS#63703 : [solfege] Starting solfege fails with AttributeError: 'NoneType' object has no attribute 'index'
Closed by David Runge (dvzrv) Monday, 18 November 2019, 20:12 GMT Reason for closing: Fixed Additional comments about closing: Fixed in solfege 3.23.4-2
🌐
CopyProgramming
copyprogramming.com › howto › function-object-has-no-attribute-index
Python: Attribute 'index' is not found in function object
August 30, 2023 - The reason for the AttributeError is that the 'dict_values' object does not have the attribute 'index'. This error occurs because the .index() syntax is not valid in Python3. To overcome this issue, it has been suggested to use a list instead.
🌐
GeeksforGeeks
geeksforgeeks.org › how-to-fix-numpy-ndarray-object-has-no-attribute-index
How to Fix: ‘numpy.ndarray’ object has no attribute ‘index’ - GeeksforGeeks
November 28, 2021 - This error occurs when we try to find the index of a particular element in a Numpy array using the index method. Below code is an example when that ‘numpy.ndarray’ object has no attribute ‘index’ error can be thrown
🌐
CopyProgramming
copyprogramming.com › howto › attributeerror-function-object-has-no-attribute-index
Python: Indexing not possible: AttributeError 'function' object has no attribute 'index'
March 20, 2023 - Please take note that self.details cannot be configured as there is a caution against column addition. Index() generates AttributeError: 'dict_values' object has, AttributeError: 'dict_values' object has no attribute 'index' This is because .index() is no valid syntax in Python3.
🌐
Databricks
kb.databricks.com › en_US › python › function-object-no-attribute
AttributeError: 'function' object has no attribute
May 19, 2022 - Using protected keywords from the DataFrame API as column names results in a function object has no attribute error message.
Find elsewhere
🌐
Cumulative Sum
cumsum.wordpress.com › 2021 › 03 › 05 › pandas-attributeerror-function-object-has-no-attribute-xxx
[pandas] AttributeError: 'function' object has no attribute xxx
March 6, 2021 - This error happens when you have a column name which conflicts with an existing method defined for data frame instance. For instance, given a data frame as below: df = pd.DataFrame({'count': ['yes', 'no', 'yes']}) df # count #0 yes #1 no #2 ...
🌐
Linux Hint
linuxhint.com › numpy-ndarray-object-no-attribute-index
'numpy.ndarray' Object has no Attribute 'index' - Python
May 29, 2022 - Linux Hint LLC, [email protected] 1210 Kelly Park Circle, Morgan Hill, CA 95037 Privacy Policy and Terms of Use
🌐
Reddit
reddit.com › r/learnpython › object has no attribute 'index'
r/learnpython on Reddit: object has no attribute 'index'
October 11, 2021 -
import pandas as pd
from pandasql import sqldf

class ABC:
    def __init__(self):
    self.details = {'Name' : ['Ankit', 'Aishwarya', 'Shaurya', 'Shivangi'],'Age' : [23, 21, 22, 21]}
    self.df = pd.DataFrame(self.details)

objAbc=ABC()  

for i,rowObject in sqldf("select distinct Name from objAbc.df").iterrows(): 
    print(rowObject.Name)

AttributeError Traceback (most recent call last) <ipython-input-21-aaba2874542d> in <module> 8 objAbc=ABC() 9 ---> 10 for i,rowObject in sqldf("select distinct Name from objAbc.df").iterrows(): 11 print(rowObject.Name) 12 ~\anaconda3\lib\site-packages\pandasql\sqldf.py in sqldf(query, env, db_uri) 154 >>> sqldf("select avg(x) from df;", locals()) 155 """ --> 156 return PandaSQL(db_uri)(query, env) ~\anaconda3\lib\site-packages\pandasql\sqldf.py in __call__(self, query, env) 56 continue 57 self.loaded_tables.add(table_name) ---> 58 write_table(env[table_name], table_name, conn) 59 60 try: ~\anaconda3\lib\site-packages\pandasql\sqldf.py in write_table(df, tablename, conn) 119 message='The provided table name \'%s\' is not found exactly as such in the database' % tablename) 120 to_sql(df, name=tablename, con=conn, --> 121 index=not any(name is None for name in df.index.names)) # load index into db if all levels are named 122 123 AttributeError: 'ABC' object has no attribute 'index'

I want to iterate through dataframe defined in class ABC using pandasql. sqldf function but Getting Error.

'ABC' object has no attribute 'index'

Not able to understand why object.property name is not working in sqldf.

PS: As per requirement it's mandatory to use sqldf of pandasql.

Please Help.

🌐
Itsourcecode
itsourcecode.com › home › attributeerror: ‘function’ object has no attribute
attributeerror: 'function' object has no attribute [SOLVED]
April 17, 2023 - The “Function object has no attribute” is an error message that usually occurs in Python if you are trying to access an attribute, which is like a method or property that doesn’t exist on a function object.
🌐
GitHub
github.com › pytest-dev › pytest › issues › 3074
AttributeError: 'Function' object has no attribute '_skipped_by_mark' · Issue #3074 · pytest-dev/pytest
January 3, 2018 - The skipping module's reporting hook assumes that its setup hook executed and thus that it is safe to read the _skipped_by_mark attribute on the test item. If test execution aborts in an earlier setup hook, however, this assumption will be incorrect and its reporting hook will fail. Note: This error is the same as seen in #2982 and #2974, but, unlike those issues, is not masking a separate, root error: it is the root error. ... $ pip list attrs (17.4.0) pip (9.0.1) pluggy (0.6.0) py (1.5.2) pytest (3.3.1) setuptools (38.2.5) six (1.11.0) wheel (0.30.0) Note: Also fails on pytest 3.3.0.
🌐
GitHub
github.com › ericmjl › nxviz › issues › 160
AttributeError: 'NodeView' object has no attribute 'index' · Issue #160 · ericmjl/nxviz
October 27, 2018 - It works for the bipartite and centrality measures, but not for other attributes I've stored (like 'ORGANIZATION' or 'COUNTRY'), although I've confirmed that all these attributes are stored in the same way. Any idea what's causing this?
🌐
LearnDataSci
learndatasci.com › solutions › python-attributeerror-tuple-object-has-no-attribute
Python AttributeError: 'tuple' object has no attribute – LearnDataSci
The error AttributeError: 'tuple' object has no attribute is caused when treating the values within a tuple as named attributes. The error also occurs very frequently when using iterrows(), hence the big focus on avoiding the error in that case. It's important to remember that any functions ...
🌐
Reddit
reddit.com › r/learnpython › why am i suddenly getting "attributeerror: 'index' object has no attribute 'apply'"?
r/learnpython on Reddit: Why am I suddenly getting "AttributeError: 'Index' object has no attribute 'apply'"?
February 28, 2023 -

I don't understand... This exact code works for this same dataset look for different "X" variables, but now it is giving me this error...?

My code:

Import os Import pandas as pd

Os.chdir('file locations')

df = pd.read_csv('reading the file.csv') df = df.columns.str.replace(' ', '_')

def alphabet (row): If any(x in ['A', 'B', 'C'] for x in [row['alphanumeric_1'], row['alphanumeric_2]]): return 1 else: return 0

df['alphabet_yn] = df.apply(lambda row: alphabet (row), axis =1)

I don't understand why I am getting the AttributeError on the final line.

I am on my phone, so I apologize for how hard this might be to understand.

🌐
Researchdatapod
researchdatapod.com › home › how to solve attributeerror: ‘numpy.ndarray’ object has no attribute ‘index’
How to Solve AttributeError: 'numpy.ndarray' object has no attribute 'index' - The Research Scientist Pod
May 13, 2022 - Congratulations on reading to the end of this tutorial! The error AttributeError: ‘numpy.ndarray’ object has no attribute ‘index’ occurs when you try to call the index() method on a numpy array.