1

I have dataframe with 2232803 rows and two columns 'x' , 'y', I want to draw line plot. x-axis x and y-axis y . I tried some ways but when i plot my computer stuck maybe file is so big , my computer have 8gb RAM. is there anyway to plot that big file

i tried this:

plt.plot(df['x'].values,df['y'].values)
Edward
  • 563
  • 3
  • 11
  • Can you provide more of the code, like how you set up your DataFrame dt. Also did you tried the same code with a smaller set like 10 rows? – Guillaume Raymond Jan 09 '20 at 08:01
  • Maybe this [post](https://stackoverflow.com/questions/5854515/interactive-large-plot-with-20-million-sample-points-and-gigabytes-of-data) is helpful for you. – René Jan 09 '20 at 11:08

1 Answers1

1

I suggest you plot a random fraction of the dataset:

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

df = pd.DataFrame(np.random.rand(2232803, 2), columns=list('xy'))
df_plot = df.sample(frac=0.01).copy()

plt.plot(df_plot['x'].values, df_plot['y'].values)
René
  • 4,594
  • 5
  • 23
  • 52