Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Why my data is not separated by coma when I read it in Python [closed]

$
0
0

I am trying to plot a graph and to do so I need to read the data that is in a csv file. However, my data doesn't get separated by the comma and is all in the same object.

import pandas as pdimport numpy as npimport matplotlibimport matplotlib.pyplot as pltimport matplotlib.figurefirstDRT_DRTdata_01 = pd.read_csv('firstDRT_DRTdata_01.csv', names = ['tau', 'gamma'], delim_whitespace = True)fs = 16fig = plt.figure(figsize = (6,6))ax = fig.add_subplot()ax.plot(firstDRT_DRTdata_01['tau'],firstDRT_DRTdata_01['gamma'])plt.show()

Consequently, my graph has no plot in it. The data file is as follows.

3.1621603440196127e-06,5.586157763048076e-093.2391304417861984e-06,1.3189807698520514e-083.317974067554424e-06,3.058350199771002e-08, etc

This is not the first time I have read csv file in Python in this way and I don't know why is not working for this file. Hope someone understands and has a solution :)


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>