Read dataframe from stdin
From raju
read dataframe from stdin
% ls data.csv read_df_from_stdin.py % cat data.csv x,a,b 10,2,2 2,100,4 8,5,3 % cat read_df_from_stdin.py #!/usr/bin/env python3 import sys import pandas as pd df = pd.read_csv(sys.stdin) print(df) print(df.describe()) % chmod +x read_df_from_stdin.py % cat data.csv | ./read_df_from_stdin.py x a b 0 10 2 2 1 2 100 4 2 8 5 3 x a b count 3.000000 3.000000 3.0 mean 6.666667 35.666667 3.0 std 4.163332 55.734490 1.0 min 2.000000 2.000000 2.0 25% 5.000000 3.500000 2.5 50% 8.000000 5.000000 3.0 75% 9.000000 52.500000 3.5 max 10.000000 100.000000 4.0
Ref:-