read a csv and plot in python 1

read a csv and plot in python

# Imports
import numpy as np
import pandas as pd
from pandas import DataFrame, Series
import matplotlib.pyplot as plt
from scipy.stats import pearsonr
from __future__ import division
import seaborn as sns
sns.set(style='ticks', palette='Set2')
%matplotlib inline

df= pd.read_csv('/content/drive/MyDrive/Colab Notebooks/res_data/dimers/py_GG.dat', header = None, delim_whitespace=True, error_bad_lines=False)

import seaborn as sns

ax = df
sns.pairplot(ax, hue=0, height=20, plot_kws={"s": 20})

Here is what the above code is Doing:
1. Importing the seaborn library and setting the style to ticks.
2. Loading the data into a pandas DataFrame.
3. Printing the first five rows of the DataFrame.
4. Creating a pairplot of the DataFrame, coloring by the column named “species”.

Similar Posts