Category "python"

OSError: You seem to have cloned a repository without having git-lfs installed. Please install git-lfs and run git lfs install followed by git lfs pul

I'm using Jupyter Labs on AWS SageMaker. Kernel: conda_pytorch_p36 and did Restart & Run All. I git cloned this repo. Attempt at installing git-lfs: !curl -

How can I indented in multiple with statement in Simpy?

I tried to build a simpy model with multiple 'with' statement as below. However, based on indentation, the result was different. Please let me know what is the

How to install wordcloud for python?

I am trying to visualise data using word cloud. However when I used pip install wordcloud, I got the following error: D:\...>pip install wordcloud Collecting

How to test multiple variables for equality against a single value?

I'm trying to make a function that will compare multiple variables to an integer and output a string of three letters. I was wondering if there was a way to tra

How to test multiple variables for equality against a single value?

I'm trying to make a function that will compare multiple variables to an integer and output a string of three letters. I was wondering if there was a way to tra

Multiple aggregations of the same column using pandas GroupBy.agg()

Is there a pandas built-in way to apply two different aggregating functions f1, f2 to the same column df["returns"], without having to call agg() multiple times

how to only get the alphabet letter from a string in python [closed]

I'm trying to create a program that takes in text from a file and outputs the frequency of each letter. The output also shows the frequency of

How to slice a XGBClassifier/XGBRegressor model into sub-models?

This document shows that a XGBoost API trained model can be sliced by following code: from sklearn.datasets import make_classification import xgboost as xgb bo

How to slice a XGBClassifier/XGBRegressor model into sub-models?

This document shows that a XGBoost API trained model can be sliced by following code: from sklearn.datasets import make_classification import xgboost as xgb bo

a python console application executed from within vscode integrated terminal not allowing arrow keys to select list items

I have a file samlapi.py. Running the file pops up a dialog with a list of menu items on the terminal to select from. I cannot traverse the menu items using key

Cryptographically secure pseudo random shuffle a list or array in python

I am in need of a shuffle function that uses CSPRNG (Cryptographically Secure Pseudo Random Number Generator) and can be seeded manually for the same output for

Delete (a, b) in dictionary_1 if a in dictionary_2

I have two dictionaries D1 = {('one', 'two'): 3, ('three', 'four'): 5, ('five', 'six'): 7, ('eight', 'nigh'):8} D2 = {'one':1, 'five': 2} I want to delete ('o

Pytube Error: get_throttling_function_name: could not find match for multiple

I am trying to download YouTube playlist from url "https://www.youtube.com/watch?v=uyVYfSNb_Pc&list=PLBxwSeQlMDNiNt72UmSvKBLsxPgGY_Jy-", but getting the err

I have plotly dash app, and get this error: Cannot read properties of null (reading 'layout')

I have web app in plotly dash. I have 3 dropdown and graph with selected item. When I change category i have error: Cannot read properties of null (reading 'lay

How can I create a cross-tab of two columns in a dataframe in Python and generate a total row and column in the output?

I have created a dataframe from a CSV file and now I'm trying to create a cross-tab of two columns ("Personal_Status" and "Gender"). The output should look like

Using Yolox on an asset image doesn't draw any detection

So I'm trying to learn how to use Yolox for my bachelor thesis, and after hours of installing and updating components, finally managed to run Yolox on a test im

sort two nested lists according to value of one list in python

I want to sort two nested lists according to value of one list. predictions = np.array([[0, 1, 2, 3], [3, 2, 1, 0], [1, 2, 3, 0], [-1, -1, -1, -1]]) test_intera

Run generator when button is clicked

I want to create a Button to generate a password with tkinter but when the script is running, the password is already generated and the button doesn't work. Her

Extracting data from a .txt file without using modules

I am taking a course in python and one of the problem sets is as follows: Read in the contents of the file SP500.txt which has monthly data for 2016 and 2017 a

Tkinter get rid of the python icon in messagebox tkinter

How can I get rid of the Python (or matplotlib) icon when running this code? Even when I add icon='info', I still get the rocket with the python logo. Please ch