I need help writing a small python script. The goal is to create a pandas dataframe from…
Jump to turn (31)
- 1I need help writing a small python script. The goal is to create a pandas datafr
- 2The target directory does not start with the target pattern. It will contain ABC
- 3Please write an appropriate docstring (Google style) for this script and make su
- 4Please update the above code to look in a subfolder called "target". Also, it sh
- 5Will this line: Capture ABC0, ABC2, ABC7, etc?
- 6For this code: I would like to use the found ABC/d as the column name.
- 7The values being appended to the column will be decimal format numbers. Will thi
- 8This seems like it will strip the whitespace before using the space character as
- 9Can you add comments (sparingly) to make it clear what the code is doing?
- 10I'm getting this error when trying to run this code: FileNotFoundError: [WinErro
- 11Does it matter that the number of datapoints in each column does not always matc
- 12I'm getting this error though: ValueError: Length of values (162) does not match
- 13Please explain the changed portion of the code.
- 14Can I see a this section of code with an appropriate single line comment?
- 15Sorry, I meant one comment explaining the purpose of the whole if/elif section.
- 16Can we abstract this to a utility function?
- 17Does this abstraction hurt efficiency?
- 18What about memory usage?
- 19Does passing a dataframe into a function copy the dataframe?
- 20Can I see the current version of extract\data()?
- 21Sorry. Can I have an updated version that uses the ensure\matching\length functi
- 22Will this search files recursively?
- 23I would like to print each file as it searches for the initial directory matchin
- 24Can you add an else to print when non-matching files are checked?
- 25I just tested this code and non-recursively checked the first file inside 'targe
- 26Will this work if the file inside 'target' is a .zip?
- 27What do I need to import for this to work?
- 28Will this main function still work with the current version of extract\data()?
- 29I just tried and it seems to get stuck in a recursive loop.
- 30Do I need to add an import?
- 31I would like to have the dataframe columns in the following order when this fini
- User
I need help writing a small python script. The goal is to create a pandas dataframe from several files. The script will live in a directory that contains a nested, compressed (.zip) log file. I want the script to recursively look through the other directories in its directory. When the script finds a directory containing "ABC[\d]", the script should add a column to the dataframe. Within that directory, the script should locate a file called "target_file.txt". Within that file, the script should iterate over each line. When a line contains "target_line_pattern" the script should split the line on the space character and append the second to last value in that split to the current column. After all files and columns have been processed. The script should output the dataframe as "data.csv"
- Assistant