Category : separator

My data looks like: 2021-11-17 10:59:10.880 SysState: 4, Events: 161403, EMS: 4, VDB: 2, TubeState: 0x02 BDR Mode: 1, BMS Ext: 2, BMS Int: 0, BdrStat: 00 CPU(%):16, CPUmax(%):47, task idx:3, CPUmaxIRQ(%):0 SOC:9973, SOH:100, LV?:0, HV?:0 3330mV 3333mV 3332mV 3332mV 3331mV 0 0 3331mV 3324mV 3325mV 3325mV 3328mV 0 0 3325mV 3321mV 3328mV 3328mV 3327mV ..

Read more

I want to separate the users input using two different separators which are ":" and ";" Like the user should input 4 subject and it’s amounts. The format should be: (Subject:amount;Subject:amount;Subject:amount;Subject:amount) If the input is wrong it should print "Invalid Input " Here’s my code but I can only used one separator and how can ..

Read more

I have a dataset looks like this on wordpad. "state","industry","2000","2005" "A","art,music",2934,2454 "B","farm",3949,2343 And I want to read this on python like this. "state" "industry" "2000" "2005" "A" "art,music" 2934 2454 "B" "farm" 3949 2343 I tried the codes below. df = pd.read_csv(os.path.join(path, filename), engine=’python’, sep=’,’ , quoting=3) this casts an error "ParserError: Expected 6 fields ..

Read more

I’m working on a program that accepts user input to calculate the mean, median, and mode. The issue is that I need to guess which separator the user will input. For example: def get_dataset(): while True: try: dataset = [float(_) for _ in input("nEnter Dataset: ").split()] except ValueError: print("nInvalid Input") continue if len(dataset) < 2: ..

Read more