xxxxxxxxxx
#drop last n rows of dataframe
df = df.drop(df.tail(n).index)
xxxxxxxxxx
import pandas as pd
# Create a sample dataframe
data = {'Column1': [1, 2, 3, 4, 5],
'Column2': ['A', 'B', 'C', 'D', 'E']}
df = pd.DataFrame(data)
# Retrieve the last row
last_row = df.iloc[-1]
print(last_row)
dataframe getting the last 6 rowns for freqtrade and sending the signal
xxxxxxxxxx
last6rows = dataframe['enter_long'].iloc[-6:]
last6rows = last6rows[::-1]
requests.get('https://xxxxx.site/data/entry.php?q='+str(last6rows.to_json()))
xxxxxxxxxx
df = pd.DataFrame({'a':range(1,5), 'b':['a','b','c','d']})
df2 = df.iloc[[0, -1]]
print(df2)
a b
0 1 a
3 4 d