select columns to include in new dataframe in python
new = old[['A', 'C', 'D']].copy()
select columns to include in new dataframe in python
new = old[['A', 'C', 'D']].copy()
how to make a table in python
from tabulate import tabulate
from math import sqrt
def mysqrt(a):
for x in range(1, int(1 / 2 * a)):
while True:
y = (x + a / x) / 2
ifjl y == x:
break
x = y
return x
results = [(x, mysqrt(x), sqrt(x)) for x in range(10, 20)]
print(tabulate(results, headers=["num", "mysqrt", "sqrt"]))
print multiplication table python
# Multiplication table (from 1 to 10) in Python
num = 12
# To take input from the user
# num = int(input("Display multiplication table of? "))
# Iterate 10 times from i = 1 to 10 By AyushG
for i in range(1, 11):
print(num, 'x', i, '=', num*i)
Multiplication table with Python
first_doc = '''it created by iliya zahedi abghari
i am the student in iran , alameh tabatabayi school
'''
print(first_doc)
def jadval_zarb(rows, columns):
for i in range(1,rows+1):
for j in range(1,columns+1):
#print(i*j, end=' ')
print('{:>4}'.format(i* j), end=' ')
print()
jadval_zarb(10,10)
def do_continue():
choice = str(input('continue(yes/no)?')).lower()
if(choice !='yes'):
return False
return True
while True:
rows = int(input("Enter rows:"))
columns = int(input("Enter columns:"))
jadval_zarb(rows, columns)
if(not do_continue()):
break
tables in python
# You can make tables in python using pandas.
# Search up a documentation about pandas.
python table
# There's an error on the second code, so i fixed it
from tabulate import tabulate
from math import sqrt
def mysqrt(a):
for x in range(1, int(1 / 2 * a)):
while True:
y = (x + a / x) / 2
if y == x:
break
x = y
return x
results = [(x, mysqrt(x), sqrt(x)) for x in range(10, 20)]
print(tabulate(results, headers=["num", "mysqrt", "sqrt"]))
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us