Pairing data in python pandas -
For example, if the data in ponds is low:
import pandas as pd Data = {'Type': ['Cat 2', 'Cat 1', 'Cat 2', 'Cat 1', 'Cat 2', 'Cat 1', 'Cat 2', 'Cat 1', 'Cat 1 ',' cat 2 '], value': [1,2,3,1,2,3,1,2,3,5], 'experiment': [0,1,1,1,2,2 , 3,3,4,4]} My_data = pd.DataFrame (data) According to 'experiment', between 'Cat 1' vs 'Cat 2' Perry testing is required. What is the proper way to do this in Pandas? I am new to Pandas and have not fully adjusted to think about the data there.
Do you want it?:
& gt; & Gt; & Gt; My_data.pivot (index = 'experiment', column = 'type', value = 'value') type cat1 cat2 using 0 2 1 1 1 3 2 3 2 3 2 1 4 3 5
Comments
Post a Comment