[Python] An easy way to visualize energy data interactively [plotly.express]

image.png

Overview

Input data

Source code

#Library import
import pandas as pd
import plotly.express as px

#Reading sample data
data = pd.read_csv('./sample.csv',encoding='shift-jis',index_col=[0],parse_dates=[0])

#Data resampling (daily total)
data_month_sum = data.resample('D').sum()

#Line graph drawing
px.line(data_frame=data_month_sum,
        x=data_month_sum.index,
        y='Electric energy',
        color_discrete_sequence=['yellow'])

Execution result

plotly_line_20200706.gif

Summary

Recommended Posts

[Python] An easy way to visualize energy data interactively [plotly.express]
An easy way to call Java from Python
Easy way to customize Python import
[Python Tutorial] An Easy Introduction to Python
Easy way to use Wikipedia in Python
Easy way to use Python 2.7 on Cent OS 6
Easy way to check the source of Python modules
Reading Note: An Introduction to Data Analysis with Python
An easy way to create an import module with jupyter
An easy way to pad the number with zeros depending on the number of digits [Python]
Five useful Python data types that are easy to forget
[Python] Another way to import
Easy way to rename files
An introduction to Python Programming
An easy way to view the time taken in Python and a smarter way to improve it
PyArmor ~ Easy way to encrypt and deliver python source code ~
Easy way to round off to the nearest whole number with python3
Data visualization library "folium" by Python is very easy to use
[Python] How to FFT mp3 data
Easy to use Jupyter notebook (Python3.5)
Easy data visualization with Python seaborn.
Easy Python to learn while writing
An introduction to Python for non-engineers
An alternative to `pause` in Python
[Introduction to Python3, Day 17] Chapter 8 Data Destinations (8.1-8.2.5)
python3 How to install an external module
How to convert Python to an exe file
[Introduction to Python3, Day 17] Chapter 8 Data Destinations (8.3-8.3.6.1)
[Introduction to Python3 Day 19] Chapter 8 Data Destinations (8.4-8.5)
Convert FX 1-minute data to 5-minute data with Python
[Introduction to Python3 Day 18] Chapter 8 Data Destinations (8.3.6.2 to 8.3.6.3)
How to use "deque" for Python data
An introduction to Python for machine learning
Compress python data and write to sqlite
A way to understand Python duck typing
[Introduction to Data Scientists] Basics of Python ♬
An introduction to Python for C programmers
Convert csv, tsv data to matrix with python --using MovieLens as an example
Python + chatwork + google extension = How to make an easy and funny chat BOT
Searching for an efficient way to write a Dockerfile in Python with poetry