Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Tags
#python
Question

Syntax for Creating DataFrames from

  1. Lists
  2. Dictionary
  3. Series
  4. nd.array
Answer

Syntax for Creating DataFrames
pd.Dataframe

  1. Lists
    pd.Dataframe{'columnName1':['val1','val2'], 'columnName2':[1,2]}
  2. Dictionary
    pd.Dataframe{'columnName1':{key1:value1}, 'columnName2':[key2:val2]}
  3. Series
    series1 = pd.Series([values],index=[indexes])
    series2 = pd.Series(....)
    #they have the same kind of indexes, eg by year.
    newDF = pd.Dataframe({'colName1':series1,'colName2':series2})
  4. nd.array
    Create an ndarrays with years. np.array([2001,2020,2019])
    Create a dict with the ndarray. dict = {'year':np_arr}
    Pass this dict to a new DataFrame. df = pd.DataFrame(dict)
    #it will have an index sequenced, column name year, with the values in the np array

Tags
#python
Question

Syntax for Creating DataFrames from

  1. Lists
  2. Dictionary
  3. Series
  4. nd.array
Answer
?

Tags
#python
Question

Syntax for Creating DataFrames from

  1. Lists
  2. Dictionary
  3. Series
  4. nd.array
Answer

Syntax for Creating DataFrames
pd.Dataframe

  1. Lists
    pd.Dataframe{'columnName1':['val1','val2'], 'columnName2':[1,2]}
  2. Dictionary
    pd.Dataframe{'columnName1':{key1:value1}, 'columnName2':[key2:val2]}
  3. Series
    series1 = pd.Series([values],index=[indexes])
    series2 = pd.Series(....)
    #they have the same kind of indexes, eg by year.
    newDF = pd.Dataframe({'colName1':series1,'colName2':series2})
  4. nd.array
    Create an ndarrays with years. np.array([2001,2020,2019])
    Create a dict with the ndarray. dict = {'year':np_arr}
    Pass this dict to a new DataFrame. df = pd.DataFrame(dict)
    #it will have an index sequenced, column name year, with the values in the np array

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.