Category "python"

How to search list of numbers in many files

I have 5 files containing numbers and need to search for a list of numbers and print the name of the file it has. i tried this code but don't work import os

Expanding Records Based On Date Range Pandas

I am attempting to expand the records in a data frame between two dates. Given the input file of single entry for each record, I want to expand it based on a gi

Expanding dataset and filling missing dates in Pandas

The raw dataset is below: DF When the start and end dates differ, we require daily granularity. Daily granularity ensures each row has the same start and end d

cant read field in xml section

Using python I got to the correct iteration of the XML (forecast) section, but one child field I cant seem to be able to read here is the section from the XML &

How to export python variable as javascript file

I have a python variable in jupyter notebook allFolders = {'1': { '2': {'3': { 'A' : {}, 'B' : {}, 'C': {}}}}} I am wondering if there is a way to export this

R reticulate specifying python executable to use

First, I'm working on a Windows machine. I would like to specify a specific version of python to use in RStudio. I would like RStudio to use python 3 in the Arc

cant read field in xml section

Using python I got to the correct iteration of the XML (forecast) section, but one child field I cant seem to be able to read here is the section from the XML &

Splitting Array of Lists into named subarrays

Splitting Arrays for Test Train Essentially I am attempting to convert a pandas dataframe into numpy arrays so that I can run it through a Test/Train. My goal h

Cannot install package pyautogui

When i try pip install pyautogui it is not working I have also used pip3 install pyautogui. And run in admininistrator This is the error i get. ERROR: Could not

Pandas datetime column to ordinal

I'm trying to create a new Pandas dataframe column with ordinal day from a datetime column: import pandas as pd from datetime import datetime print df.ix[0:5]

Get the XHR url of shopee.tw search result from DevTool

I would like to crawl the product name, price from the below link in shopee https://shopee.tw/search?filters=5&keyword=lego70689&noCorrection=true&o

"Reindex" only fills the first two rows with new values

I am new to stackoverflow. I hope I can formulate my question clearly. I am using reindex to fill out missing dates in a pandas dataframe: df = pd.read_csv('myf

Numpy sum of 2D array along axis=1, floating range

I would like to perform a sum of a 2D array over the second axis, but on a range which is variable. Not vectorised it is:` import numpy as np nx = 3 ny = 5 a =

python does not recognize R functions with ”.“ in the function name

When I call the contrasts.fit function in the R package, limma, I get an error, which I suspect is due to the "." reason, python may not recognize contrasts.fit

Is there a way make tests Flask and Firebase?

I have a Flask app. Authentication is provided by Google Firebase. I want to make url tests with any Python/Flask libraries? Is there a way? For example: /api/g

Is there a way to guarantee a certain number of lines detected with cv2.HoughLines()?

This question is an extension to my previous question asking about how to detect a pool table's corners. I have found the outline of a pool table, and I have ma

python generator function not yielding output [closed]

import itertools def password_generator(): with open("D:\Password Hacker\Password Hacker\\task\passwords.txt", "r") as passfile: f

How to get the previous rows close and apply it to the next row in a new column called previous close

I have a bunch of daily ohlc data like so: date,volume,open,close,high,low 2022-05-02,1756159.0,118.38,119.57,120.34,116.49 2022-05-03,3217838.0,119.72,122.4,12

Writing Python output as xlsx

I want to execute same function (gives output A, B, C, D) for all the files (library) available in the given path. I am trying write the output (A,B,C,D) in fou

Writing Python output as xlsx

I want to execute same function (gives output A, B, C, D) for all the files (library) available in the given path. I am trying write the output (A,B,C,D) in fou