I have made two column of data one of them are 286 number as y-amounts and another is 286 numbers as y1-amounts as function of x. I want to compare this two columns one row by one row and if y is larger than y1 it should be plotted in red else it will be plotted in blue. But I get this error: if yyy > y1: ^ IndentationError: expected an indented block
please help me!
The code:
import pandas as pd
from astropy.table import Table, Column
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(0)
from pandas import DataFrame
data = pd.read_csv('best match.csv')
s01 = pd.DataFrame(5 + data['Vmag'])
ID = pd.DataFrame(data['MAIN_ID'])
s22 = np.multiply(1/1000,data['Plx_1'])
s02 = np.log10(s22)
s03 = np.multiply(5, s02)
yyy = s01['Vmag']+s03
xxx = np.log10(data['Per'])
y1 = -2.8937*xxx - 1.3073
u = np.multiply(0.2, y1)
for row in yyy:
if yyy > y1:
plt.scatter(xxx, yyy, c='r')
else:
plt.scatter(xxx, yyy, c='b')
plt.ylim(3.5,-0.8)
plt.xlim(-1.85, -0.4)
plt.ylabel('$M_V$')
plt.xlabel('Log(p)')
Thanks
