pandra

import pandas as pd
import matplotlib.pyplot as plt

df = pd.read_csv("data.csv",header = 0,skiprows = 7)
print(df.head())
#print(df.info())
#print(df.describe())
#print(df['Time'])
#print(df['ILEAK2'])

#filtered_data = df[df['ILEAK2'] > 4]
#print(filtered_data)
#df['ILEAK2'].plot(kind='hist',bins=10,alpha=0.6)
#df['ILEAK2'].plot(kind='line', title='ILEAK2', figsize=(10, 5))
#plt.xlabel('no')
#plt.ylabel('A')
#plt.grid(True)

fig,axs = plt.subplots(1,2,figsize=(10,4))
axs[0].plot(df['ILEAK2'])
axs[0].set_title('ILEAK2')
axs[0].set_xlabel('x')
axs[0].set_ylabel('y')
axs[0].grid(True)


axs[1].hist(df['ILEAK2'],bins=20,alpha = 0.7)
axs[1].set_title('ILEAK2')
axs[1].set_xlabel('x')
axs[1].set_ylabel('y')
axs[1].grid(True)

plt.tight_layout()

plt.show()

PythonでDALL-E3

note.com

from openai import OpenAI
import requests

client = OpenAI()

quality = ["standard", "hd"]
styles = ["vivid", "natural"]
images = []
labels = []

for q in quality:
    for s in styles:
        response = client.images.generate(
            model="dall-e-3",
            prompt="A cute baby sea otter",
            n=1,
            size="1024x1024",
            response_format="url",
            style=s,
            quality=q,
            user="wapa5pow",
        )

        data = requests.get(response.data[0].url).content
        label = f"{q}_{s}"
        filename = f"data/openai_dall-e-3_{label}.png"
        with open(filename, "wb") as handler:
            handler.write(data)
        images.append(filename)
        labels.append(label)