“Baca plot Python Pandas CSV” Kode Jawaban

Baca plot Python Pandas CSV

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:/Users\Lala Rushan\Downloads\DataLog.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()
Merwanski

Muat file CSV menggunakan panda

import pandas as pd

df = pd.read_csv (r'Path where the CSV file is stored\File name.csv')
print (df)
Yawning Yacare

PANDAS BACA CSV

df = pd.read_csv('data.csv') 
Victorious Vicuña

Jawaban yang mirip dengan “Baca plot Python Pandas CSV”

Pertanyaan yang mirip dengan “Baca plot Python Pandas CSV”

Lebih banyak jawaban terkait untuk “Baca plot Python Pandas CSV” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya