Created
April 4, 2022 19:03
-
-
Save cobanov/ec9c6055a17cdab81c0b67fc03580d07 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 numpy as np | |
import sys | |
filename = sys.argv[1] | |
def npy2csv(filename): | |
data = np.load(filename) | |
np.savetxt(filename[:-4] + ".csv", data, delimiter=",") | |
def main(): | |
if filename.endswith(".npy"): | |
npy2csv(filename) | |
else: | |
print("Please provide a npy file") | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment