DataFrame
DataFrame copied to clipboard
Trying to filter Data by applying conditions to the csv file
Hi. I am currently facing an issue with the Dataframe. I have donwloaded a file from Amazon s3 private bucket and I am facing issues while filtering the rows that respect a certain condition. Here is my code: ` //This function allows me to connect to the private s3 bucket connection(); S3Object s3object = s3client.getObject(bucketName, sourceFile); DataFrame file = DataFrame.load(s3object.getObjectContent(), FileFormat.CSV);
//listColumns & size displaying
System.out.println(file.getColumnNames().toString());
System.out.println(file.size());
//getting the first line with the header column "AreaQ" being superior to 2
file.select("(AreaQ > 2)").print();`
I am having an error on this last line saying that there was a NULL exception that occured and the exception being "Exception in getValues() with cause = 'NULL' and exception = 'column header name not found 'AreaQ'' de.unknownreality.dataframe.DataFrameRuntimeException: column header name not found 'AreaQ'"
and yet I do have a column named AreaQ with numeric values that are > to 2.
Can you help me please?
I cant reproduce the error. What does df.getColumnNames()
return?
Is file.head().print();
working as expected?