Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
When I try to loop to get the latest back up my month , PowerBI is not importing the table , but if I just use get latest file from url by adding latest to it , so no looping required , it works. each method uses the get response text.
this end of my code works fine
raw_input_file = io.StringIO(response.text)
csv_reader = csv.reader(raw_input_file, delimiter=',')
input_rows = []
for row in csv_reader:
if row:
input_rows.append (row)
input_df = pd.DataFrame(input_rows[1:], columns=input_rows[0])
input_df
but when I have the loop code it does not import anything
raw_input_file = io.StringIO(response.text)
csv_reader = csv.reader(raw_input_file, delimiter=',')
input_rows = []
for row in csv_reader:
if row:
input_rows.append (row)
previous = pd.DataFrame(input_rows[1:], columns=input_rows[0])
prev = pandas.read_csv(previous)
break
except:
pass
get_files_for_month(-1)
the get_files_for_month(-1) function allows me to select which ever previous month I wish to loop.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.