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

How to Optimize Memory Usage When Processing Large CSV Files in Python?

I am working on a Python script to process large CSV files (ranging from 2GB to 10GB) and am encountering significant memory usage issues. The script reads a CSV file, performs various transformations...

View Article


FutureWarning: Passing bytes to 'read_excel' is deprecated and will be...

Error: FutureWarning: Passing bytes to 'read_excel' is deprecated and will be removed in a future version. To read from a byte string, wrap it in a B ytesIO object.df =...

View Article


python 3 using multiple or and’s in an if statement

The code that follows always returns 'orange' I've found other ways to do what I want but I do not understand why this does not work. color1 = input('select first color')color2 = input('select second...

View Article

Comment Python code in Visual Studio Code

My Visual Studio Code comment Python code with ''' instead of using # when I try to comment a block of code with the key combination Ctrl+Shift+a.I'm using Ubuntu 16.04.

View Article

Image may be NSFW.
Clik here to view.

How to better align the model summary output in python Jupyter?

I run regression with Python Jupyter. It's confusing when reading the output with poor alignment. Are there any plugin or other ways to beautify the output, like a data frame? Thank you.

View Article


Bot User Authentication Issues

I am trying to work on a simple bot for twitch to read messages, channel point redemptions, bits etc.I am using the following implementation for the User authentication:async def run(): # set up twitch...

View Article

Custom Layer using Keras

I'm trying to build a generator for my GAN model to generate shapes that have to be similar to other pre existing shapes. I have a function that takes in input 18 parameters and then output the image....

View Article

How to get Spotify Authentication Token?

I'm currently following this tutorial:https://youtu.be/3vvvjdmBoyc?si=xOg3ibG434eJdQPQIt's showing how to create your own recommended playlist track for Spotify using Python and I've followed all the...

View Article


Image may be NSFW.
Clik here to view.

Change the floor texture in a room image

I am trying to create a room visualiser where user can upload their room image and can apply different texture to the floor. I am successfully able to extract the floor coordinates in an image using...

View Article


Why mido library gives two different values for 'time' attribute?

I have this two codes to extract information from a simple MIDI file, in the first the 'time' is so little: 0.3, 2.1, 0.9, etc. but in the second the 'time' is more big: 60, 420, 180, etc.Can someone...

View Article

Replace existing button in pyQT, keep parent widget, position etc

Im struggling a bit with replacing widgets(Qpushbutton) with a custom button that has a enter event for qIcon and keeping the nested layout structure from a external ui.The replaced button shows up in...

View Article

FastAPI asyncio strange behaviour when testing the performance

Here's a minimal reproducible example of my FastAPI app. I have a strange behavior and I'm not sure I understand the reason.I'm using ApacheBench (ab) to send multiple requests as follows:ab -n 1000 -c...

View Article

Python InfiniteDefaultRevisionDictionary, any implementations?

In programming, certain dictionary-based data structures are very useful and important. For example:Revision dictionary:Revision dictionary is a sub-type of dictionary that keeps keys sorted in the...

View Article


how to rename dataframe columns that match regex

I'm trying to rename pandas dataframe columns that match a regular expression and leave others as they are.I have multiple dataframes and some of them do not contain columns which match the regex at...

View Article

Image may be NSFW.
Clik here to view.

Plotly wrong subplot format

I have faced a problem with wrong format of one of the subplots using Plotly.Problem with MonthlyCharges_Category, which has format of['starter', 'standard', 'advanced']Categories (3, object):...

View Article


How to add "Total" cell and the Sum of a column in Pandas? And how do I style...

I have a pandas dataframe that looks like this:col_1 col_2a 10b 20c 30d 40But I want to turn it into this, with a "Total" column that shows the sum of col_2 that skips 1 row. How do I do this in pandas...

View Article

How to optimize regrouping code for dataframe

I want to optimize code which regroup my pandas dataframe (dk) by joins:dk = pd.DataFrame({'Point': {0: 15, 1: 16, 2: 16, 3: 17, 4: 17, 5: 18, 6: 18, 7: 19, 8: 20},'join': {0: 0, 1: 0, 2: 1, 3: 1, 4:...

View Article


Not able to migrate from Azure ML classic to Azure Ml studio

I deployed this sxperiment as web service in azure ml classichttps://gallery.azure.ai/Experiment/Vader-Sentiment.But not able to deploy web service in Azure Ml studio (latest)Its asks forDeploy: Failed...

View Article

I want to install scipy in debian10/armv7l environment, but it fails

root@ZZZZZ:/home/dev/packages/scipy-1.9.3# pip install .Processing /home/dev/packages/scipy-1.9.3 Installing build dependencies ... error error: subprocess-exited-with-error× pip subprocess to install...

View Article

How to convert Python time.monotonic to walltime accurately

I have a time returned by time.monotonic() that I want to convert to walltime (i.e. time.time(), suitable for formatting with time.strftime). Is there a precise/atomic way to get the offset between...

View Article
Browsing all 13921 articles
Browse latest View live


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