Reputation: 2312
I am using flask to create a web api from python functions. My code:
from flask import Flask, render_template
import pandas as pd
import numpy as np
app = Flask(__name__)
@app.route("/store_on_promo_df")
def store_on_promo_df():
data_df = pd.read_csv(data_path, header=0)
is_on_promo_series = data_df['IsPromo'] == True
data_on_promo_df = data_df.loc[is_on_promo_series]
return data_on_promo_df
Consequently, I would like to have some visualization in Power BI. Therefore, I am using import data from web option in power BI.
Problem: I cannot return a dataframe using flask. And I am not sure what to return so that PowerBI reads my data properly.
Finally, please note that this is helpful in my case because I want to share big data with other teams at different location.
Any help is much appreciated!
Upvotes: 0
Views: 1279