export-to-csv

How can I filter pandas dataframe column that contains both date and time for specific times?

How can I filter pandas dataframe column that contains both date and time for specific times? Question: Pandas dataframe date&time filtering Hey team! The whole idea of the script was to access the link at specified times ["20:00", "20:30", "22:15", "22:45", "23:30", "00:00", "01:45", "02:30", "03:00", "03:30"] and to filter the column Expected Ship Date …

Total answers: 3

Encode a column in CSV to Base64

Encode a column in CSV to Base64 Question: I’ll preface by saying I’m a novice with Python, but I’m trying to encode a single column from a CSV to Base64 and write to another CSV. The file has 3 columns (consumer_id, sms_number, email_address) and I only want to encode the ‘consumer_id’. Here is what I …

Total answers: 1

How to export calculation value output to .csv file (python)

How to export calculation value output to .csv file (python) Question: I’m wondering is there possible to export the output data to the .csv file. dir_path = "image path" fileext = (‘.png’, ‘jpg’, ‘jpeg’) listOfFiles = [imageFile for imageFile in os.listdir(dir_path) if imageFile.endswith(fileext)] listOfImageFiles = sorted(listOfFiles, key=lambda x: x.lower()) for imageFile in listOfImageFiles: im = …

Total answers: 2

Import text files to dataframe, each text file on single row, save as csv

Import text files to dataframe, each text file on single row, save as csv Question: Still quite new to this and am struggling. I have a directory of a few hundred text files, each file has thousands of lines of information on it. Some lines contain one number, some many example: 39 312.000000 168.871795 100.835446 …

Total answers: 1

Converting unusual XML file to CSV using Python

Converting unusual XML file to CSV using Python Question: I’m having an issue with my XML file. I would like to achieve the same as in: https://www.delftstack.com/howto/python/xml-to-csv-python/ However, my XML file looks a bit different, for example: <students> <student name="Rick Grimes" rollnumber="1" age="15"/> <student name="Lori Grimes" rollnumber="2" age="16"/> <student name="Judith Grimes" rollnumber="4" age="13"/> </students> The …

Total answers: 4

List of dictionaries using keys as headers & rows are the values of any data type

List of dictionaries using keys as headers & rows are the values of any data type Question: ** I’m currently tasked with creating a CSV file from a list of dictionaries where the headers are the dict keys and the rows the dict values but values should be any data type.** store_value = [{‘Key’: 649.0, …

Total answers: 2

Attempting to add a column heading to the newly created csv file

Attempting to add a column heading to the newly created csv file Question: I’m trying to add the add the header to my csv file that I created in the code given below: There’s only 1 column in the csv file that I’m trying to create, the data frame consists of an array, the array …

Total answers: 1