Dataframes #programming #python
Dateframes are the spreadsheets of [Python] programming:
- It is a simple, yet versatile concept
- People who learn them really like to use them
- Their usage makes me uneasy, in a hard-to-articulate way
- They are easy to use inefficiently¹
- It is easy to make hard-to-spot mistakes with large consequences²
¹ Say you have a dataframe of records, and you also have some values from somewhere else. How to store the values? Put them in a dataframe! Now you have two dataframes. How to look up a value for each record? Do a filter on the second dataframe. Now you have #R*#V running time.
² Say you have a dataframe of records and some values in another dataframe. To avoid going through all values for every record, you store the records and the values in the same order, now you can simply index into the value dataframe. Say you need to filter or sort the records somehow, now you have to remember to filter and sort the value dataframe in exactly the same way.
Add comment
How to in excruciating detail…
To avoid spam many websites make you fill out a CAPTCHA, or log in via an account at a corporation such as Twitter, Facebook, Google or even Microsoft GitHub.
I have chosen to use a more old school method of spam prevention.
To post a comment here, you need to:
- Configure a newsreader¹ to connect to the server
- Open the newsgroup called
¹ Such as Thunderbird, Pan, slrn, tin or Gnus (part of Emacs).koldfront.dk
on port1119
using nntps (nntp over TLS).lantern.koldfront
and post a follow up to the article.Or, you can fill in this form: