Last active
February 18, 2019 07:56
-
-
Save gm3dmo/b89c911e00e97b3219d25790343b62c7 to your computer and use it in GitHub Desktop.
use pandas to get min/max values of all columns in a csv
This file contains hidden or 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
#!/usr/bin/env python3 | |
import pandas as pd | |
def main(): | |
f = 'test-data/basic.csv' | |
df = pd.read_csv(f) | |
columns = list(df) | |
for column in columns: | |
print(f'{column},{df[column].min()},{df[column].max()}') | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment