Created
April 2, 2022 18:13
-
-
Save cobanov/cfa8de1c142763f7f9e300163eab2116 to your computer and use it in GitHub Desktop.
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
import pandas as pd | |
import numpy as np | |
import sys | |
filename = sys.argv[1] | |
def csv2npz(filename): | |
df = pd.read_csv(filename) | |
data = df.values | |
np.savez(filename[:-4], data) | |
def main(): | |
if filename.endswith(".csv"): | |
csv2npz(filename) | |
else: | |
print("Please provide a csv file") | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment