python - How to use idxmin() to return USABLE index for pandas Series object -
i trying return index of minimum value of series (which comes column of dask dataframe), , use index access corresponding value in different column of same dataframe. (i.e. value @ same index.) doing intermediate math in process.
i using following code:
start_time = dataframe['time'].sub(c1).pow(2).idxmin() end_time = dataframe['time'].sub(c2).pow(2).idxmin() #now pull out data different column in dataframe using start_time , end_time data = dataframe['current'].loc[start_time:end_time]
however consistently getting following error:
pandas.core.indexing.indexingerror: many indexers
i have no clue means, 1 other thing noticed have no grasp on type of value idxmin()
returning. mysterious object me. when try print out value of start_time
or end_time
is:
start_time: dd.scalar<series-..., dtype=int32>
end_time: dd.scalar<series-..., dtype=int32>
i cannot find specific information on these objects (although i've determined "scalar" object), , cannot find documentation on methods or attributes exist "scalar" objects.
this crux of problem because appears idxmin()
returning data type unusable indexing in dask or pandas....real useful.
i've tried
data = dataframe.loc[start_time:end_time,'current']
this did not give error, data
remains empty after executed.
someone please set me straight.
thanks.
dd.scalar
standard lazy value scalar. similar object if compute sum or mean of series.
you might try calling .compute()
method see concrete value.
Comments
Post a Comment