Should I store start time, end time, and days as separate fields or use a...
I am developing a scheduling feature in my application where users can set specific time ranges and days for recurring tasks. For example, a user might configure a task to run every Thursday and Friday...
View ArticleFlask App running within Docker for File Upload
I wrote the following flask application which will collect a file selected and then upload it to a database running in sql lite. If i run the app locally, it works fine with the table created in the...
View ArticleHow can I solve this Typeerror?
I am working on my first Full Machine Learning, I am now trying to process raw data, to transform it to supervised learning.In one of the steps, in order to resamble the data : I have used the...
View ArticleFind the vertices of all the sub-simplexes following Barycentric subdivision
I have a set of K dimension standard basis vectors and the (K-1)-simplex defined over these vectors. I want to divide this simplex into sub-simplexes which partition the original simplex using...
View ArticleError 403: Access Sharepoint using App Credentials in Python
I am trying to access files stored in SharePoint using Python. I have registered the app in Azure Ad and have client_id and client_secret. I have given the read and write permissions however I am still...
View ArticleHow to efficiently filter a large list in Python using multiple conditions?
I'm working on a Python project where I need to filter a large list of dictionaries based on multiple conditions.Here's a simplified example of the data structure I'm dealing with:data = [ {"name":...
View ArticleWeb Scraping 2nd Table Player Stats from FBRef?
Was hoping for help here. I'm trying to web scrape this second table of player goal and shot creation stats on FB Ref for the MLS, but my script is bringing in the first table of team statistics...
View Articlerequest.FILES.get is returning None
I was developing my website, just when I realized that the update_supplier view stopped working correctly. In this view I update the name and the image. For some reason it is only getting the name and...
View ArticleConvert HTML to PDF - PDFKit File Size too Large
I have one complete (static, it doesn't rely on calls to the internet) HTML file that's < 900 KB in size, and I am currently using PDF Kit to create a single PDF from it that ends up being about 100...
View ArticleMake Pygame Key Presses repeat while held [duplicate]
I'm using pygame to create a basic 3d renderer, was the WASD movement is extremely primitive. The keys act like the do in a text editor, every time you press it it takes half a second to start...
View ArticlePandas to_sql() method breaking existing relationships when uploaded to...
Ok so I am making some automations with python for work. Essentially I am reading data from a master excel sheet, making the data look nice and uniform, and updating the changes into an Access database...
View ArticleBest way to specify nested dict with pydantic?
ContextI'm trying to validate/parse some data with pydantic.I want to specify that the dict can have a key daytime, or not.If it does, I want the value of daytime to include both sunrise and...
View ArticleHow can I make it so y values do not cluster and the y values on y axis does...
2 issues, values in the y direction just cluster and not use the entire space of the subplot, no matter what, and then there is this black thing on y axis (sort of like y values but on top of one...
View ArticleExport `stdout` and `stderr` of a single-line bash command to text file while...
I would like to export the stdout and stderr of a bash command to the same text file.The bash command is a single-line command that calls python3 followed by the name of the module and function,...
View Articlepygame.error Unsupported image format
running Python 3.3.0 with pygame '1.9.2pre', following a tutorial, new to python, honestly cant see where i've gone wrong, looks the same as on the tutorial, however it is 4 years old. Thanks for...
View ArticleDoes Mongo know what tuples are?
I'm storing lists of tuples into a MongoDB database using PyMongo. For some reason, when I view the data in the mongo shell, the tuples are represented by square brackets.In addition, when I extract...
View ArticleAdvantages to using "type" keyword in python type aliases
Prior to python 3.12, my understanding was that the line mta = int created a type alias named mta, but with 3.12, this line could (should?) be written as type mta = int, even if the prior syntax is...
View ArticleFiltering a python DataFrame based on whether two column values in each row...
I have a df that contains a subject ID and an item ID. An item ID may appear multiple times for one subject ID and multiple item IDs may be assigned to one subject ID. subid itemid0 0001 11111 0001...
View ArticleEfficient session variable server-side caching with Python+Flask
Scenario:Major web app w. Python+FlaskFlask login and Flask.session for basic session variables (user-id and session-id)Flask.session and limitations? (Cookies)Cookie based and basically persist only...
View ArticleWhy does my Python FastAPI server keep returning the status code of 422 when...
Here is my FastAPI code. For simplicity purposes, I have made the code to simply return the data passed to it:import firebase_adminfrom firebase_admin import credentialsfrom firebase_admin import...
View Article