How to have nested query with LINQ

This line: var csvLinesData = csvlines.Skip(1).Select(l => l.Split(‘,’).ToArray()); produces an IEnumerble<string[]>. When you select it, you can access the columns of your CSV, as you do in this line: CSRName = data[12], The problem with this line: csvLinesData.Count(w => w.direction=’I’) is that an element of csvLinesData is a string[] which doesn’t have a direction field … Read more

how to save sql query result to csv in pandas

You can try following code: import pandas as pd df1 = pd.read_csv(“Insert file path”) df2 = pd.read_csv(“Insert file path”) df1[‘Date’] = pd.to_datetime(df1[‘Date’] ,errors=”coerce”,format=”%Y-%m-%d”) df2[‘Date’] = pd.to_datetime(df2[‘Date’] ,errors=”coerce”,format=”%Y-%m-%d”) df = df1.merge(df2,how=’inner’, on =’Date’) df.to_csv(‘data.csv’,index=False) This should solve your problem.