Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

multiple delimiters pandas

>>> !cat castle.dat
c stuff
c more header
c begin data         
 1 1:.5
 1 2:6.5
 1 3:5.3
>>> df = pd.read_csv('castle.dat', skiprows=3, names=['a', 'b', 'c'], 
                     sep=' |:', engine='python')
>>> df
   a  b    c
0  1  1  0.5
1  1  2  6.5
2  1  3  5.3
Comment

PREVIOUS NEXT
Code Example
Python :: json timestamp to date python 
Python :: sql o que é 
Python :: matplotlib draw line between subplots 
Python :: alberi binari di ricerca python 
Python :: poython inl linrt dor loop 
Python :: what is te meaning of nested in python 
Python :: python get last cell value 
Python :: mechanize python #10 
Python :: off to obj python 
Python :: sort dictionary by values 
Python :: Notice there is a bug when using astimezone() on utc time. This gives an incorrect result: 
Python :: iterate 
Python :: bson to dataframe pandas 
Python :: get first element of each group 
Python :: space separated dictionary input in python 
Python :: for _ in range python 
Python :: django qurry 
Python :: colorutils python 
Python :: Big List into small chunk of lists 
Python :: asterisk triangle print 
Python :: Using Python Permutations function on a String with extra parameter 
Python :: remap values in a column based on condition from another dataframe 
Python :: sys exit out of loop 
Python :: vorticity 
Python :: cartopy indicate lat lon 
Python :: Python NumPy broadcast_arrays() Function Syntax 
Python :: get minimum value function with anealing in python 
Python :: Python NumPy asarray_chkfinite Function Example List to an array 
Python :: TemplateDoesNotExist at / 
Python :: Python how to use __sub__ 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =