main.py 494 B

1234567891011121314151617181920
  1. import pandas as pd
  2. import matplotlib.pyplot as plt
  3. # Read the CSV file
  4. df = pd.read_csv("temperature_data.csv")
  5. # Convert the timestamp column to datetime
  6. df['T_time'] = pd.to_datetime(df['T_time'])
  7. # Plot the data
  8. plt.figure(figsize=(12, 6))
  9. plt.plot(df['T_time'], df['T_t'], label='Temperature (°C)')
  10. plt.xlabel('Time')
  11. plt.ylabel('Temperature (°C)')
  12. plt.title('Temperature Over Time')
  13. plt.legend()
  14. plt.grid(True)
  15. plt.xticks(rotation=45)
  16. plt.tight_layout()
  17. plt.show()