CSV row delete problem(using pandas)

59 views
Skip to first unread message

Jordan Micle

unread,
Oct 8, 2019, 10:36:43 AM10/8/19
to Django developers (Contributions to Django itself)
I am going to delete row from csv but I got this error


KeyError at /tools/universe/delete_instrument/

"['33333'] not found in axis"

views.py

instrument = request.POST.get("symbol")
    universe_id = request.POST.get("id")
    universe = get_object_or_404(Universe_Universe, id=universe_id)
    universe_path = settings.UNIVERSES + get_path(universe.parent_id)
    data_universe = pd.read_csv(universe_path + universe.name + '.csv'index_col="Ticker")
    print(data_universe)
    print(instrument)
    data_universe.drop(instrument, axis=1inplace=True)

error

KeyError: "['33333'] not found in axis"


printresult:
            Name
Ticker
44444     444444
33333   33333333
33333

Adam Johnson

unread,
Oct 11, 2019, 3:58:49 AM10/11/19
to django-d...@googlegroups.com
Hi!

I think you've found the wrong mailing list for this post. This mailing list is for the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it. People on this list are unlikely to answer your support query with their limited time and energy. Read more on the mailing lists at https://www.djangoproject.com/community/

For support, please use the NEW Django forum at https://forum.djangoproject.com , django-users mailing list, or IRC #django on Freenode, or a site like Stack Overflow. There are people out there willing to help on those channels, but they might not respond if you don't ask your question well. Stack Overflow's question guide can help you frame it well: https://stackoverflow.com/help/how-to-ask .

Also if you haven't read it, please take a look at Django's Code of Conduct: https://www.djangoproject.com/conduct/ . These are our "ground rules" for working well as a community, and will help you get the most out of Django and our fantastic community.

Thanks for your understanding,

Adam

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/9b6254ad-6c11-42e5-87ed-9d4b851f06d0%40googlegroups.com.


--
Adam
Reply all
Reply to author
Forward
0 new messages