Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pandas CSV Issues
#2
Quote:Unfortunately when the CSV or dataframe reaches 365 records, it either reads the first 365 records or write the first 365 records

I assume you mean when the dataframe is larger than 365 records. Correct?


I think the problem is elsewhere. 365 rows (records?) is pretty small for pandas.

This program creates a dataframe with 1000 rows, each row having 1000 columns. It writes just fine to a csv file, and when I read it back in, the new dataframe equals the old.
import pandas as pd

data = {str(i):list(range(1000)) for i in range(1000)}
df = pd.DataFrame(data)
df.to_csv("test.csv", index=False)

df2 = pd.read_csv("test.csv")
print(df2.equals(df))
Output:
True
What have you done to try and debug this problem? 365 is a really interesting number. I can think of all kinds of code I could write that would stop working at 365, but the fault would be mine, not pandas. Can you post the code that is writing your csv file?
Reply


Messages In This Thread
Pandas CSV Issues - by rmfooty - Nov-14-2022, 10:09 AM
RE: Pandas CSV Issues - by deanhystad - Nov-14-2022, 05:09 PM
RE: Pandas CSV Issues - by rmfooty - Nov-16-2022, 04:39 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020