question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'PandasExprVisitor' object has no attribute 'visit_Ellipsis'

See original GitHub issue

When trying to run this code, I’m getting the above error. I worked with Max U from StackOverflow in a private chat and he concluded it was a bug.

Here is the stackoverflow link: http://stackoverflow.com/questions/43838557/custom-boolean-filtering-in-pandas

Here is my gitub which contains the data if you want to reproduce the error:

https://github.com/Moondra/Logistic-Regression-

The data can be found as a pickle under the label ‘Small_cap_bio_DF’ Just be sure to use the line df['Market Cap'][df['Market Cap'] =='N/A'] = '-1' to remove the N/A values.

The line producing the error is

df[pd.eval(df['Market Cap'].replace(['[Kk]','[Mm]','[Bb]'],['*10**3','*10**6','*10**9'], regex=True).add(' < 35*10**6'))]


df['Market Cap'] looks something like this


A      AAAP       1.66B
       ABEO     223.42M
       ABIO       22.5M
       ABUS     181.58M
       ACAD       3.99B
       ACHN     507.25M
       ACIU      512.3M
       ACOR     750.47M
       ACRS     696.94M
       ACST      20.41M
       ADAP     449.31M
       ADHD       32.8M
       ADMA      58.51M
       ADMS      388.4M
       ADRO     709.58M
       ADVM     122.17M
       ADXS     321.96M
       AERI       1.35B
       AEZS      13.27M
       AFMD      96.66M
       AGEN     371.69M


Problem description

Instead of filtering the dataframe in relation to its Marketcap, I’m getting an AttributeError.

Expected Output

Filtering all rows whose Marketcap value is less than 30M.

Output of pd.show_versions()

# Paste the output here pd.show_versions() here

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
TomAugspurgercommented, May 9, 2017

We don’t want to support passing pandas objects to eval right? It takes a string, not a Series.

0reactions
maxu777commented, May 8, 2017

@chris-b1,

it’s a good reproducible example, thank you!

the limit seems to be 100 rows:

this works:

pd.eval(s.head(100))

the following produces mentioned above error:

pd.eval(s.head(101))

Read more comments on GitHub >

github_iconTop Results From Across the Web

'PandasExprVisitor' object has no attribute 'visit_Ellipsis', using ...
I'm trying to use pd.eval to parse this string into a column of lists. This works for this sample data. pd.eval(s) array([[ ...
Read more >
'PandasExprVisitor' object has no attribute 'visit_Ellipsis', using ...
Coding example for the question AttributeError: 'PandasExprVisitor' object has no attribute 'visit_Ellipsis', using pandas eval-Pandas,Python.
Read more >
'PandasExprVisitor' object has no attribute 'visit_Ellipsis', using ...
Pandas : AttributeError : ' PandasExprVisitor ' object has no attribute 'visit_Ellipsis', using pandas eval [ Beautify Your Computer ...
Read more >
AttributeError: 'PandasExprVisitor' object has no attribute ...
AttributeError : 'PandasExprVisitor' object has no attribute 'visit_Ellipsis', using pandas evalI have a series of the form: s 0 [133, 115,
Read more >
AttributeError: 'PandasExprVisitor' object has no attribute ...
AttributeError : 'PandasExprVisitor' object has no attribute 'visit_Ellipsis', using pandas eval. Last Updated : Mon Jun 27 2022.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found