I am trying to extract 150 lines in random from a dataset of 500 lines. So I would do it at random.
My data
object,color,label puppy,white,animal mango,orange,fruit pants,black,clothing My script
import pandas import pandas as pd df = pd.read_csv ('data.csv', sep = ',') data_random = df.sample (150) print (data_random) But the result is very strange, I do not have the complete line...
object ... label 277 grape ... fruit 116 bear ... animal 495 ... ... ... Is it possible to have the full line?
pd.options.display.max_columns = 20?pandas.DataFrame.sampleonly samples according to rows (unless specified otherwise, but you didn't), so it must be a display problem. Try and checkdata_random.shapeit should have the same number of columns asdf.