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 ArticlePython 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 ArticlePython: 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 ArticlePython 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 ArticleGlobal 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 ArticleHow 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 Articlehow 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 ArticlePython 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 Articlelow 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 ArticlePlotting 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 ArticleHow 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 ArticleWhy 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 Articleplayer 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 ArticleWhen 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 ArticleFill 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 ArticleExtract 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 ArticleAdding 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 ArticleHandling 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 Articlehow 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 ArticleAttributeError: 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