trying to make a calculator but my first function(addition) isnt working as intended

Advertisements This is my first time messing around with functions and I’m trying to make a calculator. I have made 4 functions – each set for add, subtract, multiply and divide. I have 2 inputs for x and y and an operations variable for the calculator to take in. you can see the code I… Read More trying to make a calculator but my first function(addition) isnt working as intended

How to groupby multiple columns in pandas based on name?

Advertisements I want to create a new dataframe with columns calculated as means of columns with similar names from this dataframe: B6_i B6_ii B6_iii … BXD80_i BXD80_ii BXD81_i data … Cd38 0.598864 -0.225322 0.306926 … -0.312190 0.281429 0.424752 Trim21 1.947399 2.920681 2.805861 … 1.469634 2.103585 0.827487 Kpnb1 -0.458240 -0.417507 -0.441522 … -0.314313 -0.153509 -0.095863 Six1… Read More How to groupby multiple columns in pandas based on name?

how to specify data on pearson correlation heatmap?

Advertisements I have a pearson correlation heat map coded, but its showing data from my dataframe which i dont need. is there a way to specify which columns i’d like to include? thanks in advance sb.heatmap(df[‘POPDEN’, ‘RoadsArea’, ‘MedianIncome’, ‘MedianPrice’, ‘PropertyCount’, ‘AvPTAI2015’, ‘PTAL’].corr(), annot=True, fmt=’.2f’) ————————————————————————— TypeError Traceback (most recent call last) <ipython-input-54-832fc3c86e3e> in <module> —->… Read More how to specify data on pearson correlation heatmap?