Created
March 10, 2017 13:37
-
-
Save fabriciosanchez/b72ce1ce622570618ccfad4093e04498 to your computer and use it in GitHub Desktop.
Algoritmo Python que formata a saída dos dados.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
def azureml_main(dataframe1 = None, dataframe2 = None): | |
columnsnum = len(dataframe1.columns) | |
columnsnames = dataframe1.columns.values.tolist() | |
newrows = [] | |
for index, row in dataframe1.iterrows(): | |
entry = '' | |
for j in range(0, columnsnum): | |
entry += columnsnames[j] + ':' + str(row[j]) + ' ' | |
entry = entry.replace("Scored Probabilities for Class ", "").replace('"', "") | |
entry = entry[:-1] | |
newrows.append(entry) | |
d = {'Recommendation' : newrows } | |
dataframe1 = pd.DataFrame(d) | |
return dataframe1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment