Snippets Collections
import requests
import pandas as pd
import io
from pathlib import Path


# setup some data so code works
f = Path.cwd().joinpath("eurusd_m1_03.03.2022.csv")
pd.read_csv(
    io.StringIO(
        requests.get(
            "https://www.marketwatch.com/investing/currency/eurusd/downloaddatapartial?startdate=08/03/2022%2000:00:00&enddate=09/02/2022%2023:59:59&daterange=d30&frequency=p1d&csvdownload=true&downloadpartial=false&newdates=false"
        ).text
    )
).pipe(
    lambda d: d.rename(columns={c: c.lower() for c in d.columns}).rename(
        columns={"date": "time"}
    )
).to_csv(
    f
)


from time import time
import plotly.graph_objects as go
import pandas as pd

def PrintChartData():
    data = pd.read_csv("eurusd_m1_03.03.2022.csv")
    return data


def PrintDataChart():
    data = pd.read_csv("eurusd_m1_03.03.2022.csv")
    chart_data = go.Candlestick(
        x=data["time"],
        open=data["open"],
        high=data["high"],
        low=data["low"],
        close=data["close"],
    )
    fig = go.Figure(data=[chart_data])
    print(fig.show())


PrintDataChart()
fileinput = str(input("Which file do you want?"))
if not ".csv" in fileinput:
  fileinput += ".csv"
import csv

with open('example.csv') as csvfile:
    readCSV = csv.reader(csvfile, delimiter=',')
import pandas as pd

read_file = pd.read_excel (r'Path where the Excel file is stored\File name.xlsx')
read_file.to_csv (r'Path to store the CSV file\File name.csv', index = None, header=True)
star

Tue Sep 06 2022 08:32:58 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/73610982/typeerror-module-object-is-not-callable-in-plotly/73612090#73612090

#python #.csv #stackoverflow #plotlib #forexchart
star

Tue Sep 06 2022 07:22:39 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/56342198/python-code-to-read-csv-file-based-on-user-input

#python #.csv
star

Tue Sep 06 2022 07:16:43 GMT+0000 (Coordinated Universal Time) https://www.google.com/search?q

#python #.csv #opencsvfiles
star

Mon Sep 05 2022 08:42:16 GMT+0000 (Coordinated Universal Time) https://www.google.com/search?q

#python #.csv #xlstocsv

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension