MrMiyagi
MrMiyagi

Reputation: 39

How can I send (request.post) pandas dataframe/json to my raspberry-pi webserver?

I'm looking for guides/videos, advice, and tips on how I can take the dataframe/json data from python and just deploy it on a simple table via html/php on my raspberry-pi which is running as a webserver on my local network. Any help would be greatly appreciated as I've been trying to do this for hours.

Upvotes: 0

Views: 233

Answers (1)

Teejay Bruno
Teejay Bruno

Reputation: 2159

I don't have any experience with apache but getting your dataframe to display as a webpage is very simple using the df.to_html() method.

with open("dataframe.html", "w+") as f:
    html = df.to_html()
    f.write(html)

Now if you open dataframe.html locally you'll see your dataframe in the browser.

How you deploy that is another story -- it looks like python needs to be enabled. This link should get you started...

Upvotes: 1

Related Questions