Question: Python with Pandas dataframe I have a csv file that contains a large number of columns androws. I need to write a script that concatenates

Python with Pandas dataframe

I have a csv file that contains a large number of columns androws. I need to write a script that concatenates some elements ofthe first row with some elements of the 2 row. Something like # ifdata[1][0] starts with ch then concatenate the element right belowit. I have attached a picture of just a sample of my data. Thebooleans have to stay on there as is. But I must drop the emptycolumns. I'm just having difficulty doing this through using pandasdataframe. In order for me to run the debugger on my script I mustrun a main.py that is under my tools folder. Any help would beappreciated.

chla chla chla chla ch1a chla ch1a chla chla chla ch1a chla

I do not believe my dataframe is data. Here is my code sofar.

ch1b single 11.42644024 0 0 1 11.42591953 0 0 1 11.4253931 0

Additional information: i need to join elements that say ch1a with the element right below it to read as part of the same column title. So the first row elements have to join together with the second row elements. please let me know if this still isn't clear

chla chla chla chla ch1a chla ch1a chla chla chla ch1a chla ch1b single 11.42644024 0 0 1 11.42591953 0 0 1 11.4253931 0 0 1 isma::cas_ism_cmd_mode_cmd_mode_cmd_modefcp::afcs_fafcp::pfcs_facp::pfcs_dgosma::rti_ica::sys_time_a::cas_fail_a::att_fail_pfcp::direct_mode boolean boolean boolean boolean boolean boolean uint32 uint32 boolean boolean boolean ch1b isma::cas_isrcmd_mode_cmd_mode_ single boolean boolean ch1b 0 0 0 13 6.22E+08 0 0 0 O O O 11.42644 0 0 0 0 0 14 6.22E+08 0 0 0 11.42592 0 0 0 0 0 15 6.22E+08 0 0 0 11.42539 0 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!