Category "python"

I want to check if the .csv file contains the exact data without any leading and trailing spaces

I changed the code to this. Can someone tell me what is the keyword i should use to remove spaces(trailing and leading. Something is not working. I cant figure

Can't add clicked handler for drawn figures using DearPyGui

I can't add clicked handler for drawn figures, in this case it circle. I tried same, but for text and it work correctly, but for rectangle don't work too. Here

Scrape Website that is running meteor, using python requests

You see, there is this website called edabit. All you need to know is that I want to scrape the website without using selenium. I want to learn how. What does s

Inserting rows into Microsoft SQL Server using pandas raises precision error

I am trying to insert data into a mssql database. I needed as fast method for this so I set the fast_executemany param to true. The upload works fine for most p

Can we declare PonyORM models without using a database global variable?

Declaring classes that map the db in ponyORM inherits from database as a global variable. from pony.orm import * db = Database() class MyEntity(db.Entity):

Can't parse out text that is behind </span>text</a> in Beautifulsoup

I think I have tried it all, read crummy, read documentation on Beautifulsoup4 website. I can't get this thing wrapped around my head. So to the question: &

Simple way to use bigquery result in python where the query return only one result

I'm simply trying to get one data from bigquery from python. Below is the query select max(date) from `x.x.table_name` all the requirements to access bigquery

Walrus operator in Python interpreter

When I use the walrus operator as below in the Python(3.9.6) interpreter, >>> walrus:=True I get a syntax error: File "<stdin>", line 1 wa

python ttp parser ignore line if I have ORPHRASE in template and consecutive blank spaces in input text

Envorionment: windows 10, python: 3.9, ttp: 0.8.4 I'm having a problem with ORPHRASE in the TTP template, and if there's consecutive blank-space characters in t

How to get all fuzzy matching substrings between two strings in python?

Say I have three example strings text1 = "Patient has checked in for abdominal pain which started 3 days ago. Patient was prescribed idx 20 mg every 4 hours." t

Concat multiple dataframe and manage those that doesn't exist

I try to concat some dataframe - 30 dataframe of 24h data - that been created automatically with some csv, but sometimes csv doesn't exist, so the dataframe was

MLFlow tracking ui not showing experiments on local machine (laptop)

I am a beginner in mlflow and was trying to set it up locally using Anaconda 3. I have created a new environment in anaconda and install mlflow and sklearn in i

in vscode, pygame wont import but it is installed and is working in the windows console ,and the python app thing

im very new to code in general so this could be a stupid beginner problem ive searched for things but i couldnt find something useful for me under Problems is t

Is it possible to persist .env values in the .whl files when installed on a Databricks cluster? I'd prefer to keep all values in library (.whl)

I have created a project in Pycharm. This project has a .py file with functions, init.py and a .env file with my secret values. I need to be able to run this in

Using forloop.counter to iterate over list in django template

I have a list of objects named chargers_list and on my view I estimate when will the charging be done. List of estimates is the same size and is named eta. I it

How to calculate the path of a particle subject to a vortex?

I'm trying to draw a path of a particle starting at (x0,y0) subject to a vortex located at (xv,yv). This is inspired by Lorena Barba's AeroPython. As stated in

how to create a dataframe from a list of dictionary value?

I have a list - elements_listed = [{'data': {'data/2022/04/1': '26-Apr-2022 07:47', 'data/2022/04/2': '24-Apr-2022 17:27', 'data/2022/04/3': '22-Apr-2022 14:20'

In a pyspark dataframe, when I rename a column, the previous name can still be used for filtering. Bug or feature?

I work on DataBricks with PySpark dataframe containing string-type columns. I use .withColumnRenamed() to rename one of them. Later in the process I use a .filt

Assign multiple columns different values based on conditions in Panda dataframe

I have dataframe where new columns need to be added based on existing column values conditions and I am looking for an efficient way of doing. For Ex: df = pd.D

Creating & publishing datasource in Tableau directly from Redshift

Is it possible to create & publish redshift table directly to Tableau server as a datasource using python? It'll be basically select * from table. I looked