Skip to content

Instantly share code, notes, and snippets.

@gm3dmo
Last active February 18, 2019 07:56
Show Gist options
  • Save gm3dmo/b89c911e00e97b3219d25790343b62c7 to your computer and use it in GitHub Desktop.
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
#!/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