Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

read csv python pandas plot

import pandas as pd
from datetime import datetime
import csv
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
headers = ['Sensor Value','Date','Time']
df = pd.read_csv('C:/UsersLala RushanDownloadsDataLog.CSV',names=headers)
print (df)

df['Date'] = df['Date'].map(lambda x: datetime.strptime(str(x), '%Y/%m/%d %H:%M:%S.%f'))
x = df['Date']
y = df['Sensor Value']

# plot
plt.plot(x,y)
# beautify the x-labels
plt.gcf().autofmt_xdate()

plt.show()
Comment

PREVIOUS NEXT
Code Example
Python :: how to get only first record in django 
Python :: openpyxl font 
Python :: python conda how to see channels command 
Python :: r2 score sklearn 
Python :: tkinter navigate pages 
Python :: opencv python convert rgb to hsv 
Python :: apply format to pandas datetime column 
Python :: python cd to script directory 
Python :: telegram markdown syntax 
Python :: how to read pdf in python 
Python :: converting a csv into python list 
Python :: cv2 hconcat 
Python :: how to create progress bar python 
Python :: round to two decimal places python 
Python :: series has no attirubte reshape python 
Python :: random from list python 
Python :: pandas to_csv append 
Python :: upload file in colab 
Python :: module pygame has no member 
Python :: hello worldpython 
Python :: decode url python 
Python :: tf.squeeze() 
Python :: how to delete print statement from console pythonn 
Python :: why when I merge my label cluster with my dataframe i get more row 
Python :: how to unzip files using zipfile module python 
Python :: pandas set font size plot 
Python :: django rest framework configuration 
Python :: read image python 
Python :: python make temp file 
Python :: django return only part of string 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =