operating-system

Error when trying to create a list of files

Error when trying to create a list of files Question: I have a folder that contains 20 csv files. Each file has about 10 columns and thousands of rows. The csv files look something like the following: gene p-value xyz acan 0.05 123 mmp2 0.02 456 mmp9 0.07 789 nnos 0.09 123 gfap 0.01 456 …

Total answers: 1

Averaging numeric values of all files for three different folders using Python

Averaging numeric values of all files for three different folders using Python Question: I am trying to average the numeric values in the file for each var. It works fine for var_values=1.0 but it is not working for var_values=5.0,10.0. I present the current output. The expected output should have numeric values for var_values=5.0,10.0 as each …

Total answers: 1

New Debian OS-release

Programmatically check if there is a new Debian OS release Question: I was wondering if there was a way of finding out programmatically (e.g., a command that I can run from a Python script) if there is a new Debian OS release. I know that apt get update gives me info about upgradable packages, but …

Total answers: 1

Python program to rename files doesn't work on files on external drives

Python program to rename files doesn't work on files on external drives Question: I wrote this program to rename all files in a directory to title case, and it works fine on files on the system. But when I use it to rename files on an external drive, the program executes successfully without any exceptions …

Total answers: 1

Pandas – Create new column and assign value to new column

Create new column and assign value to new column Question: i would like to seek help in assigning the filename value (eg. file1.txt) to a new col (eg. filename). However im stuck at the portion to create new column and assigning the value with the filename. No new column was seen when i export it …

Total answers: 1

How to rename images with specific pattern?

How to rename images with specific pattern? Question: I have this image folder as shown below that has repated charchter name A I want only keep one letter A with rest of numbers + ext the input : input_folder –| |— imgs — |– A_0.jpg |– A_A_A_1.jpg |– A_A_2.jpg |– A_A_A_A_3.jpg |– A_4.jpg ……… I …

Total answers: 1

How do i write a string letter by letter using concatenation in python

How do i write a string letter by letter using concatenation in python Question: I currently have a way to write a string letter by letter but when i try and include more arguments it gives me the error that it was expecting 1 and not 3 I used this to define def delay_print(s): for …

Total answers: 2

How to rename images name using data frame?

How to rename images name using data frame? Question: I have a data frame that has file_name and corresponding text and want to update the file_name and the image name in imgs folder by concatenating with some text or number the structure of input_folder look like : input_folder –| |— imgs — |– 0.jpg |– …

Total answers: 1

How to merge many data frames to only one

How to merge many data frames to only one Question: I have directory that has many folders inside each folder has (images folder & labels text) and I want to combine them to one dataframe file by concatnating folders name with images name to make them uinque names . The structuer of my directory like …

Total answers: 1

How to fix FileNotFoundError

How to fix FileNotFoundError Question: The function takes a list of paths to all folders and checks if it is empty. If empty, it deletes. But after she deleted the folder, the error FileNotFoundError: [WinError 3] The system cannot find the path specified: ‘\Projects\Example\New folder’ appears. I do not fully understand why it is looking …

Total answers: 1