Category : dataframe

I have a fixed-width flat file. To make matters worse, each line can either be a new record or a subrecord of the line above, identified by the first three character on each line: fwf file: 6 00604000000000227960010000000000000 040620211544157004410298500771004100336KK 05454220545401 1 6 106040000000002279600002000000300000000030000020000000000 6306040000000002279600010406202115441504010206570000000704106813674700010000001900000000190001800000000000290Y 6306040000000002279600020406202115441504010202180000000869078491299000010000001100000000110001800000000000168Y 6 00604000000000228357010020000000000 040620211549287004410298500771004100337KK 05454220545401 1 6 106040000000002283570002000000260000000026000010000000000 6306040000000002283570010406202115492804010202470000000406470043530800010000001500000000150001800000000000229Y 6306040000000002283570020406202115492804010202180000000869078491299000010000001100000000110001800000000000168Y I’d ..

Read more

I have dataframe in the below format . Input df.head(3) groupId Gourpname totalItemslocations 7494732 A {‘code’: ‘DEHAM’, ‘position’: {‘lat’: 53.551085, ‘lon’: 9.993682}} 7494733 B {‘code’: ‘DEHAM’, ‘position’: {‘lat’: 53.551086, ‘lon’: 9.993687}} 7494734 A {‘code’: ‘DEHAM’, ‘position’: {‘lat’: 53.552084, ‘lon’: 9.993682}} Expected Output roupId Gourpname totalItemslocations.code totalItemslocations.position.lat totalItemslocations.position.lon 7494732 A DEHAM 53.551085 9.993682 7494733 B DEHAM ..

Read more

I’m using a backtesting framework named bt, which takes a data frame like the following # fetch some data > data = bt.get(‘spy,agg’, start=’2010-01-01′) > data.head() spy agg Date 2010-01-04 98.214371 84.963075 2010-01-05 98.474354 85.349609 2010-01-06 98.543685 85.300266 2010-01-07 98.959667 85.201575 2010-01-08 99.288981 85.250923 … … The data frame in the example contains two columns ..

Read more

data type is object . how i saperate numbers, special character and dates . i am trying to get only text 1403603212662456323t1403603212662456323t2021-06-12 11:40:58 PKTt2021-06-12t11:40:58t+0500t2358945534tsmqureshiptitShah Mahmood QureshittMany congratulations to FM #PacômeMoubeletBoubeya of Gabon on election to @UN SC. Pakistan looks forward to engaging closely for stronger cooperation across a diversity of global issues. 🇵🇰 🇬🇦tent[{‘screen_name’: ‘un’ ..

Read more