Skip to content

Instantly share code, notes, and snippets.

@korakot
Created December 30, 2020 01:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save korakot/04920d0b7bb31fcdf8f4f0b0a9fa3330 to your computer and use it in GitHub Desktop.
Save korakot/04920d0b7bb31fcdf8f4f0b0a9fa3330 to your computer and use it in GitHub Desktop.
Create pandas dataframe from string
import pandas as pd
from io import StringIO
data = StringIO('''
symbol,quan,v0
ONE-UGERMF, 71472.71, 21.9749
ONE-UGG-ASSF, 5593.87, 35.7534
1SG-LTF-T, 11523.57, 31.9562
'''.strip())
df = pd.read_csv(data, index_col=0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment