Category "python"

ModuleNotFoundError: No module names 'pddlstream'

So I know this question has been asked a lot, but I am seriously stuck and cannot work it out. Sorry, I am still learning relative imports. So my file tree look

How can I get all posts id from any wordpress website using Beatifulsoup?

I am trying to figure out how to scrape post IDs from any wordrpess website using beautifulsoup. soup = BeautifulSoup(html_doc, "html.parser") article = soup.f

How to install Pygame in PyCharm with error "no such option: --build-dir" [closed]

I have created a PyCharm project, updated pip to 22.0.4 and updated setuptools to 62.0.0 (both the latest versions). When I go to the project

Connecting to a remote FTP server from Docker container running within remote Linux server

The goal of my project is to be able to schedule run a program from a linux server which connects to a remote (existing) ftp server and transfers from files fro

First occurrence of a specific value in a row (prepping for survival analysis) - python

I have the following data (see attached - easier this way). I am trying to find the first occurrence of the value 0 for each customer ID. Then, I plan to use c

Find nth occurrence of a character in a row and replace it in Python, in order to fix/replace a wrong/leftover ";" separator in a text file

I would like to import a text file, with 14 columns with the symbol ";" as a column separator. So, if we have 14 columns, it means we'll find 13 ";" separators

How to make a custom 404 page?

I am making a rick roll site for Discord and I would like to redirect to the rick roll page on 404 response status codes. I've tried the following, but didn't w

How to count values between a date time and make a new column out of it

In Python Pandas I need to create a new column in a dataframe (number of encounters in last year) in the below dataframe with the following logic. I want to cou

read wav file occur UnicodeDecodeError

import os import tensorflow as tf import tensorflow_io as tfio from matplotlib import pyplot as plt CAPUCHIN_FILE=os.path.join('data','Parsed_Capuchinbird_C

Trying to set up flask with nginx and gunicorn

I have followed a simple guide, and trying to show my flask application, but it wont show. I am running everything through ssh on a ubuntu server. Have my flask

Adding a black edgecolor around to legend entries in matplotlib

I've made this pie chart in python and I would like to know how to add a black frame around each boxcolor in the legend. I mean around of each color square like

How to antialias picture to get rid of the jerkiness in the image

I am trying to antialias a picture and tried few methods, with open CV and with matplotlib and also with PIL. But still can't get rid of the jerkiness. This is

im not able to save the screen shot from python

kindly help me im not able to save the screen shot on the desired folder the code is running however the screen shot is not saving on the path please help impor

Error while web scraping full job descriptions across multiple pages using BeautifulSoup

Would be great to get your help/ input on this! I'm trying to scrape job info from indeed. Everything in the code was working fine until I tried to get full job

Separate values in a DataFrame column into a new columns depending on value

I have a DataFrame like below but much larger: df = pd.DataFrame({'team': ['Mavs', 'Lakers', 'Spurs', 'Cavs', 'Mavs', 'Lakers', 'Spurs', 'Cavs'],

The above exception was the direct cause of the following exception - ValueError: 10 is not in range

I am trying to run the below code to load the dataset into a PyTorch dataset class with a custom collate function and map them but I am getting the error. The d

Importing a .dll reference - can't find solution explorer or add reference in VS 1.66

Going to preface this post with the obligatory, "I'm new to coding and to VS so go easy on me! I'm learning." With that being said, I'm writing a script for an

If statement doesn't work even if conditions are met

I'm writing some code to automate data entry at work. My issue is that the if statements are not working despite the conditions being met. I've tested the code

Why m getting error on installation of geopandas, Cartopy, Proj /

When I am trying to install Cartopy keep getting below error: C:\Users\Justin\Documents\Python Programs>pip install cartopy Collecting cartopy Using cache

Convert column value to Ascii using division and mod in sQL SERVER

I have a table in SQL SERVER as below with many columns like below | D401 | D402 | |----------------------------