Answers for "df in python"

3

creata daframe python

d = {'col1': [1, 2], 'col2': [3, 4]}
df = pd.DataFrame(data=d)
df
Posted by: Guest on May-04-2020
6

create a dataframe python

import numpy as np
import pandas as pd
vect1=np.zeros(10)
vect2=np.ones(10)
df=pd.DataFrame({'col1':vect1,'col2':vect2})
Posted by: Guest on March-21-2020
1

dataframein python

import pandas as pd

data = {'First Column Name':  ['First value', 'Second value',...],
        'Second Column Name': ['First value', 'Second value',...],
         ....
        }

df = pd.DataFrame (data, columns = ['First Column Name','Second Column Name',...])
Posted by: Guest on July-04-2020

Python Answers by Framework

Browse Popular Code Answers by Language