Last active
April 2, 2022 19:11
-
-
Save cobanov/e596565d813c7cf419f9085304e2df17 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 | |
# for f in rumi*.csv; do python csv2npy.py $f; done | |
filename = sys.argv[1] | |
def csv2npy(filename): | |
df = pd.read_csv(filename) | |
data = df.values | |
np.save(filename[:-4], data) | |
def main(): | |
if filename.endswith(".csv"): | |
csv2npy(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