News for hackers. Stuff that matters.
Re:Self-Directed Pandas Crash Course by efxhoy on Sunday February 07, 2021 @06:55AM (#26054423)
It's `pandas.read_<format> -> DataFrame` and `DataFrame.to_<format>`. So pandas reads a data format and gives you a dataframe. The `to_<format>` are instane methods of the DataFrame where you write a dataframe to a format. To me that makes sense.
Re:Self-Directed Pandas Crash Course by mft_ on Sunday February 07, 2021 @11:51AM (#26056202)
Sure, you can create a sort-of logic to fit the existing naming, but it's still something you have to learn.

Imagine you were using Pandas for the first time, working through a tutorial, and you've just learned that pd.read_csv reads a csv into a dataframe.

Intuitively, what would you expect the corresponding output function to be called? I'd hazard that a vast majority of people would guess at some version of write_csv, and would experiment with either pd.write_csv, or df.write_csv.