Pandas
Data Analysis using Pandas II (Plot representation with Matplotlib)
Plot representation: Matplotlib¶
In [3]:
import pandas as pd
import numpy as np
import sys
import matplotlib.pyplot as plt
In [4]:
df =pd.read_csv('./Result_protein.txt', sep=" " )
In [6]:
df.head(10)
Out[6]:
In [25]:
x = df['family'][0:10]
y = df['npolar'][0:10]
In [27]:
plt.scatter(x, y)
plt.show()
In [55]:
x=df.iloc[:,6][0:1000]
y=df.iloc[:,8][0:1000]
plt.scatter(x,y)
plt.xlabel(r'% Hydrophobic', fontsize=15)
plt.ylabel(r'% Polar', fontsize=15)
plt.title('Proteins', fontsize=25)
plt.grid(True)
plt.show()
In [ ]:
#Myoglobin analysis
In [33]:
familyname = ["MYOGLOBIN"]
len(df[df.family.isin(familyname)])
df2=df[df.family.isin(familyname)]
len(df2)
Out[33]:
In [36]:
x = df2['nhydropho']
y = df2['npolar']
In [37]:
plt.scatter(x, y)
plt.show()