I am preparing a dataframe from two other dataframes so I later can use to_csv to export the results into csv file ,but the resulting dataframe is empty despite that the input row of datatype <class 'pandas.core.series.Series'> isn't empty, here is how I am doing that:
def writeCSVResult(self, indices, test_set, train_set, output_csvfile_name):
all_columns = train_set.columns.values
results = pd.DataFrame(columns=all_columns)
for i in xrange(self.testSet_length):
results.append(test_set.loc[i],ignore_index=True)
for j in xrange(self.numbe_of_cl):
results.append(train_set.loc[indices[j]],ignore_index=True)
print results.shape
results.to_csv(output_csvfile_name, cols=all_columns, index=False)
return
the resulting dataframe shape (0, 20)
Further infos:
test_set shape (10,20)
train_set shape (500000,20)
what am I missing?
indicesand combines testset with trainset data?