Because of the availability of a variety of useful libraries, scripting languages such as Python are getting popular in many domains, especially in scientific computing and data science. Several famous libraries like SciPy Stack and TensorFlow/Keras are built on top of Python, and even those who are not programming experts can get started quickly. The usage of these libraries is some sort of embedded domain-specific languages (EDSLs) since the programming model is quite different from the original ones in host languages. For example, programmers are encouraged to use dedicated arrays given by the libraries rather than the language built-in ones for continuous memory allocation due to performance concern. The timing of assigning values and evaluating expressions are based on the design of libraries instead of the semantics of host languages. Due to such an EDSL usage and the limitation of type systems in host languages, some expressions that have type-level meaning cannot be treated as types well. On the other hand, scientists who migrate from traditional programming languages like Fortran and C might have no idea about how to benefit from modern language features. This observation led us to propose improving programming support for scientific computing and data science applications by applying code analysis along with machine learning. This research is to develop a set of tools, in particular, the ones in development environments for Python, to check defects in code and provide revision tips. Although a lot of research activities were already devoted to code analysis and applications of machine learning in other domains, there is still room for benefiting from machine learning in code analysis based on our understanding. In our previous project, we have developed guidelines and utilities to help scientists in rewriting their legacy programs with modern programming languages, and this project is further targeted at improving programming support for those rewritten code and the EDSL code in scientific computing and data science domains.