-1
with open('btc_bars2.csv', newline='\n') as d:
    csv_reader = csv.reader(d)
    bars = list(csv_reader)

    print(bars)
    
    
    btc_df = pd.DataFrame(bars, columns=['date', 'open', 'high', 'low', 'close'])
    btc_df.set_index('date', inplace=True)
    print(btc_df.head())

I have csv file with 1000 rows when I load it and transfer it to a list when I pass it to dataframe it returns only 5 row that many are the columns I can't find why this happens.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
mike2020
  • 1
  • 1
  • Double check the docs for [`pandas.DataFrame.head`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.head.html). – costaparas Jan 25 '21 at 13:13

1 Answers1

0

df.head() gives you the first five rows, if you want all rows then print(df).

ac24
  • 5,325
  • 1
  • 16
  • 31