Quantcast
Channel: Active questions tagged python - Stack Overflow
Browsing all 13951 articles
Browse latest View live
↧

How can i convert ppt to pdf in python code?

import osimport comtypes.clientdef ppt_to_pdf(intput_path, output_path): intput_path = os.path.abspath(intput_path) output_path = os.path.abspath(output_path) powerpoint =...

View Article


Image may be NSFW.
Clik here to view.

Python Selenium AttributeError: 'str' object has no attribute 'capabilities'...

This is my first time of using Python Selenium, it was failed. Someone suggest me to to add a'r' in front of "C:\Code\Drivers\Chrome\chromedriver.exe", then the failure message change a little bit like...

View Article


Python: Keyerror:0 when doing a loop

I am trying to follow the code to extract keyphrases from a pandas column. Link to the jupyter notebookWhenever I try to run I always get an error in the line with the regex operation.corpus =...

View Article

Python Tkinter error "pyimage2 deos not exist"

I've been working on a small project, and have encountered an error. Being a somewhat novice in tkinter, I don't know what it means. The details of the error and code that caused it are below.This is...

View Article

Global variable get undefined on re-run of Flask app

global variables get undefined on re-run of flask app,I have 3 files,api.pyimport trainerapp = Flask(__name__)@app.route('/start', methods=['POST'])def apifunc(id): result = trainer.consume(id) return...

View Article


How to execute a test function all time?

I want to create a command prompt simulation in python, but I have run intoan issue. Indeed, when I type the commands in my Entry, nothing happend whereas Itshould execute the functions that I created...

View Article

how to convert mysql database into vector databse? [closed]

I am creating chatbot on RDBMS database using LLM and Langchain using database agent.but the problem is langchain's databse agent is only converting natural language questions to query. it does not...

View Article

Python read() not reading whole bytes from .zip file in "rb" mode [closed]

I am trying to read .zip file in my code, but its just reading few bytes (22 to be exact)Here is my code snippetopen(filepath, "rb").read()Earlier it used to read all the bytes, but suddenly it has...

View Article


low level of logging in python does not work

The question was solved by changing tz = get_localzone() to tz = pytz.utcI am trying to do logging in Python. I need to swap the local time zone to the New York timezone. class CustomFormatter was...

View Article


Image may be NSFW.
Clik here to view.

Plotting data which is already in Lambert projection

Recently I am trying to plot the meteorological field from HRRR datasets. However, HRRR datasets are already in Lambert projection (not gridded). The datasets provide x,y as an index (1~len(x) and...

View Article

How do I read a binary file into a Pandas DataFrame using Numpy dtypes?

I want to remove rows in a DataFrame that I have generated using by using a Numpy.dtype template to read in a binary file. I've used multiple methods dropping a row and continue to be stymied by...

View Article

Why can't I put two while statements on top of each other?

I am fairly new to python, so this is probably a beginner mistake, but depending on how I order the while statements, it either doesn't load, or doesn't update time.import timeclock = 0Basically, when...

View Article

player rectangle not moving [duplicate]

import pygame# Initializationsgame = Truepygame.init()FPS = 30clock = pygame.time.Clock()# Screenscreen = pygame.display.set_mode((600,800))screen.fill((0,0,0))# PlayerpX = 300pY = 400pClr =...

View Article


When running code window opens and closes immediately [duplicate]

When running code the window opens and then closes, I have looked through and as people I know in real life what the issue may be. I am new to programming so I honestly have no idea of what it may...

View Article

Fill N/A with previous day data

I have a dataframe and it just has data for weekday. Below is sample dataframe:import pandas as pdimport numpy as npdf = pd.DataFrame({'BAS_DT': ['2023-01-02', '2023-01-03', '2023-01-04', '2023-01-05',...

View Article


Extract instances from perminute timeseries data where the POWER value is 0...

I have huge time series dataset containing TIME, POWER as columns, I'm taking this dataset in window of 30 minutes and inside each window if POWER value is 0 for greater than 10 minutes continuously,...

View Article

Adding value to 2d numpy array based on condition

Having trouble manipulating a 2D numpy array (below). I'm using np.where to add a value if the given condition is met, but doesn't seem to be working. Is this simply not possible or am I making a...

View Article


Image may be NSFW.
Clik here to view.

Handling infinity gradients while working with numpy gradient funcationality

I am using the numpy.gradient() to evaluate the gradients wherein I have points where the x coordinates are constant for a few successive points. It is leading to RuntimeWarning: divide by zero...

View Article

how to reinitialise global variable in flask app python

Here is the Flask app.pyfrom flask import Flask, redirect, url_for, requestimport trainerapp = Flask(__name__)@app.route('/success/<name>')def success(name): gValue = trainer.myFunction() name =...

View Article

AttributeError: module 'Project1' has no attribute 'py' [closed]

When Running The codeimport Project1, Project2, Project3from threading import ThreadThread(target=Project1.py).start()Thread(target=Project2.py).start()Thread(target=Project3.py).start()to run multiple...

View Article
Browsing all 13951 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>