Statistical Signifance Test for discrete data I'm fairly new to statistics and want to perform a statistical analysis (calculation of p value)
for data I collected, but I'm unsure if I'm doing it correctly and would like some feedback/help.
I have 180 ratings from 1 to 10 for two categories, so 90 ratings per category.
This is the distribution of answers for the categories:

My goal is to prove that these datapoints result from the same underlying distribution, i.e.,
there is no statistical significant difference.
But I'm not sure what statistical test I should use, since there seem to be a lot of conditions and caveats.
The datapoints don't follow a normal distribution, so I should use a non parametric test.
My data is numerical and discrete, which also excludes a lot of options.
I tried the chisquare test but it results in NaN for the scipy.stats.chisquare method, since the values 1 and 10 have a frequency of 0. I could just exclude 1 and 10, but I don't know if thats valid. The output I get is:
Power_divergenceResult(statistic=9.400411679823446, pvalue=0.22517169474250875)

Another test I tried is the Mann Whitney U test, which gave me the following result:
MannwhitneyuResult(statistic=4061.5, pvalue=0.9742929619325416)

Can I use the latter approach? Did I make any mistake so far?

Assuming that you are treating the responses for Confidence as ordinal categories, your bar plot of counts for Confidence responses for each Group suggests that there is no systematic difference in the central tendency of the responses for the groups.
To test this, you might use a Wilcoxon-Mann-Whitney test, which assesses the probability that a response from Group A is greater than a response from Group B.
You could also compare median responses from the Groups with Mood's median test or another test of medians.
If you wanted to take a bit of a leap of faith and compare the mean responses --- you could assume that the responses are interval in nature and that the marginal distribution of the responses are normal in distribution --- and use a t test.
You might be a little careful with your conclusions. You can't prove that these samples come from the same distribution.  But it looks like you don't have good evidence that they come from different distributions (based on the tests described).
Below is the approximate data extracted from the plot, and a Wilcoxon-Mann-Whitney test, in R.
The vda() function then calculates the probability that an observation from A will be greater than an observation from B.  The result, close to 0.5, suggests that neither group is very likely to have observations greater than the other group.
if(!require(tidyr)){install.packages("tidyr")}

Data = read.table(header=TRUE, stringsAsFactors=TRUE, text="

Group Confidence Count
A 1   0
A 2   2
A 3   8
A 4   8
A 5   8
A 6  20
A 7  24
A 8  17
A 9   3
A 10  0
B 1   0
B 2   2
B 3   7
B 4   9
B 5   9
B 6  14
B 7  34
B 8  11
B 9   4
B 10  0
")

library(tidyr)

Long = uncount(Data, Count)

rownames(Long) = seq(1:nrow(Long))

Long

library(FSA)

Summarize(Confidence ~ Group, data=Long)

wilcox.test(Confidence ~ Group, data=Long)

    ### W = 4038.5, p-value = 0.9743


library(rcompanion)

vda(Confidence ~ Group, data=Long, verbose=TRUE)

   ###            Statistic Value
   ### 1 Proportion Ya > Yb 0.406
   ### 2 Proportion Ya < Yb 0.409
   ### 3    Proportion ties 0.185
   ###  
   ### VDA 
   ### 0.499

