Physical size in different redshift I have only recently started to study astronomy. I would like to ask if I want to get the angle of Mpc under different redshifts, but the result I calculated seems a bit strange. Did I make a mistake while converting?
from astropy.cosmology import FlatLambdaCDM
import numpy as np
from astropy import units as u
import math 
cosmo = FlatLambdaCDM(H0=70, Om0=0.3)

d_A = cosmo.angular_diameter_distance(z=0.3)
print(d_A) #  Mpc

x = 3.29*u.Mpc

theta = (x/d_A *(180/math.pi) *(1/3600))
theta = theta*u.arcsec

print(theta)
You're correct, except that you should multiply, not divide, by 3600 (you're converting from degrees to arcsec, not the other way round). You get $5.7\times10^{-5}{''}$, but the correct result is 36002 times higher, i.e. $738.6''\!\!\!$.
But why not just let astropy do the job:
z     = 0.3
x     = 3.29 * u.Mpc
theta = x * cosmo.arcsec_per_kpc_proper(z)

print(theta.to(u.arcsec))
---&gt; &lt;Quantity 738.61092463 arcsec&gt;