OK so I needed to import a .csv table into Matlab, but knew it could be tricky. A friend wrote some Matlab code for me once to do this and it was a page-and-half of fiddly code, filled with string trimming and required quite prescriptive column and row names.
I knew pandas could handle csv files nicely, but was keen to keep things in Matlab since the rest of the code was there etc. So I google for the best way to do it and got this. Its a whole blog called Abandon Matlab on how awful Matlab is! Has chapter and verse about how Matlab does not handle csv files with mixed data... I did not go looking for this. In late 2014, to install Octave and Oct2py for use in IPython on a Mac, take the following steps.
Yes this would have been better as a Notebook ;) An example of an IPython Notebook that converts Python plots into fun, annotated cartoons, suitable for presenting pseudo-quantitative hypotheses: XKCD plots in Matplotlib. It demonstrates some of the beauty of the IPython Notebook format (.ipynb), by being a blog post as python code (or vice versa?). The dual identity of .ipynb files and their mixed-media format solves many problems with other data analysis software: the lack of narrative, the difficulty of sharing and the challenge of 'provenance' - knowing how a result was arrived at, from what data and which analytic methods.
A post by Fernando Perez, the founder of IPython, describes the philosophical aims of the Notebook model (e.g. transparency, easy shareability), and gives some more substantial examples: "Literate computing" and computational reproducibility: IPython in the age of data-driven journalism. In particular, he describes how massive economic pain was inflicted by governments with support from some economists' buggy Excel spreadsheet (Reinhart-Rogoff), and how that this is something that would not have happened with a shared .ipynb file. Such a file was produced in 3 hours by a member of the Python community! In my view the clear superiority of Python over Matlab is based on things that did not exist when I first reviewed switching in mid-2011. Both the Notebook interface of IPython and the Pandas data analysis library were released with around the end of 2011, and since then both tools have gathered an incredible ecosystem around them. Furthermore, the IPython Notebook now also has 'magic' functions that allow one to call Octave (a free Matlab-like language) and R (a major language for stats) commands in a notebook, features that have evolved dramatically in recent years. Indeed, the first book about IPython was only released in April 2013. Update: Other great (new-ish?) features of Python are pip install and StackOverflow - they make things much easier than my experience in 2011. I am pretty sick of seeing the above, the Matlab license checkout error message. It comes up when my work copy of Matlab is open. Since my Matlab license only gives permission to use a single copy, the license server prevents me from using it on my work laptop at home. Within 20 minutes of seeing this error message, I had downloaded and installed the Anaconda distribution of Python, and used it to do the calculation I wanted to do (a simple linear regression), even though I am not familiar with the Python language. Google served as my help search tool. It was fewer lines of code, more straightforward than the Matlab script I was going to use and has a better interface (the IPython Notebook). From now on, the lab will be moving away from Matlab and working to use Python wherever possible. We are installing the Anaconda distribution on the server next to our data - so we also avoid having to move files across the network just to analyze. -Adam Update, 6th December 2014.
I just updated my browser to Yosemite, and now Matlab 2012b is completely broken on my laptop. PhD Studentships in Neuroscience
Behavioral Neuroscience Laboratory of Neurogenetics Duke-NUS Medical School Institute of Molecular and Cell Biology The Singapore-based Duke-NUS Graduate Medical School is a collaboration between Duke University and the National University of Singapore. It has a mission for research and training biomedical scientists and physicians. The Laboratory of Neurogenetics under the direction of Assistant Professor Adam Claridge-Chang focuses on analysing essential brain functions with behavioural, genetic, anatomical and physiological methods, with an aim to discovering some of the basic components and mechanisms that underlie psychiatric and cognitive dysfunction. The laboratory uses Drosophila neurogenetic methods combined with ongoing molecular, instrumentation and analytical tool development and application to understand the molecules and circuits that support learning. For additional information please visit www.claridgechang.net. The lab has an open PhD studentship in behavioral neuroscience. A candidate must have:
A candidate’s application will be strengthened by:
Your doctoral studies would include but are not limited to the following:
Interested applicants are welcome to email
Funding for the position can be through the SINGA program (Singapore International Graduate Award) for which the deadline is 1st June 2014 to start study in January 2015. Please contact us at least six weeks prior to the SINGA deadline. Other scholarships are available, please review options here. Research Assistant in Behavioral Neuroscience
Neuroscience and Behavioral Disorders Program Duke-NUS Medical School The Singapore-based Duke-NUS Graduate Medical School is a collaboration between Duke University and the National University of Singapore. It has a mission for research and training biomedical scientists and physicians. The Laboratory of Neurogenetics under the direction of Assistant Professor Adam Claridge-Chang focuses on analysing essential brain functions with behavioural, genetic, anatomical and physiological methods, with an aim to discovering some of the basic components and mechanisms that underlie psychiatric and cognitive dysfunction. The laboratory uses Drosophila neurogenetic methods combined with ongoing molecular, instrumentation and analytical tool development and application to understand the molecules and circuits that support learning. For additional information please visit www.claridgechang.net. The lab is seeking to appoint a research assistant to investigate how the brain alters preference for an olfactory stimulus. A candidate must have:
A candidates application will be strengthened by:
Your main duties would include but are not limited to the following:
Interested applicants are welcome to email
Postdoctoral Fellowship in Behavioral Neuroscience
Neuroscience and Behavioral Disorders Program Duke-NUS Medical School We invite applications for a postdoctoral fellowship. The Singapore-based Duke-NUS Graduate Medical School is a collaboration between Duke University and the National University of Singapore. It has a mission for research and training biomedical scientists and physicians. The Laboratory of Neurogenetics under the direction of Assistant Professor Adam Claridge-Chang focuses on analysing essential brain functions with behavioural, genetic, anatomical and physiological methods, with an aim to discovering some of the basic components and mechanisms that underlie psychiatric and cognitive dysfunction. The laboratory uses Drosophila neurogenetic methods combined with ongoing molecular, instrumentation and analytical tool development and application to understand the molecules and circuits that support learning. For additional information please visit www.claridgechang.net. The lab is seeking to appoint a postdoctoral scientist to investigate how the brain alters preference for an olfactory stimulus.
Your main duties would include but are not limited to the following:
Interested applicants are welcome to email
|
AuthorACCLab Archives
January 2024
Categories |