Category "python"

How to write excel formula (SUM()) dynamically in a range of columns using openpyxl?

In my Excel spreadsheet I need to enter excel formula on a bottom that will summarize values. Number of rows can be different. But not columns. So in cell B10 s

Split blf-files in Python into smaller files

I'm wondering if it is possible to split BLF-files in Python? I know that there is a library (can) that supports BLF-files, but find no documentation on how to

i want to use the turtle function to write out what i input

i have already made a turtle string to make every letter in the aphabet, and assigned them to functions, so i only have to print a() for it to write out an A fo

Normalise data where every second row is a column header

I have a system where you manually input data, for example data about people. Some fields are mandatory but majority are optional. When the data is outputted it

Can I dynamically generate boolean options on a custom Blender operator?

I'm trying to write a custom operator for Blender that: Gets the objects currently in the scene (may be lots) Filters them based on some criteria Prompts the us

How does "alternates" in the Django sitemap framework work?

I am struggling to get the "alternates" attribute to work in the Django sitemap framework. class StaticViewSitemap(sitemaps.Sitemap): priority = 0.5 cha

Convert date + time strings to epoch milliseconds in dataframe column (when present)

I have a dataframe with a column called "snapshot_timestamp" where the time is in this format: 2022-05-01 23:45:47.428 (year, month, day, hour, minutes, seconds

why didn't my program write some of the fields?

So I wrote a program to write the different attributes like title, total number of comments, total upvotes, post body, author name of submissions in a CSV file.

Why is code for prime numbers not working for the number 10?

I am trying to write a code in python to find all prime numbers of a number. My problem is that with this line of code it does not work to return the prime numb

Send csv file in pytest test using restframework ApiClient

I'm trying to test my view which requires csv_file and one parameter in request, but getting error "details": {"csv_file": ["The submitted data was not a file.

Create TensorFlow tensor from two smaller tensors using boolean mask

I'm using TensorFlow and would like to create a 1D tensor t1 from two smaller tensors t2 and t3, where len(t2) + len(t3) == len(t1) and a boolean mask which ind

ValueError: You must pass a freq argument as current index has none

I'm using pycaret.time_series alpha module but I have this problem avec launching my experiment. I think this is internal to the module. Can anyone help ? `from

Turning incomplete lines into new columns on Pandas

Folks, I have converted a PDF using tabula-py and, due to the formatting (there are two lines with names in each name cell) I get this: col1 name doc col

Colab Session Crashes on importing torch_geometric.data

My colab session always crashes while trying to import torch_geometric.data module. For reference, the code I am writing is as follows: import torch def&n

How to capture data from table using selenium python?

I need to capture the table from the link: https://fr.tradingeconomics.com/country-list/rating I tried the following code but I don't get any response from sel

How to handle Dark Current Correction with rawpy

I'm trying to process a .NEF-file with rawpy. Before applying bad_pixel_fix_, white balance, etc. I want to subtract a dark-frame for the dark-current correctio

I want to customize some indicators in backtrader

really sry to bother, first I am totally a rookie in python and now I am learning how to use backtrader to do some analysis but when I use my own method, I met

AttributeError: module 'rules' has no attribute 'fizz'

So I tried to create a fizz buzz game code in python and I wanted to import the rules from another file, import rules fizz = rules.fizz buzz = rules.buzz fizzb

Nested Data inside output needing to be expanded

I have the following code import requests import json import pandas as pd import csv import numpy from pandas.io.json import json_normalize url = 'http://URL/a

What column should I assign to parse_dates while working with google finance?

I wrote a code to show a graph from google finance but i got this error: ValueError: Missing column provided to 'parse_dates': 'Date' This was my code: from bok