matplotlib graph to plot values and variance I am really new to the world of matplotlib graphing as well as using those graphs to understand data.

I have written a simple python code where I read a .csv file in and then store the values of one column into a variable. Then plotting them similar to the code bellow:

dev_x= X   #storing the values of the column to dev_x
plt.plot(dev_x)
plt.title('Data')


The graph looks like this, which seems quite messy and hard to understand. So, I am asking for some advice on how to make more cohesive graphs.



This is what my .csv column looks like. It is just many other other rows.

['40' '20' '10' '0' '10' '30' '50' '70' '90' '110' '130' '150' '170' '200'
 '240' '290' '40' '20' '10' '0' '10' '30' '50' '70' '90' '110' '130' '150'
 '170' '200' '240' '290' '40' '20' '10' '0' '10' '30' '50' '70' '90' '110'



At the end of the day I would like a way to display these in a better way so I can also find the variance of this column.
You have currently stored your numbers as strings causing matplotlib to treat your variable as categorical, hence the y-axis is not ordered as expected. Before plotting you should therefore first convert them to integers like this:

x = [float(i.replace(",", ".")) for i in dev_x]


You can then use plt.plot(x) once again to plot the values, this should give you the following plot:



Edit:

Using the csv file you've provided, I am using the following code to read in the data and create the plot:

import matplotlib.pyplot as plt
import pandas as pd

# Read in csv file
df = pd.read_csv("DATA.csv")
# Set figure size
plt.figure(figsize=(15, 5))
# Create plot
plt.plot(df["DATA"])


This should give the following plot: