correction bug create table

master
Vivien Dufour 2 years ago
parent 0eae66a4f5
commit 75b4b6150c

@ -12,83 +12,86 @@ co = None
try:
co = psy. connect(host='londres',
database ='dbanperederi',
user='anperederi',
database ='dbvidufour1',
user='vidufour1',
password = getpass("Mot de passe:"))
curs = co.cursor()
curs. execute ('''DROP TABLE IF EXISTS Car, Model, Seller ;''')
curs. execute ('''DROP TABLE IF EXISTS Car, Brand, Model, Person, Marque;''')
curs. execute ('''CREATE TABLE Car (
IdCar numeric NOT NULL,
Model varchar(100) NOT NULL,
Price numeric(12) NOT NULL,
Color numeric(12) NOT NULL,
Year year NOT NULL,
Kilometer numeric NOT NULL,
PRIMARY KEY (IdCar)
IdCar numeric,
Model varchar(100),
Price numeric,
Color varchar(32),
Year numeric,
Kilometer numeric,
PRIMARY KEY (IdCar)
);
CREATE TABLE Brand (
Name varchar(80),
CreationDate numeric,
Founder varchar(80),
CEO varchar(80),
Headquarter varchar(80),
Value numeric,
PRIMARY KEY(Name)
);
CREATE TABLE Model (
Name varchar(120) NOT NULL,
Brand varchar(80) NOT NULL,
FuelType varchar(50) NOT NULL,
Transmission varchar(50) NOT NULL,
Engine varchar(15) NOT NULL,
MaxPower varchar(20) NOT NULL,
MaxTorque varchar(20) NOT NULL,
Drivetrain varchar(5) NOT NULL,
Length numeric(5,2) NOT NULL,
Width numeric(5,2) NOT NULL,
Height numeric(5,2) NOT NULL,
SeatingCapacity numeric(2,1) NOT NULL,
FuelTankCapacity numeric(3,1) NOT NULL,
Name varchar(120),
Brand varchar(80),
FuelType varchar(50),
Transmission varchar(50),
Engine varchar(32),
MaxPower varchar(32),
MaxTorque varchar(32),
Drivetrain varchar(5),
Length numeric,
Width numeric,
Height numeric,
SeatingCapacity numeric,
FuelTankCapacity numeric,
PRIMARY KEY (Name),
FOREIGN KEY (Brand) REFERENCES Brand(Name)
);
CREATE TABLE Brand (
Name varchar(80) NOT NULL,
CreationDate DATE NOT NULL,
Founder varchar(80) NOT NULL,
CEO varchar(80) NOT NULL,
Headquarter varchar(80) NOT NULL,
Value numeric NOT NULL,
PRIMARY KEY(Name)
);
CREATE TABLE Person (
Id numeric NOT NULL,
Name varchar(80) NOT NULL,
Job varchar IN("CEO", "Founder") NOT NULL,
Brand varchar(80) NOT NULL,
Id numeric,
Name varchar(80),
Job varchar(80) CHECK (Job IN('CEO', 'Founder')),
Brand varchar(80),
PRIMARY KEY(Id),
FOREIGN KEY (Brand) REFERENCES Brand(Name)
);
''')
id=1
for row in df.itertuples():
curs.execute('''INSERT INTO Car VALUES (%s ,%s ,%s ,%s, %s, %s);''',
(row.IdCar , row.Model , row.Price, row.Color , row.Year , row.Kilometer))
(id , row.Model , row.Price , row.Color , row.Year, row.Kilometer))
id = id + 1
curs.execute('''INSERT INTO Model VALUES (%s ,%s ,%s ,%s, %s, %s ,%s ,%s ,%s, %s, %s ,%s ,%s);''',
(row.Name , row.Brand , row.FuelType , row.Transmission , row.Engine, row.MaxPower,
(row.Model , row.Brand , row.FuelType , row.Transmission , row.Engine, row.MaxPower,
row.MaxTorque, row.Drivetrain, row.Length, row.Width, row.Height, row.SeatingCapacity, row.FuelTankCapacity))
curs.execute('''INSERT INTO Brand VALUES (%s ,%s ,%s ,%s, %s, %s);''',
(row.Name , row.CreationDate , row.Founder , row.CEO , row.Headquarter, row.Value))
curs.execute('''INSERT INTO Person VALUES (%s ,%s ,%s ,%s);''',
(row.Id , row.Name, row.Job , row.Brand))
curs.execute ('''SELECT * FROM Car, Model, Brand, Person;''')
# curs.execute ('''SELECT * FROM Car, Model, Brand, Person;''')
# curs.execute('''SELECT AVG(Price) FROM Car;''')
curs.execute('''SELECT AVG(Price) FROM Car;''')
curs.execute('''SELECT DISTINCT * FROM Marque;''')
result = curs.fetchall()
for row in result:
print(row)
datafr = pd.read_sql('''SELECT AVG(Price) FROM Car GROUP BY Brand''', con = co)
datafr.plot.bar(x='Brand', y='AVG(Price)')
plt.show()
# datafr = pd.read_sql('''SELECT AVG(Price) FROM Car GROUP BY Brand''', con = co)
# datafr.plot.bar(x='Brand', y='AVG(Price)')
# plt.show()

@ -1,4 +1,4 @@
Brand,Model,Price,Year,Kilometer,Fuel Type,Transmission,Location,Color,Owner,Seller Type,Engine,Max Power,Max Torque,Drivetrain,Length,Width,Height,Seating Capacity,Fuel Tank Capacity
Brand,Model,Price,Year,Kilometer,FuelType,Transmission,Location,Color,Owner,SellerType,Engine,MaxPower,MaxTorque,Drivetrain,Length,Width,Height,SeatingCapacity,FuelTankCapacity
Honda,Amaze 1.2 VX i-VTEC,505000,2017,87150,Petrol,Manual,Pune,Grey,First,Corporate,1198,87 bhp @ 6000 rpm,109 Nm @ 4500 rpm,FWD,3990.0,1680.0,1505.0,5.0,35.0
Maruti Suzuki,Swift DZire VDI,450000,2014,75000,Diesel,Manual,Ludhiana,White,Second,Individual,1248,74 bhp @ 4000 rpm,190 Nm @ 2000 rpm,FWD,3995.0,1695.0,1555.0,5.0,42.0
Hyundai,i10 Magna 1.2 Kappa2,220000,2011,67000,Petrol,Manual,Lucknow,Maroon,First,Individual,1197,79 bhp @ 6000 rpm,112.7619 Nm @ 4000 rpm,FWD,3585.0,1595.0,1550.0,5.0,35.0

1 Brand Model Price Year Kilometer Fuel Type FuelType Transmission Location Color Owner Seller Type SellerType Engine Max Power MaxPower Max Torque MaxTorque Drivetrain Length Width Height Seating Capacity SeatingCapacity Fuel Tank Capacity FuelTankCapacity
2 Honda Amaze 1.2 VX i-VTEC 505000 2017 87150 Petrol Manual Pune Grey First Corporate 1198 87 bhp @ 6000 rpm 109 Nm @ 4500 rpm FWD 3990.0 1680.0 1505.0 5.0 35.0
3 Maruti Suzuki Swift DZire VDI 450000 2014 75000 Diesel Manual Ludhiana White Second Individual 1248 74 bhp @ 4000 rpm 190 Nm @ 2000 rpm FWD 3995.0 1695.0 1555.0 5.0 42.0
4 Hyundai i10 Magna 1.2 Kappa2 220000 2011 67000 Petrol Manual Lucknow Maroon First Individual 1197 79 bhp @ 6000 rpm 112.7619 Nm @ 4000 rpm FWD 3585.0 1595.0 1550.0 5.0 35.0

@ -1,4 +1,4 @@
Brand,Model,Price,Year,Kilometer,Fuel Type,Transmission,Location,Color,Owner,Seller Type,Engine,Max Power,Max Torque,Drivetrain,Length,Width,Height,Seating Capacity,Fuel Tank Capacity
Brand,Model,Price,Year,Kilometer,FuelType,Transmission,Location,Color,Owner,SellerType,Engine,MaxPower,MaxTorque,Drivetrain,Length,Width,Height,SeatingCapacity,FuelTankCapacity
Honda,Amaze 1.2 VX i-VTEC,505000,2017,87150,Petrol,Manual,Pune,Grey,First,Corporate,1198 cc,87 bhp @ 6000 rpm,109 Nm @ 4500 rpm,FWD,3990.0,1680.0,1505.0,5.0,35.0
Maruti Suzuki,Swift DZire VDI,450000,2014,75000,Diesel,Manual,Ludhiana,White,Second,Individual,1248 cc,74 bhp @ 4000 rpm,190 Nm @ 2000 rpm,FWD,3995.0,1695.0,1555.0,5.0,42.0
Hyundai,i10 Magna 1.2 Kappa2,220000,2011,67000,Petrol,Manual,Lucknow,Maroon,First,Individual,1197 cc,79 bhp @ 6000 rpm,112.7619 Nm @ 4000 rpm,FWD,3585.0,1595.0,1550.0,5.0,35.0

1 Brand Model Price Year Kilometer Fuel Type FuelType Transmission Location Color Owner Seller Type SellerType Engine Max Power MaxPower Max Torque MaxTorque Drivetrain Length Width Height Seating Capacity SeatingCapacity Fuel Tank Capacity FuelTankCapacity
2 Honda Amaze 1.2 VX i-VTEC 505000 2017 87150 Petrol Manual Pune Grey First Corporate 1198 cc 87 bhp @ 6000 rpm 109 Nm @ 4500 rpm FWD 3990.0 1680.0 1505.0 5.0 35.0
3 Maruti Suzuki Swift DZire VDI 450000 2014 75000 Diesel Manual Ludhiana White Second Individual 1248 cc 74 bhp @ 4000 rpm 190 Nm @ 2000 rpm FWD 3995.0 1695.0 1555.0 5.0 42.0
4 Hyundai i10 Magna 1.2 Kappa2 220000 2011 67000 Petrol Manual Lucknow Maroon First Individual 1197 cc 79 bhp @ 6000 rpm 112.7619 Nm @ 4000 rpm FWD 3585.0 1595.0 1550.0 5.0 35.0

@ -29,7 +29,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 1,
"id": "c0f0ed8f",
"metadata": {},
"outputs": [],
@ -52,151 +52,25 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 2,
"id": "c068815f",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Brand</th>\n",
" <th>Model</th>\n",
" <th>Price</th>\n",
" <th>Year</th>\n",
" <th>Kilometer</th>\n",
" <th>Fuel Type</th>\n",
" <th>Transmission</th>\n",
" <th>Location</th>\n",
" <th>Color</th>\n",
" <th>Owner</th>\n",
" <th>Seller Type</th>\n",
" <th>Engine</th>\n",
" <th>Max Power</th>\n",
" <th>Max Torque</th>\n",
" <th>Drivetrain</th>\n",
" <th>Length</th>\n",
" <th>Width</th>\n",
" <th>Height</th>\n",
" <th>Seating Capacity</th>\n",
" <th>Fuel Tank Capacity</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>31</th>\n",
" <td>Hyundai</td>\n",
" <td>Creta 1.6 SX Plus AT</td>\n",
" <td>925000</td>\n",
" <td>2016</td>\n",
" <td>66000</td>\n",
" <td>Diesel</td>\n",
" <td>Automatic</td>\n",
" <td>Raipur</td>\n",
" <td>Black</td>\n",
" <td>First</td>\n",
" <td>Individual</td>\n",
" <td>1582 cc</td>\n",
" <td>126 bhp @ 4000 rpm</td>\n",
" <td>265 Nm @ 1900 rpm</td>\n",
" <td>FWD</td>\n",
" <td>4270.0</td>\n",
" <td>1780.0</td>\n",
" <td>1630.0</td>\n",
" <td>5.0</td>\n",
" <td>60.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>32</th>\n",
" <td>Ford</td>\n",
" <td>Ecosport Titanium+ 1.0L EcoBoost</td>\n",
" <td>535000</td>\n",
" <td>2015</td>\n",
" <td>28000</td>\n",
" <td>Petrol</td>\n",
" <td>Manual</td>\n",
" <td>Mumbai</td>\n",
" <td>Silver</td>\n",
" <td>First</td>\n",
" <td>Individual</td>\n",
" <td>999 cc</td>\n",
" <td>124 bhp @ 6000 rpm</td>\n",
" <td>170 Nm @ 1400 rpm</td>\n",
" <td>FWD</td>\n",
" <td>3999.0</td>\n",
" <td>1765.0</td>\n",
" <td>1708.0</td>\n",
" <td>5.0</td>\n",
" <td>52.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>34</th>\n",
" <td>Hyundai</td>\n",
" <td>Santro GL (CNG)</td>\n",
" <td>145000</td>\n",
" <td>2009</td>\n",
" <td>72000</td>\n",
" <td>CNG</td>\n",
" <td>Manual</td>\n",
" <td>Kanpur</td>\n",
" <td>Silver</td>\n",
" <td>Second</td>\n",
" <td>Individual</td>\n",
" <td>1086 cc</td>\n",
" <td>62 bhp @ 5500 rpm</td>\n",
" <td>96 Nm @ 3000 rpm</td>\n",
" <td>FWD</td>\n",
" <td>3565.0</td>\n",
" <td>1525.0</td>\n",
" <td>1590.0</td>\n",
" <td>5.0</td>\n",
" <td>35.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Brand Model Price Year Kilometer \n",
"31 Hyundai Creta 1.6 SX Plus AT 925000 2016 66000 \\\n",
"32 Ford Ecosport Titanium+ 1.0L EcoBoost 535000 2015 28000 \n",
"34 Hyundai Santro GL (CNG) 145000 2009 72000 \n",
"\n",
" Fuel Type Transmission Location Color Owner Seller Type Engine \n",
"31 Diesel Automatic Raipur Black First Individual 1582 cc \\\n",
"32 Petrol Manual Mumbai Silver First Individual 999 cc \n",
"34 CNG Manual Kanpur Silver Second Individual 1086 cc \n",
"\n",
" Max Power Max Torque Drivetrain Length Width Height \n",
"31 126 bhp @ 4000 rpm 265 Nm @ 1900 rpm FWD 4270.0 1780.0 1630.0 \\\n",
"32 124 bhp @ 6000 rpm 170 Nm @ 1400 rpm FWD 3999.0 1765.0 1708.0 \n",
"34 62 bhp @ 5500 rpm 96 Nm @ 3000 rpm FWD 3565.0 1525.0 1590.0 \n",
"\n",
" Seating Capacity Fuel Tank Capacity \n",
"31 5.0 60.0 \n",
"32 5.0 52.0 \n",
"34 5.0 35.0 "
]
},
"metadata": {},
"output_type": "display_data"
"ename": "TypeError",
"evalue": "cannot do slice indexing on Int64Index with these indexers [30] of type Integer",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m/home/UCA/vidufour1/SAE/SAE2.04-Exploitation_d_une_base_de_donnees/csvCleaner.ipynb Cell 6\u001b[0m in \u001b[0;36m<cell line: 8>\u001b[0;34m()\u001b[0m\n\u001b[1;32m <a href='vscode-notebook-cell:/home/UCA/vidufour1/SAE/SAE2.04-Exploitation_d_une_base_de_donnees/csvCleaner.ipynb#W5sZmlsZQ%3D%3D?line=4'>5</a>\u001b[0m df\u001b[39m=\u001b[39mdf\u001b[39m.\u001b[39mdropna(axis\u001b[39m=\u001b[39mInteger(\u001b[39m0\u001b[39m))\n\u001b[1;32m <a href='vscode-notebook-cell:/home/UCA/vidufour1/SAE/SAE2.04-Exploitation_d_une_base_de_donnees/csvCleaner.ipynb#W5sZmlsZQ%3D%3D?line=6'>7</a>\u001b[0m \u001b[39m#Permet d'afficher le dataframe\u001b[39;00m\n\u001b[0;32m----> <a href='vscode-notebook-cell:/home/UCA/vidufour1/SAE/SAE2.04-Exploitation_d_une_base_de_donnees/csvCleaner.ipynb#W5sZmlsZQ%3D%3D?line=7'>8</a>\u001b[0m display(df[Integer(\u001b[39m30\u001b[39;49m):Integer(\u001b[39m33\u001b[39;49m)])\n\u001b[1;32m <a href='vscode-notebook-cell:/home/UCA/vidufour1/SAE/SAE2.04-Exploitation_d_une_base_de_donnees/csvCleaner.ipynb#W5sZmlsZQ%3D%3D?line=9'>10</a>\u001b[0m df1\u001b[39m=\u001b[39mdf\n\u001b[1;32m <a href='vscode-notebook-cell:/home/UCA/vidufour1/SAE/SAE2.04-Exploitation_d_une_base_de_donnees/csvCleaner.ipynb#W5sZmlsZQ%3D%3D?line=10'>11</a>\u001b[0m \u001b[39m# Permet de suppr les NAN\u001b[39;00m\n",
"File \u001b[0;32m/usr/local/lib/python3.9/dist-packages/pandas/core/frame.py:3477\u001b[0m, in \u001b[0;36mDataFrame.__getitem__\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m 3474\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_get_item_cache(key)\n\u001b[1;32m 3476\u001b[0m \u001b[39m# Do we have a slicer (on rows)?\u001b[39;00m\n\u001b[0;32m-> 3477\u001b[0m indexer \u001b[39m=\u001b[39m convert_to_index_sliceable(\u001b[39mself\u001b[39;49m, key)\n\u001b[1;32m 3478\u001b[0m \u001b[39mif\u001b[39;00m indexer \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[1;32m 3479\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39misinstance\u001b[39m(indexer, np\u001b[39m.\u001b[39mndarray):\n",
"File \u001b[0;32m/usr/local/lib/python3.9/dist-packages/pandas/core/indexing.py:2324\u001b[0m, in \u001b[0;36mconvert_to_index_sliceable\u001b[0;34m(obj, key)\u001b[0m\n\u001b[1;32m 2322\u001b[0m idx \u001b[39m=\u001b[39m obj\u001b[39m.\u001b[39mindex\n\u001b[1;32m 2323\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39misinstance\u001b[39m(key, \u001b[39mslice\u001b[39m):\n\u001b[0;32m-> 2324\u001b[0m \u001b[39mreturn\u001b[39;00m idx\u001b[39m.\u001b[39;49m_convert_slice_indexer(key, kind\u001b[39m=\u001b[39;49m\u001b[39m\"\u001b[39;49m\u001b[39mgetitem\u001b[39;49m\u001b[39m\"\u001b[39;49m)\n\u001b[1;32m 2326\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39misinstance\u001b[39m(key, \u001b[39mstr\u001b[39m):\n\u001b[1;32m 2327\u001b[0m \n\u001b[1;32m 2328\u001b[0m \u001b[39m# we are an actual column\u001b[39;00m\n\u001b[1;32m 2329\u001b[0m \u001b[39mif\u001b[39;00m key \u001b[39min\u001b[39;00m obj\u001b[39m.\u001b[39mcolumns:\n",
"File \u001b[0;32m/usr/local/lib/python3.9/dist-packages/pandas/core/indexes/numeric.py:279\u001b[0m, in \u001b[0;36mNumericIndex._convert_slice_indexer\u001b[0;34m(self, key, kind)\u001b[0m\n\u001b[1;32m 275\u001b[0m \u001b[39m# We always treat __getitem__ slicing as label-based\u001b[39;00m\n\u001b[1;32m 276\u001b[0m \u001b[39m# translate to locations\u001b[39;00m\n\u001b[1;32m 277\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mslice_indexer(key\u001b[39m.\u001b[39mstart, key\u001b[39m.\u001b[39mstop, key\u001b[39m.\u001b[39mstep)\n\u001b[0;32m--> 279\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39msuper\u001b[39;49m()\u001b[39m.\u001b[39;49m_convert_slice_indexer(key, kind\u001b[39m=\u001b[39;49mkind)\n",
"File \u001b[0;32m/usr/local/lib/python3.9/dist-packages/pandas/core/indexes/base.py:4041\u001b[0m, in \u001b[0;36mIndex._convert_slice_indexer\u001b[0;34m(self, key, kind)\u001b[0m\n\u001b[1;32m 4036\u001b[0m \u001b[39m\"\"\"\u001b[39;00m\n\u001b[1;32m 4037\u001b[0m \u001b[39mcalled from the getitem slicers, validate that we are in fact\u001b[39;00m\n\u001b[1;32m 4038\u001b[0m \u001b[39mintegers\u001b[39;00m\n\u001b[1;32m 4039\u001b[0m \u001b[39m\"\"\"\u001b[39;00m\n\u001b[1;32m 4040\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mis_integer() \u001b[39mor\u001b[39;00m is_index_slice:\n\u001b[0;32m-> 4041\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_validate_indexer(\u001b[39m\"\u001b[39;49m\u001b[39mslice\u001b[39;49m\u001b[39m\"\u001b[39;49m, key\u001b[39m.\u001b[39;49mstart, \u001b[39m\"\u001b[39;49m\u001b[39mgetitem\u001b[39;49m\u001b[39m\"\u001b[39;49m)\n\u001b[1;32m 4042\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_validate_indexer(\u001b[39m\"\u001b[39m\u001b[39mslice\u001b[39m\u001b[39m\"\u001b[39m, key\u001b[39m.\u001b[39mstop, \u001b[39m\"\u001b[39m\u001b[39mgetitem\u001b[39m\u001b[39m\"\u001b[39m)\n\u001b[1;32m 4043\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_validate_indexer(\u001b[39m\"\u001b[39m\u001b[39mslice\u001b[39m\u001b[39m\"\u001b[39m, key\u001b[39m.\u001b[39mstep, \u001b[39m\"\u001b[39m\u001b[39mgetitem\u001b[39m\u001b[39m\"\u001b[39m)\n",
"File \u001b[0;32m/usr/local/lib/python3.9/dist-packages/pandas/core/indexes/base.py:6308\u001b[0m, in \u001b[0;36mIndex._validate_indexer\u001b[0;34m(self, form, key, kind)\u001b[0m\n\u001b[1;32m 6305\u001b[0m \u001b[39massert\u001b[39;00m kind \u001b[39min\u001b[39;00m [\u001b[39m\"\u001b[39m\u001b[39mgetitem\u001b[39m\u001b[39m\"\u001b[39m, \u001b[39m\"\u001b[39m\u001b[39miloc\u001b[39m\u001b[39m\"\u001b[39m]\n\u001b[1;32m 6307\u001b[0m \u001b[39mif\u001b[39;00m key \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m \u001b[39mand\u001b[39;00m \u001b[39mnot\u001b[39;00m is_integer(key):\n\u001b[0;32m-> 6308\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_invalid_indexer(form, key)\n",
"\u001b[0;31mTypeError\u001b[0m: cannot do slice indexing on Int64Index with these indexers [30] of type Integer"
]
}
],
"source": [
@ -220,7 +94,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": null,
"id": "dc0a7b57",
"metadata": {},
"outputs": [],
@ -231,9 +105,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
"display_name": "SageMath 9.2",
"language": "sage",
"name": "sagemath"
},
"language_info": {
"codemirror_mode": {
@ -245,7 +119,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
"version": "3.9.2"
}
},
"nbformat": 4,

Loading…
Cancel
Save