Quantcast
Browsing all 14097 articles
Browse latest View live

I'm trying to read a .dat file with pandas, however it keeps throwing me...

I'm trying to read a .dat file in my code, and I'm currently using python to do so. I'm very new, so I kind of have no idea what I'm doing. However, whenever I run it, it's throwing me a...

View Article


pip install Flask-APScheduler Fails

Why are modules so fragile? This is frustrating. pip install Flask-APScheduler==1.13.1 Collecting Flask-APScheduler==1.13.1 Using cached Flask-APScheduler-1.13.1.tar.gz (12 kB) Installing build...

View Article


IBKR API: How do I capture and store the Close price from streaming data?

I want to connect to IBKR API streaming data for a futures instrument, grab the prior date's closing price for a specific contract, store it, then close the connection and proceed to the next...

View Article

Find out the unicode script of a character

Given a unicode character what would be the simplest way to return its script (as "Latin", "Hangul" etc)? unicodedata doesn't seem to provide this kind of feature.

View Article

Chrome window appears asking who was currently using Chrome

my dears,I currently have a problem with my Selenium script. I suspect it's due to the Chrome driver.When the script is executed and I want to go to a specific page, the Chrome window appears asking...

View Article


Vertical Scrollbar disappears when window width passes threshold

This code creates a window with a text box and a vertical scroll bar. If the window's width is changed by dragging the edge of the window, and the width decreases below some threshold (~660 pixels) the...

View Article

Image may be NSFW.
Clik here to view.

pandas to_csv function changing 2d array to a single string

I am trying to precalculate sentence embeddings and I want to store it in a csv file, so that I can reuse it later. I create a Pandas dataframe, and I have the embeddings stored correctly as a 2d array...

View Article

Portable Postgres for Mac?

I've built a Flask app that will be packaged as a standalone app for users. I built it on Postgres and would like to package a portable version with the app to prevent the need for the user to set up...

View Article


SSL handshake failed error when trying to connect to MongoDB with Python client

I'm trying to connect to my shared MongoDB cluster, but I keep receiving the following error: SSL handshake failed: ac-ascvkib-shard-00-02.hkzvmvh.mongodb.net:27017: [WinError 10054] An existing...

View Article


Running ChatGPT programmatically - How to continue conversation without...

One can obtain a ChatGPT response to a prompt using the following example:from openai import OpenAIclient = OpenAI() # requires key in OPEN_AI_KEY environment variablecompletion =...

View Article

Pyaudio installed with Conda but not found on Import

I have installed pyaudio with conda, but my jupyter notebook can't find the module pyaudio on import. I have trying uninstalling and reinstalling with no success. Here is a few relevant information:On...

View Article

How to update all label's text properties after changing default_font in Kivy?

How can I update all of my Kivy widgets to use the new default_font on runtime (without restarting the app)?I created a Settings screen in my kivy app where a user can select the font that they want...

View Article

Python type hints for type promotion

Consider a function that performs type promotion, e.g. a simple multiplication of two numbers that can both be either int or float:def mul(a: int | float, b: int | float): # return type? return a *...

View Article


Issue with itertools.product that not list as expected

Python itertools.product module not working as expect when I'm extracting string "[1,2], [3,4], [5,6,7], [8,9]" from a json object here:},"combos_matrix": "[1,2], [3,4], [5,6,7], [8,9]"},But it's...

View Article

How to get a value from a tf.tensor that has the data type string?

I am following the Tensorflow Recommenders tutorial (Tensorflow Recommenders). I managed to build a working model with multiple features for the query and candidate model.However, it gets tricky when...

View Article


Encountering AttributeError: 'NoneType' object has no attribute 'split' in...

I’m working on a web scraping project using Python, BeautifulSoup, and Selenium in Google Colab. I’m trying to download multiple PDFs, but I’m encountering an error that I don’t...

View Article

discord.py 2.0 - Finding all users in all guilds that my bot is in

For a stats webpage, I'm trying to find how many users the bot has, and how many servers it is in. I figured that finding how many servers is the first step to finding how many users.Anybody got any...

View Article


Loop through each customer records to get the first/last channel they came from

I have customer visit records with the channel they came from. I want to have one record per customer where I have the first channel they came from and the last channel they came from.Another logic I...

View Article

Make PyQt5 qframes clickable to call a function and pass a different variable...

I have a Grid of PyQt5 Frames and want to make every frame clickable to call a function and pass a variable.I know that you can make it clickable and call function like...

View Article

what's the difference between matplotlib.pyplot and matplotlib.figure?

I'm just getting into matplotlib.I see some examples of matplotlib.pyplot used, but when integrating matplotlib with wxpython i often see matplotlib.figure likefrom matplotlib.figure import...

View Article
Browsing all 14097 articles
Browse latest View live