I have an excel file – the data in which looks like. I want to get float values of cells – in which separator is comma. But when accessing them, a value with a dot is returned. Is it possible to do this with opepyxl or other libraries? what i tried I also tried pandas, but it also formats cells
Tag: python
Pytest retry logic upon one unsuccessful test
In my pytest suite, I run plenty of iOS UI tests. Which comes with plenty of frustrating issues. Im experimenting with the use of a hook based retry logic. Essentially, I have a pytest_runtest_call hook, where I collect the output of a test via a yield, and do extra processing with that data. Based on the failed output of the
How to locate next element after text found in b tag – Selenium Python
I’m trying to extract the text value following a b tag that contains specific text. I’m using Selenium web driver with Python3. The HTML inspected for the value I’m trying to return (11,847) is here: This has an Xpath below (I’m not using this xpath directly to find the element as the table construction changes for different examples that I
Why can’t I save my scraped html table to pandas dataframe?
I have a python script that scrapes a html table. When I try to save my scraped data to pandas dataframe, I get an error. Please help me check what am doing wrong? Here is my codeblock Here is the error i get I want to save the above scraped values into pandas dataframe. That’s my aim. Please help if
Python : optimization/multiple if then on less lanes?
I’m trying some optimisation on my code and I struggle with multiple if then statements. The point is to update SQL database with psycopg2 and I must set some variables with “None” to be “null” in SQL. If I do if/elif/elif, the script will leave on the first valid condition but I want every condition to be checked, here is
Polars: settings not to display ellipsis
Polars chops some text instead of showing all text like the following Link Name https://… name1 https://… name2 I want Polars to show all text of Link Col How can I do that? Answer You should change pl.Config() settings – pl.Config.set_fmt_str_lengths(n) (see doc) If you just want to check, how new table view looks like, you can use with pl.Config()
Create a Boolean Column that checks for uid elsehwere in a Dataframe matching a certain condition?
Suppose I have a dataframe: Case_no Event_ID Date Type Done_by 1 1 2023-01-01 Email Sent Customer 1 2 2023-01-02 Response Agent 1 3 2023-01-03 Email Sent Customer 1 4 2023-01-10 Response Agent 2 5 2023-01-02 Email Sent Customer 2 6 2023-01-04 Email Sent Customer And I wanted to add two boolean columns that check for each case if an email
What does “:” in front of a variable in For loop do do (Python)
I was in HackerRank, trying to learn some pyhton, like any other beginner, and then I come to the question of “Introduction to Sets” The task require to do seemed pretty simple to me… at first: Computer inputs N, which is a integer and arr, which is a list, and your job is to write a code that takes the
Can’t create superuser in Django using custom user
I got this error when i try to run manage.py createsuperuser TypeError: UserManager.create_superuser() missing 1 required positional argument: ‘username’ My User model: and in my settings.py file: How can i solve this? Im new in Django, documentation is confused to me… I already tried remove AUTH_USER_MODEL = ‘usuarios.User’ or remove username attribute from class User Answer To create superuser with
Why does this regex capture a maximum of 2 capture groups and not all those within the input string?
Even if you try with several input_text in all cases it is limited (at most) to capture the first 2 matches, but not all the occurrences that actually exist This should be the correct output, that is, when it succeeds in identifying all occurrences and not just the first 2 matches. It’s quite curious because if I invert the order