Skip to content
Advertisement

Tag: path

absolute path for file not working properly python

basically, I’m trying to store the full path for a file in a list but for some reason os.path.abspath() doesnt seem to work properly but my output seems to output this : ‘C:Users******Documentsfolderexample’ the problem is that it should be : ‘C:Users******DocumentsfolderTRACKERexample’ the difference is that the second one (the correct one) has the TRACKER included which is the official

Combine two tables based on certain criteria using python

I have two tables (table1, table2) of the following: table1: ID Filename 12345 12345.txt 12346 12346.txt 12347 12347.txt 12348 12348.txt 12349 12349.txt 12350 12350.txt table2: contains the path where table 1 files are present Path /table/text3/12349.txt /table/text1/12345.txt /table/text2/12346.txt /table/text1/12350.txt /table/text3/12347.txt /table/text1/12348.txt How do I combine these two files, such that, the path and filenames are matched. What I tried so

The system cannot find the path specified: ‘ ‘

I am trying to split my image data set into train test and val. It has already created the train, test and val folders, but its empty as I keep encountering an error. This is the code I am trying to run on jupyter notebook, I have imported the required libraries like os, numoy, shutil, random: and this is the

How to remove a file from Path object in Pathlib module?

I have a Path Object representing C:UsersusersDownloadsimg.jpg. How do I get it so the Path only represents C:UsersuserDownloads? I don’t want to delete the file, but rather go back in the Path object itself. Answer I would utilize the PurePath class within pathlib as follows: This yields: PureWindowsPath(‘C:/Users/users/Downloads’)

Nested if statement returns no such item

my scipt is working as in searching for zip files, unzip and do the things i want. But problem arise when i have nested zip files inside the zip file, so i thought maybe i copy the working if statement, make a few adjustments but i still cant get it to work. what i want to achieve is to simply

Advertisement