Getting started headers do not seem to be respected
Perhaps I am doing something wrong. Trying to run against Python 3, pip and pandas installed there. Possibly 2 runtime is interfering there I'm not sure, which pandas is probably not installed on pretty sure.
Following the brief intro to LO Pythonista, working to a point.
The source data in the spreadsheet for which I will start gathering some simple and gradually more elaborate metrics using Python, based on a Basic formula, in both the header as well as the data columns themselves.
Not sure what I am doing wrong here, or perhaps is not a great fit for it.
At present, best guestimates on my part, headers cannot be formula calculated, rather must be static, in nature; which is fine. Not sure whether formula driven headers could otherwise be supported.
Next thought on this journey... How do I convey, relay, whatever... I want to calculate some Pythonista, Pandas, or whatever, metrics if possible.
I have a Py cell calculating based on the <> DataFrame, not sure how to relay that as a proper card or whatever.
class Metrics:
def __init__(self, x, y):
s = self
xmin = x.min()
xmax = x.max()
xmean = x.mean()
ymin = y.min()
ymax = y.max()
ymean = y.mean()
s.xmin = xmin
s.xmax = xmax
s.xmean = xmean
s.xmid = xmin + (xmax - xmin) / 2
s.ymin = ymin
s.ymax = ymax
s.ymean = ymean
s.ymid = ymin + (ymax - ymin) / 2
def data(self):
s = self
return [s.xmin, s.xmax, s.xmean, s.xmid, s.ymin, s.ymax, s.ymean, s.ymid]
met = Metrics(dt.x, dt.y)
met
I looked at you sheet example. I see the issue. You are correct that Headers are being ignored. For now this is by design.
When a DataFrame is created LibrePythonista auto discovers if it has headers. Clearly in this case it is not detecting the headers correctly. I can see that when I view the Card view for the DataFrame. I will most likely have to implement headers=True to fix this issue. BTW 0.10.2 was released yesterday.
This has been corrected in version 0.10.4. The Auto detect headers was updated. At this time headers=True in the lp() function are still ignored.