Graphic Processing Units (GPUs) are becoming popular in computational physics. Seeing the increasing trend of using GPUs in the physics community, we provide a comparison of the two major packages Numba and CuPy for GPU coding in Python language. We have disscussed the influence of the data amount and data type on the performance of the GPU code. The data transferring time from GPU to CPU and its influence on the total execution time has also been analyzed. We find that when the grid numbers reaches 1 0 7 , Numba will be faster than CuPy. Meanwhile, there is no noticeable difference in the data transmission speed between Numba and CuPy. Setting the data types as single-precision in Numba programs can improve the computation time by at least 20%. • Data amount, data type and implementation packages affect GPU coding performance. • Execution time does not vary much with increadsing data amount using Numba package. • Execution time for data type float32 is about 20\% faster than float64. • Numba package is more flexible than CuPy for GPU computing in Python language.