To pass a string
to pandas read_csv()
, you can use io.StringIO
, e.g.:
import pandas as pd
from io import StringIO
df = pd.read_csv(StringIO("csv string"))
More Related Contents:
- FutureWarning: elementwise comparison failed; returning scalar, but in the future will perform elementwise comparison
- Calculate average of every x rows in a table and create new table
- Conditionally fill column values based on another columns value in pandas
- selecting across multiple columns with python pandas?
- Using numpy.genfromtxt to read a csv file with strings containing commas
- Precision lost while using read_csv in pandas
- python pandas read_csv delimiter in column data
- UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x8b in position 1: invalid start byte, while reading csv file in pandas
- Python pandas: how to remove nan and -inf values
- Pandas ParserError EOF character when reading multiple csv files to HDF5
- Load CSV to Pandas MultiIndex DataFrame
- AttributeError: module ‘numpy’ has no attribute ‘__version__’
- Bin values based on ranges with pandas [duplicate]
- UnicodeDecodeError when reading CSV file in Pandas with Python
- Dump a NumPy array into a csv file
- Import Error: No module named numpy
- what are all the dtypes that pandas recognizes?
- How to one hot encode variant length features?
- Why np.hypot and np.subtract.outer very fast compared to vanilla broadcast ? Using Numba for speedup numpy in parallel for distance matrix calculation
- TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array
- pandas equivalent of np.where
- Unpack dictionary from Pandas Column
- which is faster for load: pickle or hdf5 in python
- Create new column based on values from other columns / apply a function of multiple columns, row-wise in Pandas
- Different std in pandas vs numpy
- Easiest way to read csv files with multiprocessing in Pandas
- Getting days since last occurence in Pandas DataFrame?
- Plot NetworkX Graph from Adjacency Matrix in CSV file
- Pandas rank by multiple columns
- Pandas df.to_csv(“file.csv” encode=”utf-8″) still gives trash characters for minus sign