I've been using R
for at least 5 years. Lately, I've been trying to pick up python
as
well, which is quite the learning experience! I've been through some tutorials (or pieces
of them) from think python and lpthw, as well as classes on Coursera. With some basics
under my belt, I started getting into numpy
and pandas
, which is where things got
tricky. I can vaguely recall a time in my R
Padawan days when I had a sense of what I
wanted to do, but didn't know enough to even formulate the question correctly. I also find
I don't learn well by just reading docs. I want to poke and prod around, trying to wrap my
head around what I'm reading. For example, I ran across the the function tolist()
via
SO, but have no idea how to interpret this as it is:
Series.tolist()
Convert Series to a nested list
I thought a pd.Series
was just like an R
vector; why would it be "nestable" in the
first place? What is a nested list and why do I want that? Some examples just show that it
converts from a pd.Series
to a list. I don't see any "nesting," but then don't know what
that is.
In any case, the point is that instead of trying to just learn pandas
in some linear
way, I thought it might be more effective to simply take some R
code and translate it to
python
. I know what I want to know and the tools I would use in R
, so getting my brain
around how to do the same in python
seemed like an interesting way to learn. Whatever I
pickup will be relevant (I'm already doing these sorts of tasks), and the learning is more
targetted (I'm extracting the small % of information I need vs. trying to digest things I
likely will never use).
Read more…