probably Pylance is having problems with the path for site-packages folder for your virtual environment and returns Import "pytest" could not be resolved, you need to set python path in this way:
"python.pythonPath": "/my/project/path/.venv/bin/python"
Answer from user11717481 on Stack Overflowprobably Pylance is having problems with the path for site-packages folder for your virtual environment and returns Import "pytest" could not be resolved, you need to set python path in this way:
"python.pythonPath": "/my/project/path/.venv/bin/python"
I tried h. deville fletcher's answer and it didn't seem to work for me, but I could have messed up in there too. However, in the process, I remembered that I hadn't changed my interpreter. Once I changed the interpreter to my pipenv shell that fixed my problem.
False "is not accessed".
Recognize pytest fixtures used as arguments that are implicitly accessed
'module' is not Accessed Pylance(Pylance is greyed out)
"pyotp" is not accessed Pylance
So as part of a book I'm working through I'm trying to plot weather data using two different csv files and have implemented a function to do so.
import csv
from matplotlib import pyplot as plt
def get_high(filename, highs):
with open(filename) as f:
reader = csv.reader(f)
header_row = next(reader)
for row in reader:
high = int(row[4])
highs.append(high)
highs = []
get_high('report1.csv', highs)
fig = plt.figure(dpi=128, figsize=(15,9))
plt.plot(highs, c='red')
highs = []
get_high('report2.csv', highs)
plt.plot(highs, c='blue')
plt.title("January Tempatures in Miami 2020(red) vs 1970(blue)", fontsize=20)
plt.xlabel("Days", fontsize=10)
plt.ylabel('Tempatures (F)', fontsize=10)
plt.tick_params(axis='both', major='which', labelsize=16)
plt.show()When I run this it gives me "high = int(row[4]) IndexError: list index out of range".
I've tried going back and changing 4. At 0 and 1 it tells me "ValueError: invalid literal for int() with base 10:" And as soon as I hit the 2nd index (where the integers start) it gives me the IndexError. I noticed when I hover over header_row it tells me that it can't be accessed and I think that's what's causing this problem but I can't find a fix for it.
EDIT; Also looking for a way to make it so the graph DOESN'T start mapping at 0.