Skip to content

Read CSV file with Python function

I’m trying to write my read/write function to a csv, but it can’t return any value. I’m reading from a CSV, replacing the ” ; ” in the second column with ” ” and performing and saving the csv already handled. But for some reason it doesn’t save my csv, is my fun…

How to split an unknown number

Picture the following number (here it will be a measure of time) as an output of a given program: How would I be able to split it so that I can read it like this: I would like to do this for any ‘unknown’ decimal (comma separated) number. Thanks! Answer Convert your value as a string and format it…

pandas: Explode (duplicate) by group

I have a df that looks like this : It’s an example for one row but there are thousands of rows. I want to explode each value where there are multiple values in these four “TEST” columns ie. I want each one to duplicate the row for each one of the “test” that is the same and if th…