Skip to main content

Home/ Python/ Group items tagged Objective

Rss Feed Group items tagged

baliar

Objective modeling Viktor Zh33 Agra USA at 3dlancer.net - 0 views

  •  
    Objective modeling Viktor Zh33 Agra USA at 3dlancer.net
reckoner reckoner

Python Idioms and Efficiency Suggestions - 0 views

  • What idioms should I use to make my code easier to read? Read "The Python Cookbook", especially the first few chapters. It's a great source of well-written Python code examples.
  • Use function factories to create utility functions. Often, especially if you're using map and filter a lot, you need utility functions that convert other functions or methods to taking a single parameter. In particular, you often want to bind some data to the function once, and then apply it repeatedly to different objects. In the above example, we needed a function that multiplied a particular field of an object by 3, but what we really want is a factory that's able to return for any field name and amount a multiplier function in that family:
  • Use zip and dict to map fields to names. zip turns a pair of sequences into a list of tuples containing the first, second, etc. values from each sequence. For example, zip('abc', [1,2,3]) == [('a',1),('b',2),('c',3)]. You can use this to save a lot of typing when you have fields in a known order that you want to map to names:
  •  
    suggestions for better programming style.
jamessidis

Best Way to Learn Numpy - 0 views

  •  
    NumPy is the fundamental package for scientific computing in Python. Numpy stands for Numerical Python. If you want to work with machine learning or data science, Numpy is a Python library you will mostly use. It is a Python library that provides a multidimensional array object for fast operations on arrays, including mathematical, logical, shape manipulation, sorting, selecting, I/O, discrete Fourier transforms, basic linear algebra, basic statistical operations, and much more.
reckoner reckoner

non-interactive ipython for script - 0 views

  • Note that it's more rebust to run methods on the public IPython api.I.e. do ip = ipshell.api and then ip.magic('px import os')You can explore the api interactively by playing with _ip object.
  •  
    noninteractive ipython for regular python script
1 - 4 of 4
Showing 20 items per page