Created
March 4, 2023 10:37
-
-
Save neerajadsul/b40925055e9617f6c4b9de347b7be4eb to your computer and use it in GitHub Desktop.
Combine columns of NumPy array and write as CSV File
This file contains 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
from sklearn.datasets import make_moons | |
X,y = make_moons(n_samples=200, noise=0.15) | |
with open('data.csv', 'w') as f: | |
wr = csv.writer(f, delimiter=',') | |
combined = np.column_stack((X,y)) | |
wr.writerows(combined) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment