The circuit board 33 is fixed to the inverter housing 18 by fastening with the bolts 50 that are inserted through the respective first insertion holes 51. The busbars 57 are fastened with the bolts 53 inserted through the second insertion holes 52 and the nuts 62, respectively, to be fixed to the circuit board 33. Fastened with the bolt 50B through the first insertion hole 51B, the circuit board 33 is electrically connected to the inverter housing 18 as the ground of the noise reduction circuit 63. The variation in the position of the circuit board 33 at the first insertion hole 51B in the thickness direction within the tolerance is different from the variation in the position of the circuit board 33 at the second insertion hole 52B in the thickness direction within the tolerance, which is likely to cause the position of the circuit board 33 around the bolt 53B to be varied upper or lower in the thickness direction than the position of the circuit board 33 around the bolt 50B. However, the slit 82 of the circuit board 33 allows the circuit board 33 to be elastically deformable like a spring so as to reduce the distortion of the circuit board 33 at the portion between the first insertion hole 51B and the second insertion hole 52B caused by the variation in the position of the circuit board 33 to be upper or lower in the thickness direction.
The electric compressor 10 according to the embodiment offers the following advantageous effects.