Python Questions

Daniel Duffy

C++ author, trainer
I am interested in Python design issues. Any good books on Design Patterns in Python?
I am also looking for a precise/compact treatment of how Python does the Functional Programming model.

Thanks!

@pingu
@APalley
 
Last edited:

vertigo

Member
I am looking for books on Numpy and Scipy, with focus on the numerical algorithms and background. I am not interested in having to wade in syntax before getting to these topics.

Any suggestions? Thx!
some good books on python that focus on mathematics

amit saha - doing math with python
yahya osais - computer simulation
jose garrido - computational models with python
jose unpingco - python for probability, statistics and machine learning
anything written by yves hilpsich (e.g., python for finance - analyze big financial data)
fabio nelli - python data analytics
jaan kiusalaas - numerical methods in engineering with python
ivan idris - numpy cookbook
 

Daniel Duffy

C++ author, trainer
some good books on python that focus on mathematics

amit saha - doing math with python
yahya osais - computer simulation
jose garrido - computational models with python
jose unpingco - python for probability, statistics and machine learning
anything written by yves hilpsich (e.g., python for finance - analyze big financial data)
fabio nelli - python data analytics
jaan kiusalaas - numerical methods in engineering with python
ivan idris - numpy cookbook
I had a look at the contents; the price spread is $[39,118]. The price seems to be a monotonic function on how fancy the title seems to be.

A general remark/question; is it necessary to devote the first X chapter to basic stuff. Can we not just assume stuf like variables, loops etc.?
 

Daniel Duffy

C++ author, trainer
How about
1. "Python for Option Pricing (analytical, binomial, PDE, SDE, MC etc.)". Build on all those lovely libraries.
2. "42"
3. "Creating Object and Functional Programming Applications in Python A Design Patterns Approach" with focus the stuff in 1.
 

Daniel Duffy

C++ author, trainer
Stupid question:
I use VS2017 and I have all Python libraries installed, including anaconda etc.

I want to run anaconda navigator but

1. I don't see it on my desktop
2. I don't know how to run it from VS2017 (I don't even know if it is even possible)

Any ideas? Thanks!

//
Solved.
 
Last edited:

Daniel Duffy

C++ author, trainer
This code does not build because it cannot find pyconfig.h
Any ideas (Visual Studio 2017 and Python 3.6)?

Code:
#include <boost/python/module.hpp>
#include <boost/python/def.hpp>

char const* greet()
{
   return "hello, world";
}

BOOST_PYTHON_MODULE(hello_ext)
{
    using namespace boost::python;
    def("greet", greet);
}
 
Numerical Python by Robert Johansson. It covers a broad range of numerical methods from ODE, PDE to optimization, probability, statistics, data science.

I am looking for books on Numpy and Scipy, with focus on the numerical algorithms and background. I am not interested in having to wade in syntax before getting to these topics.

Any suggestions? Thx!
 
Last edited:

Daniel Duffy

C++ author, trainer
Python does have its own view of what private attributes/member data are..

Code:
class PointTest: 
# Counterexample: class with "private" attributes
    def __init__(self,x=-10, y=0): #default values
        self.move(x,y)

    def move(self, x, y):   
        self._x = x
        self._y = y
        self.__x = x
        self.__y = y

    def printI(self):
         print (self._x, self._y)
 
    def printII(self):
         print (self.__x, self.__y)

pp = PointTest(1,2)
pp._x = -1; pp._y = -2
print("Private in name only? (PINO)")
print(pp._x); print(pp._y); #-1, -2
#print(pp.__x); print(pp.__y); #AttributeError

pp.printI() #(-1,-2)
pp.printII() #(1,2)
 
Top