I have a dataframe like as shown below I would like to create 3 new columns val_num – will store ONLY NUMBER values that comes along with symbols ex: 1234 (from >1234) and 1000 (from <1000) but WILL NOT STORE 31 (from 31sadj) because it doesn’t have any symbol val_str – will store only…
Python run script upon mail reception [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago. Improve this question I have a .py script which I would like to run automatically upon reception …
Copy non-na rows to fill non-na columns using pandas
I have a dataframe like as shown below What I would like to do is copy non-na rows from Test column and paste it in corresponding row under sourcename column When I tried the below, it makes the other rows of sourcename column as NA I expect my output to be like as shown below Answer One idea with Series.fill…
When running: help() in Terminal, it gives error: ParserError: (:) [], ParentContainsErrorRecordException
I am new to Anaconda and Python. I tried running: help() in Terminal and get error: I also tried adding the path to Python.exe to end of my Path statement and restarting (still get error). c:usersjosepanaconda3python.exe Hoping you can advise what I need to do to resolve this. Thanks. Answer help() is used in…
Gtk textview can’t set text [Python]
This is a desktop environment project,I’m try use textview make a terminal,but I got some problem,I can’t use set_buffer() function set text, My code: I trying use set_buffer() to set textview’s text(in line 56),but I got an error: When I change line 56 to bash1.set_buffer(Gtk.TextBuffer) la…
problem with my python youtube video downloader
hi guys I’m new to python and i was trying to make a YouTube video downloader, the code is working but the completion message is not shown when video download is completed and I don’t know why the code: Answer You have big mess in code. You runs download() two times before you even select resoluti…
Pandas update index on dataframe view
I have a multi-indexed (2 levels) pandas Dataframe called data. I create a view on a part of this dataframe with smalldata = data.loc[(slice(start,end),slice(None)),:]. If I display smalldata, it displays the data I expect. If I print smalldata.index, it shows the multi-index I expect based on the values I ch…
Pygame installed on windows, getting “pygame.error: Failed loading libwebp-7.dll” when trying to call pygame.image.load()
I’ve got python 3.9.1 running on a windows 10 machine. I have pygame 2.0.1 installed on my machine via pip (python -m pip install https://github.com/pygame/pygame/releases/download/2.0.1/pygame-2.0.1-cp39-cp39-win_amd64.whl) however on calling pygame.image.load(“file.png”) I get the error: p…
Scraping search results off of Sportchek with Beautiful Soup 4 to find prices
So I’m trying to web scrape search results from Sportchek with BS4, specifically this link “https://www.sportchek.ca/categories/men/footwear/basketball-shoes.html?page=1”. I want to get the prices off of the shoes here and put them all into a system to sort it, however, to do this I need to …
Stylegan2-ada tfrecords – ValueError: axes don’t match array, images will work one run and not work the next
I’m working on training a GAN through Google Colab with a dataset of photos I scraped from Wikiart and converted to 1024×1024, but keep getting this error when creating the tfrecords: I set it to print out what files it would stall on, and began taking those out of the data set; but what it stalls …