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.
I do not believe my dataframe is data. Here is my code sofar.
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started