When I’create filtered Series or Dataframe object I get filtered indices too:
<code>not_na_prices:pd.Dataframe = price[price["price1"].notna() & price["price2"].notna()]
print(not_na_prices["price1"])
</code>
<code>not_na_prices:pd.Dataframe = price[price["price1"].notna() & price["price2"].notna()]
print(not_na_prices["price1"])
</code>
not_na_prices:pd.Dataframe = price[price["price1"].notna() & price["price2"].notna()]
print(not_na_prices["price1"])
<code>2 102.098
19 103.684
30 101.988
36 104.273
63 105.400
</code>
<code>2 102.098
19 103.684
30 101.988
36 104.273
63 105.400
</code>
2 102.098
19 103.684
30 101.988
36 104.273
63 105.400
But when I try something like:
<code>price_changed = not_na_prices["price1"] > not_na_prices["price1"].shift(1)
</code>
<code>price_changed = not_na_prices["price1"] > not_na_prices["price1"].shift(1)
</code>
price_changed = not_na_prices["price1"] > not_na_prices["price1"].shift(1)
I get nothing as it doesn’t shifts inside my filtered structure from one shifted index to other.
Can This be done without iteration methods?