We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d740b0e commit ac1b392Copy full SHA for ac1b392
csvgen.py
@@ -0,0 +1,16 @@
1
+#This file generates a CSV file with integer values,
2
+# Use cases: you can use it for eg. input for testing your sroting algorithms and other program inputs when you need to test with large data.
3
+
4
+import random as rd;
5
6
+minNum = 0;
7
+maxNum = 1000; #maximum number in array
8
+lengthOfItems= 500; #this will generate 500 random numbers.
9
10
+file = open("newFile.csv", "a") # creates a new file named newFile.csv - feel free to edit file name
11
12
+for i in range(lengthOfItems):
13
+ file.write(str(str(rd.randint(minNum,maxNum)) + ","))
14
15
+file.close()
16
+#note - you will have to split first line at "," and convert to int
0 commit comments