I have pipe-separated values like this:
https|clients4.google.com|application/octet-stream|2296|
https|clients4.google.com|text/html; charset=utf-8|0|
....
....
https|clients4.google.com|application/octet-stream|2291|
I have to create a Pandas DataFrame
out of this data, with each column given a name.
Here you go:
>>> import pandas as pd
>>> pd.read_csv('data.csv', sep='|', index_col=False,
names=['protocol', 'server', 'type', 'value'])
Out[7]:
protocol server type value
0 https clients4.google.com application/octet-stream 2296
1 https clients4.google.com text/html; charset=utf-8 0
2 https clients4.google.com application/octet-stream 2291
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With