#C12301. DataFrame Filtering Challenge
DataFrame Filtering Challenge
DataFrame Filtering Challenge
In this problem, you are required to use the pandas
library in Python (or simulate its functionality in your solution) to perform a simple data manipulation task. First, construct a DataFrame with two columns: A
and B
. Column A
should contain the integers from 1 to 5, and column B
should contain the square of each corresponding element in A
. Next, add a new column C
defined by the equation \( C = A + B \). Finally, filter the DataFrame and print only those rows where \( C > 10 \).
The output should display each filtered row on a new line with the three values (from columns A
, B
, and C
) separated by a single space. Although no input data is required for this problem, your program must read from standard input (stdin) and write the result to standard output (stdout).
inputFormat
There is no input for this problem. However, your program must read from standard input (stdin) even if it is empty.
outputFormat
Print the filtered rows to standard output (stdout). Each row should be printed on a new line with the values from columns A, B, and C separated by a single space. The expected output is:
3 9 12 4 16 20 5 25 30## sample
3 9 12
4 16 20
5 25 30
</p>