Skip to content

Instantly share code, notes, and snippets.

@RGGH
Last active January 20, 2022 21:20
Show Gist options
  • Save RGGH/32ab96565dc564dd23f0a329aa4d37c3 to your computer and use it in GitHub Desktop.
Save RGGH/32ab96565dc564dd23f0a329aa4d37c3 to your computer and use it in GitHub Desktop.
Import CSV that includes text into Numpy
import numpy as np
''' numpy gen from text '''
x = np.genfromtxt("t.txt", delimiter=",", dtype='f8,U6')
print(x)
# Where CSV is :
# 1,'moo'
# 2,'moo2'
# 3,'ZZmoo3'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment