Which AI assistant ...
 
Notifications
Clear all

Which AI assistant is currently the best for writing Python code?

4 Posts
5 Users
0 Reactions
177 Views
0
Topic starter

Look Ive spent the last three hours trying to get this script to work and I am about to throw my laptop out the window. Im trying to build this relatively simple data scraper and cleaner for a local cat shelter I volunteer at here in Seattle - we have a huge fundraiser next Saturday so Im on a super tight timeline to get the database updated - but every time I think Ive got the logic down the AI just hallucinates some library that doesnt exist or uses deprecated syntax that breaks everything.

I did some digging on Reddit and some dev blogs and everyone seems split down the middle. Half the people are saying Claude 3.5 Sonnet is the absolute king for coding right now because it follows instructions better and doesnt get lazy like GPT does, but then I see other people swearing by GPT-4o because the ecosystem is better or something. I even looked into Cursor but then I saw some people saying its basically just a wrapper and Im not sure if its worth the extra hassle of switching my whole workflow.

My budget is pretty tight so I really cant be paying for three different subscriptions just to see which one doesnt mess up a simple list comprehension. Its so frustrating because I feel like Im spending more time debugging the AIs garbage code than I would have spent just writing it myself from scratch if I actually knew Python better. I keep getting these AttributeError messages because the AI thinks a library works one way when it actually works another way.

I need something that actually understands context and doesnt just guess when it gets confused. Im mostly doing pandas work and some BeautifulSoup stuff for the scraping part. Should I just stick with the paid ChatGPT plus or is it actually worth making the jump to Claude or maybe something like Codeium? Which one is actually the most reliable for Python specifically right now without costing a fortune?


Topic Tags
4 Answers
12

> I need something that actually understands context and doesnt just guess when it gets confused. Honestly, if youre tired of the big names being lazy, check out DeepSeek Coder V2 236B Parameters. Its specifically trained on massive codebases and handles logic way better than GPT for me. Pair it with the Continue.dev Open Source IDE Extension so you can swap models via API. Its way cheaper than a sub, tho the setup takes a few minutes. It handles pandas logic much more reliably.


12

Agreed on DeepSeek, tho be careful with context windows. I would suggest Mistral Large 2 API for Python scraping. Its cheaper and dont hallucinate Pandas methods as often.


3

Facts.


2

I have dealt with these exact issues for a few years now, and I would suggest you be very careful about relying solely on ChatGPT for complex scraping logic. From what I have seen, GPT-4o has a tendency to get lazy with long scripts, which is probably why you are seeing those AttributeErrors. In my experience, you might want to consider the following setup:

  • Anthropic Claude 3.5 Sonnet is the current leader for Python logic. It is much less likely to hallucinate library methods compared to other models.
  • Anysphere Cursor AI Code Editor allows you to point the AI at your specific local files. This is vital for BeautifulSoup because the AI needs to see the actual HTML structure you are working with.
  • If you want to stick to a low-cost option, Codeium Individual Tier is quite robust for autocompletion. I would recommend that you always include your current library versions in the system prompt. For instance, tell it you are on pandas 2.0 or higher. This often prevents it from using outdated syntax. Also, be careful with how much code you paste at once. Breaking your scraper into smaller functions and testing them individually with the AI will save you a lot of headache. It is a bit more work upfront, but it prevents the AI from getting confused by too much context. Just dont expect any AI to be 100% perfect tho, you still gotta double check the docs.


Share: