Category "python"

Why are my box plot and probability plot overlapping

I'm trying to plot Histograms, Probability Plots, and Boxplots, however, boxplots and prob plots overlap: This is the code in Python (Jupyter Notebook): def ou

How to get a proper signature to authenticate to private websocket in Wootrade

I am trying to authenticate to private websocket on wootrade I am keep getting this error : { 'errorMsg': 'signature error', 'event': 'auth', 'id': '1

Argparse: Ignore dashes in unknown arguments or collect values (potentially starting with dashes) until the next known command

I have a Python script that will later call multiple Bash scripts with supprocess.run. When calling the Python script, the user should be able to specify lists

How to count number of events in a dataframe before and after a given date?

I'm trying to identify individuals who have events before or after events of their first occurrence of an event of a specific type. For example, I'm interested

How to plot data in panda dateframe to histogram?

I have a dataset containing various fields of users, like dates, like count etc. I am trying to plot a histogram which shows like count with respect to date, ho

Pandas DataFrame : How to groupby and sort "by blocks"?

I'm working with a DataFrame containing data as follows, and group the data two different ways. >>> d = { "A": [100]*7 + [200]*7, "B": ["one"

Pyscript in Django application

I am wondering if we could use pyscript on HTML pages inside a Django project. I'd tried to use it but unfortunately, it doesn't work. this is the code : <he

How to rethink the architecture of my Python project containing multiple async interfaces

I'm developping a Twitch Bot for approximatively a year now. Over the time, the bot became bigger and bigger to add features. Now the bot can manage multiple in

How to include JSON and File data together in FastAPI endpoint?

I would like to POST JSON and File data together, as shown in the code below: fastapi.py @router.post('/rate') def users(user_review:schemas.Rate, image123: Upl

401: Unauthorized when trying to fetch Discord OAuth2 access token || Python 3.10

So I came to the idea one day to make a bot dashboard (it currently includes a rickroll and a pointless button). I watched some tutorials talking about how to g

What are dictionary view objects?

In python 2.7, we got the dictionary view methods available. Now, I know the pro and cons of the following: dict.items() (and values, keys): returns a list, s

can I define data filters with intake catalogs?

I would like to use intake to not only link to published datasets, but filter them in the catalog itself. Filtering is trivial to in python once you open the da

New color terminal prograss bar in pip

I find the new version pip(package installer for Python) has a colorful progress bar to show the downloading progress. How can I do that? Like this:

Problems matching values from nested dictionary

In TestRail, I have created several testruns. When I execute: test_runs = client.send_get('get_runs/1') pprint(test_runs) The following results are returned:

I can't run pipenv install django

Whenever I enter pipenv install django in the cmd an error appears: " 'pipenv' is not recognized as an internal or external command, operable program or batch f

How can I edit this code so that it prints the result a certain way?

I'm trying to get this code: line = input("String: ") letters = "" words = line.split() for word in words: letters = letters + word[0] print(" ".join(letter

Python, Convert Arbitrary List of Floats to Decimals with Most Precision without Rounding Errors

I'm writing code that has to take a bunch of floats in Python and convert them to decimals without any rounding errors but with as much precision as possible. I

Bloom, Cuckoo filters are too big for numbers

I'm trying to use bloom/cuckoo filter to check if i already stored a tuple of 2 numbers f.e. (7,25), (47,1576), ... etc In [12]: from cuckoo.filter import Scala

Dash use html.button for export csv with filter

i'm quite new in dash. I try to create a simple dash with a filter, and an export button. My data are simple: I have two Bank, with two app (one Android, one Ap

How to join all columns in dataframe? [duplicate]

I would like one column to have all the other columns in the data frame combined. here is what the dataframe looks like 0 1 2 0 123 321