Find the total time spent in each different location, daily
I want to find the total time in each location, daily. I have dataframe with two columns. One for the locations and one for the arrival time to that location. The next location could be the shame as before because of a sensor reactivation. So i have something like this for example:
Python convert list of tuples into dataframe
I have a variable that stores a single list of tuples.
Matching strings between two dataframes and Pulling Strings from one too the other
I have the following issue:
How to update fields with previous fields value in polars?
I have this dataframe: import polars as pl dff = pl.DataFrame({‘file’:[‘a’,’a’,’a’,’a’,’b’,’b’], ‘ru’:[‘fe’,’fe’,’ev’,’ev’,’ba’,’br’], ‘rt’:[0,0,1,1,1,0], }) dff With the values: file ru rt “a” “fe” 0 “a” “fe” 0 “a” “ev” 1 “a” “ev” 1 “b” “ba” 1 “b” “br” 0 I’d like to update all ru and rt fields within the same file field, with the […]
Why do similar dataframes showing tow different index types?
I’m trying to create a graph of PnL vs. price from a simulation of a call option. I have to extract data from the results of the simulation. I wanted to combine the extracted data into a single dataframe, but my resulting dataframe does not join them. I found out that the index of the two extract dataframes is different…..would appreciate if someone could explain what’s going on.
In the screenshot below – I see the terminal_price dataframe having an Index type object. The other dataframe of PnL values however is a RangeIndex. I checked…both the df’s have same dimensions and are the same class; i.e. pandas.core.frame.DataFrame. So I’m not sure exactly what’s going on here…..why do I get two different index types? Would appreciate some guidance. I will try to convert the data extracts into pure series and then convert back into a concatenated dataframe….but in the meantime….why is this even happening?
How can I merge multiple financial statements into a single dataframe, only by locations?
I’ve been trying to merge mutliple financial statements, without sacrificing line items, and merging all the items along with the years amnd year’s value to get the a larger statement with this items and years. I’ve tried a few aprproach but I’m very rookie at coding, I export the dataframes (BALANCE SHEETS) for ilustration purposes.https://1drv.ms/f/c/175d836e30c91f0a/Ep80w4-k929ElYJ_NIcFa4sB8Bwm3JgZYTCDz_b0XKx3BQ?e=MXHRuI
dataframe union of filters and reduce the number of filters by merge
if {'B': ['b2']}
is in the filters, then we can discard any subset like {'B': ['b2'], C: ['c2']}
, etc,
Issues with dataframe shapes in creating a seismogram using Python
I have been trying to create a seismogram for quite a while but keep running into bugs. I was successful in creating a seismogram for a set of small data, but am now working with a larger set and seem to be running into issues with keeping time consistent with data (dropping NaNs while moving through data) and ignoring shapes of dataframes… the goal is to have this code be usable for different sizes of dataframes.
Startrow as a variable in Dataframe
I am trying to set the startrow of a df.to_excel() as a variable.
Calculations of python code not returning expected results
data is dataframe having columns Close, ph, slope_ph and upper